Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/locales/ar/auth.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@
"BACK_BUTTON": "إلى الخلف",
"BACK_TO_SIGN_IN_BUTTON": "العودة إلى تسجيل الدخول",
"EMAIL_SIGN_IN_METHOD": "تسجيل الدخول عبر البريد الإلكتروني",
"MOBILE_APP_NOT_INSTALLED_MESSAGE": "يبدو أنك طلبت رابطًا للهاتف المحمول ولكن لم يتم تثبيت تطبيقنا على هذا الجهاز.",
"MOBILE_BACK_TO_LOGIN": "العودة لتسجيل الدخول",
"MOBILE_GET_APP_FROM_APPLE_STORE": "احصل عليه من متجر تطبيقات أبل",
"MOBILE_GET_APP_FROM_GOOGLE_PLAY_STORE": "احصل عليه من متجر Google Play",
"NAME_FIELD_LABEL": "اسم*",
"EMAIL_INPUT_PLACEHOLDER": "بريد إلكتروني",
"EMAIL_INPUT_PLACEHOLDER_REQUIRED": "بريد إلكتروني*",
"NOT_SIGNED_IN_TOOLTIP": "أنت غير مسجل الدخول.",
"PASSWORD_FIELD_LABEL": "كلمة المرور",
"PASSWORD_SIGN_IN_METHOD": "تسجيل الدخول عبر كلمة المرور",
"RESEND_EMAIL_BUTTON": "إعادة إرسال البريد الإلكتروني",
Expand All @@ -26,7 +21,6 @@
"REGISTER": {
"SAVE_ACTIONS_LABEL": "السماح بجمع البيانات لأغراض تعليمية. <1>اعرف المزيد</1>"
},
"SIGN_UP_SUCCESS_TITLE": "مرحباً!",
"SWITCH_ACCOUNT_TEXT": "قم باستعمال حساب آخر",
"API_UNAVAILABLE_TITLE": "خطأ في اتصال الخادم",
"API_UNAVAILABLE_EXPLANATION": "يبدو أن خادم Graasp غير قابل للوصول في الوقت الحالي.",
Expand Down
6 changes: 0 additions & 6 deletions src/locales/de/auth.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@
"BACK_BUTTON": "Zurück",
"BACK_TO_SIGN_IN_BUTTON": "Zurück zur Anmeldung",
"EMAIL_SIGN_IN_METHOD": "E-Mail Anmeldung",
"MOBILE_APP_NOT_INSTALLED_MESSAGE": "Sie haben einen mobilen Link angefordert, aber unsere App ist auf diesem Gerät nicht installiert.",
"MOBILE_BACK_TO_LOGIN": "Zurück zur Anmeldung",
"MOBILE_GET_APP_FROM_APPLE_STORE": "Im Apple App Store herunterladen",
"MOBILE_GET_APP_FROM_GOOGLE_PLAY_STORE": "Im Google Play Store herunterladen",
"NAME_FIELD_LABEL": "Name*",
"EMAIL_INPUT_PLACEHOLDER": "E-Mail",
"EMAIL_INPUT_PLACEHOLDER_REQUIRED": "E-Mail*",
"NOT_SIGNED_IN_TOOLTIP": "Sie sind nicht eingeloggt.",
"PASSWORD_FIELD_LABEL": "Passwort",
"PASSWORD_SIGN_IN_METHOD": "Passwort Anmeldung",
"RESEND_EMAIL_BUTTON": "E-Mail wieder senden",
Expand All @@ -26,7 +21,6 @@
"REGISTER": {
"SAVE_ACTIONS_LABEL": "Erlauben Sie die Datenerfassung für Bildungszwecke. <1>Weitere Informationen</1>"
},
"SIGN_UP_SUCCESS_TITLE": "Willkommen!",
"SWITCH_ACCOUNT_TEXT": "Auf ein anderes Konto wechseln",
"API_UNAVAILABLE_TITLE": "Serververbindungsfehler",
"API_UNAVAILABLE_EXPLANATION": "Der Graasp-Server scheint momentan nicht erreichbar.",
Expand Down
20 changes: 8 additions & 12 deletions src/locales/en/auth.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
{
"BACK_BUTTON": "Back",
"BACK_TO_SIGN_IN_BUTTON": "Back to login",
"EMAIL_SIGN_IN_METHOD": "Email Log in",
"MOBILE_APP_NOT_INSTALLED_MESSAGE": "It looks like you requested a mobile link but you do not have our app installed on this device.",
"MOBILE_BACK_TO_LOGIN": "Back to login",
"MOBILE_GET_APP_FROM_APPLE_STORE": "Get from the Apple App Store",
"MOBILE_GET_APP_FROM_GOOGLE_PLAY_STORE": "Get from the Google Play Store",
"EMAIL_SIGN_IN_METHOD": "Login with email",
"NAME_FIELD_LABEL": "Name*",
"EMAIL_INPUT_PLACEHOLDER": "Email",
"EMAIL_INPUT_PLACEHOLDER_REQUIRED": "Email*",
"NOT_SIGNED_IN_TOOLTIP": "You are not logged in.",
"PASSWORD_FIELD_LABEL": "Password",
"PASSWORD_SIGN_IN_METHOD": "Password Log In",
"PASSWORD_SIGN_IN_METHOD": "Login with password",
"RESEND_EMAIL_BUTTON": "Resend Email",
"SIGN_IN_BUTTON": "Receive a link to log in",
"SIGN_IN_PASSWORD_BUTTON": "Log in",
"LOGIN_TITLE": "Log In",
"SIGN_IN_LINK_TEXT": "Already have an account? Log in",
"SIGN_IN_BUTTON": "Login with my email",
"SIGN_IN_PASSWORD_BUTTON": "Login",
"LOGIN_TITLE": "Welcome back!",
"SIGN_IN_LINK_CATCH_TEXT": "Already have an account?",
"SIGN_IN_LINK_TEXT": "Log in",
"SIGN_IN_SUCCESS_EMAIL_PROBLEM": "If you did not receive any email, check your spam. If you used an institutional email (ie. school, company), it might have been blocked and will have to wait until the email is released by your spam system.",
"SIGN_IN_SUCCESS_TEXT": "Please check your inbox <bold>{{email}}</bold> to retrieve your personal login link to access Graasp. This can take several minutes.",
"SIGN_IN_SUCCESS_TITLE": "Welcome back!",
"SIGN_UP_LINK_CATCH_TEXT": "Pas registered yet?",
"SIGN_UP_BUTTON": "Create my account",
"REGISTER_TITLE": "Welcome to Graasp!",
"SIGN_UP_LINK_TEXT": "Create an account",
"REGISTER": {
"SAVE_ACTIONS_LABEL": "Allow data collection for education purposes. <1>Learn more</1>"
},
"SIGN_UP_SUCCESS_TITLE": "Welcome!",
"SWITCH_ACCOUNT_TEXT": "Switch to another account",
"API_UNAVAILABLE_TITLE": "Server Connection Error",
"API_UNAVAILABLE_EXPLANATION": "The Graasp server seems unreachable for the moment.",
Expand Down
6 changes: 0 additions & 6 deletions src/locales/es/auth.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@
"BACK_BUTTON": "Atrás",
"BACK_TO_SIGN_IN_BUTTON": "Volver al inicio de sesión",
"EMAIL_SIGN_IN_METHOD": "Iniciar sesión por correo electrónico",
"MOBILE_APP_NOT_INSTALLED_MESSAGE": "Parece que solicitaste un enlace móvil pero no tienes nuestra aplicación instalada en este dispositivo.",
"MOBILE_BACK_TO_LOGIN": "Atrás para iniciar sesión",
"MOBILE_GET_APP_FROM_APPLE_STORE": "Obtener de la tienda de aplicaciones de Apple",
"MOBILE_GET_APP_FROM_GOOGLE_PLAY_STORE": "Obtener de Google Play Store",
"NAME_FIELD_LABEL": "Nombre*",
"EMAIL_INPUT_PLACEHOLDER": "Correo electrónico",
"EMAIL_INPUT_PLACEHOLDER_REQUIRED": "Correo electrónico*",
"NOT_SIGNED_IN_TOOLTIP": "No has iniciado sesión.",
"PASSWORD_FIELD_LABEL": "Contraseña",
"PASSWORD_SIGN_IN_METHOD": "Contraseña Iniciar sesión",
"RESEND_EMAIL_BUTTON": "Reenviar email",
Expand All @@ -26,7 +21,6 @@
"REGISTER": {
"SAVE_ACTIONS_LABEL": "Permitir la recopilación de datos con fines educativos. <1>Más información</1>"
},
"SIGN_UP_SUCCESS_TITLE": "¡Bienvenido!",
"SWITCH_ACCOUNT_TEXT": "Cambiar a otra cuenta",
"API_UNAVAILABLE_TITLE": "Error de conexión del servidor",
"API_UNAVAILABLE_EXPLANATION": "El servidor Graasp parece inaccesible por el momento.",
Expand Down
22 changes: 9 additions & 13 deletions src/locales/fr/auth.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
{
"BACK_BUTTON": "Retour",
"BACK_TO_SIGN_IN_BUTTON": "Retour à la connexion",
"EMAIL_SIGN_IN_METHOD": "Connexion par e-mail",
"MOBILE_APP_NOT_INSTALLED_MESSAGE": "Il semble que vous ayez demandé un lien mobile mais que vous n'ayez pas installé notre application sur cet appareil.",
"MOBILE_BACK_TO_LOGIN": "Retour à la connexion",
"MOBILE_GET_APP_FROM_APPLE_STORE": "Télécharger depuis l'App Store Apple",
"MOBILE_GET_APP_FROM_GOOGLE_PLAY_STORE": "Télécharger sur Google Play Store",
"EMAIL_SIGN_IN_METHOD": "Se connecter par e-mail",
"NAME_FIELD_LABEL": "Nom*",
"EMAIL_INPUT_PLACEHOLDER": "E-mail",
"EMAIL_INPUT_PLACEHOLDER_REQUIRED": "E-mail*",
"NOT_SIGNED_IN_TOOLTIP": "Vous n'êtes pas connecté.",
"PASSWORD_FIELD_LABEL": "Mot de passe",
"PASSWORD_SIGN_IN_METHOD": "Connexion avec mot de passe",
"PASSWORD_SIGN_IN_METHOD": "Me connecter avec un mot de passe",
"RESEND_EMAIL_BUTTON": "Renvoyer l'e-mail",
"SIGN_IN_BUTTON": "Se connecter avec un lien",
"SIGN_IN_PASSWORD_BUTTON": "Se connecter",
"LOGIN_TITLE": "Connection",
"SIGN_IN_LINK_TEXT": "Vous avez déjà un compte ? Se connecter",
"SIGN_IN_BUTTON": "Me connecter par email",
"SIGN_IN_PASSWORD_BUTTON": "Me connecter",
"LOGIN_TITLE": "Bon retour !",
"SIGN_IN_LINK_CATCH_TEXT": "Vous avez déjà un compte ?",
"SIGN_IN_LINK_TEXT": "Se connecter",
"SIGN_IN_SUCCESS_EMAIL_PROBLEM": "Si vous n'avez reçu aucun email, vérifiez vos spams. Si vous avez utilisé un email institutionnel (ex : école, entreprise), il est possible qu'il ait été bloqué et vous devrez attendre que l'email soit libéré par votre système de spam.",
"SIGN_IN_SUCCESS_TEXT": "Veuillez consulter votre boîte de réception <bold>{{email}}</bold> pour récupérer votre lien de connexion personnel pour accéder à Graasp. Cela peut prendre plusieurs minutes.",
"SIGN_IN_SUCCESS_TITLE": "Bon retour !",
"SIGN_UP_LINK_CATCH_TEXT": "Pas encore enregistré ?",
"SIGN_UP_BUTTON": "Créer mon compte",
"REGISTER_TITLE": "Bienvenue sur Graasp !",
"SIGN_UP_LINK_TEXT": "Créer un compte",
"SIGN_UP_LINK_TEXT": "Créer mon compte",
"REGISTER": {
"SAVE_ACTIONS_LABEL": "Autoriser la collecte de données à des fins pédagogiques. <1>En savoir plus</1>"
},
"SIGN_UP_SUCCESS_TITLE": "Bienvenue !",
"SWITCH_ACCOUNT_TEXT": "Changer de compte",
"API_UNAVAILABLE_TITLE": "Erreur de connection au serveur",
"API_UNAVAILABLE_EXPLANATION": "Le serveur Graasp semble inaccessible pour le moment.",
Expand Down
6 changes: 0 additions & 6 deletions src/locales/it/auth.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@
"BACK_BUTTON": "Indietro",
"BACK_TO_SIGN_IN_BUTTON": "Torna al login",
"EMAIL_SIGN_IN_METHOD": "Accedi via e-mail",
"MOBILE_APP_NOT_INSTALLED_MESSAGE": "Sembra che tu abbia richiesto un collegamento mobile ma non hai la nostra app installata su questo dispositivo.",
"MOBILE_BACK_TO_LOGIN": "Torna al login",
"MOBILE_GET_APP_FROM_APPLE_STORE": "Ottieni dall'App Store di Apple",
"MOBILE_GET_APP_FROM_GOOGLE_PLAY_STORE": "Ottieni dal Google Play Store",
"NAME_FIELD_LABEL": "Nome*",
"EMAIL_INPUT_PLACEHOLDER": "E-mail",
"EMAIL_INPUT_PLACEHOLDER_REQUIRED": "E-mail*",
"NOT_SIGNED_IN_TOOLTIP": "Non sei registrato.",
"PASSWORD_FIELD_LABEL": "Parola d'ordine",
"PASSWORD_SIGN_IN_METHOD": "Accedi con password",
"RESEND_EMAIL_BUTTON": "Rinvia l'e-mail",
Expand All @@ -26,7 +21,6 @@
"REGISTER": {
"SAVE_ACTIONS_LABEL": "Consenti la raccolta dati per scopi didattici. <1>Scopri di più</1>"
},
"SIGN_UP_SUCCESS_TITLE": "Benvenuto!",
"SWITCH_ACCOUNT_TEXT": "Passa a un altro account",
"API_UNAVAILABLE_TITLE": "Errore di connessione al server",
"API_UNAVAILABLE_EXPLANATION": "Al momento il server Graasp sembra irraggiungibile.",
Expand Down
1 change: 1 addition & 0 deletions src/modules/auth/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export function Footer() {
<LanguageSwitch
lang={i18n.language}
onChange={(lang) => i18n.changeLanguage(lang)}
dense={false}
/>
<Typography variant="caption" color="darkgrey">
© Graasp 2014 - {new Date().getFullYear()}
Expand Down
12 changes: 1 addition & 11 deletions src/modules/auth/components/LeftContentContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { JSX } from 'react';
import { useTranslation } from 'react-i18next';

import { Box, Stack } from '@mui/material';
import { Stack } from '@mui/material';

import { NS } from '@/config/constants';
import { PLATFORM_ADVERTISEMENT_CONTAINER_ID } from '@/config/selectors';
Expand All @@ -15,7 +15,6 @@ import { AUTH } from '~auth/langs';

import { BACKGROUND_PATTERN } from '../constants';
import { APIChecker } from './APIChecker';
import { BrandingLogo } from './BrandingLogo';
import { Footer } from './Footer';
import { PlatformContent } from './leftContent/PlatformContent';
import { styledBox } from './styles';
Expand All @@ -31,15 +30,6 @@ export function LeftContentContainer({

return (
<>
<Box
display={{
xs: 'none',
sm: 'block',
md: 'block',
}}
>
<BrandingLogo />
</Box>
<Stack
direction="row"
// need to be minHeight for screen in landscape with potentially shallow heights
Expand Down
65 changes: 0 additions & 65 deletions src/modules/auth/components/MobileAuth.tsx

This file was deleted.

7 changes: 6 additions & 1 deletion src/modules/auth/components/common/FormHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ export function FormHeader({ id, title }: FormHeaderProps): JSX.Element {
const theme = useTheme();
return (
<Stack spacing={1}>
<GraaspLogo height={90} sx={{ fill: theme.palette.primary.main }} />
<Stack direction="row" justifyContent="center" alignItems="center">
<GraaspLogo height={60} sx={{ fill: theme.palette.primary.main }} />
<Typography variant="h2" id={id} color="primary">
Graasp
</Typography>
</Stack>
<Typography variant="h4" component="h2" id={id} textAlign="center">
{title}
</Typography>
Expand Down
15 changes: 11 additions & 4 deletions src/modules/auth/components/register/Register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import { useMutation } from '@tanstack/react-query';
import { Link, useLocation, useNavigate } from '@tanstack/react-router';

import { TypographyLink } from '@/components/ui/TypographyLink';
import { CustomLink } from '@/components/ui/CustomLink';
import { NS } from '@/config/constants';
import {
EMAIL_SIGN_UP_FIELD_ID,
Expand Down Expand Up @@ -284,9 +284,16 @@ export function RegisterForm({ search, initialData }: Readonly<RegisterProps>) {
{t('SIGN_UP_BUTTON')}
</Button>
</Stack>
<TypographyLink color="textSecondary" to="/auth/login" search={search}>
{t('SIGN_IN_LINK_TEXT')}
</TypographyLink>
<Typography variant="body2">
{t('SIGN_IN_LINK_CATCH_TEXT')}{' '}
<CustomLink
to="/auth/login"
search={search}
sx={{ fontWeight: 'bold', textDecoration: 'none' }}
>
{t('SIGN_IN_LINK_TEXT')}
</CustomLink>
</Typography>
</Stack>
);
}
45 changes: 45 additions & 0 deletions src/modules/auth/components/signIn/LoginMethodContext.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { ReactNode, createContext, useContext, useMemo, useState } from 'react';

import { LocalStorage } from '@/config/localStorage';

const LOGIN_MODE_KEY = 'login-mode';

type Mode = 'magic-link' | 'password';

type LoginMethodContextType = {
mode: Mode;
setMode: (newMode: Mode) => void;
};

const LoginMethodContext = createContext<LoginMethodContextType>({
mode: 'magic-link',
setMode: () => {},
});

/**
* Return login mode to use depending on local storage, or default to 'magic-link'
* @returns [mode, setMode]
*/
export const LoginMethodContextProvider = ({
children,
}: Readonly<{ children: ReactNode }>) => {
const [mode, setMode] = useState<Mode>(
(LocalStorage.getItem(LOGIN_MODE_KEY) as Mode | null) ?? 'magic-link',
);

const setModeAndSetCache = (newMode: Mode) => {
setMode(newMode);
LocalStorage.setItem(LOGIN_MODE_KEY, newMode);
};

const value = useMemo(() => ({ mode, setMode: setModeAndSetCache }), [mode]);

return (
<LoginMethodContext.Provider value={value}>
{children}
</LoginMethodContext.Provider>
);
};

export const useLoginMethodContext = (): LoginMethodContextType =>
useContext(LoginMethodContext);
Loading
Loading