Skip to content

Commit

Permalink
Improve Home Screen (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinejaussoin authored Mar 25, 2023
1 parent 68d75cc commit aa2bb95
Show file tree
Hide file tree
Showing 19 changed files with 254 additions and 99 deletions.
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"crypto-js": "4.1.1",
"date-fns": "2.29.3",
"emoji-mart": "3.0.1",
"emotion": "^11.0.0",
"eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0",
"eslint-config-react-app": "^7.0.1",
Expand Down
103 changes: 103 additions & 0 deletions frontend/src/components/SplitButton/SplitButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import * as React from 'react';
import Button from '@mui/material/Button';
import ButtonGroup from '@mui/material/ButtonGroup';
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
import ClickAwayListener from '@mui/material/ClickAwayListener';
import Grow from '@mui/material/Grow';
import Paper from '@mui/material/Paper';
import Popper from '@mui/material/Popper';
import MenuList from '@mui/material/MenuList';

type SplitButtonProps = {
label?: string;
children?: React.ReactNode;
icon?: React.ReactNode;
disabled?: boolean;
secondary?: boolean;
large?: boolean;
onClick: () => void;
};

export default function SplitButton({
label,
icon,
large,
disabled,
secondary,
children,
onClick,
}: SplitButtonProps) {
const [open, setOpen] = React.useState(false);
const anchorRef = React.useRef<HTMLDivElement>(null);

const handleToggle = () => {
setOpen((prevOpen) => !prevOpen);
};

const handleClose = (event: Event) => {
if (
anchorRef.current &&
anchorRef.current.contains(event.target as HTMLElement)
) {
return;
}

setOpen(false);
};

return (
<>
<ButtonGroup
variant="contained"
color={secondary ? 'secondary' : 'primary'}
size={large ? 'large' : 'medium'}
ref={anchorRef}
aria-label={label}
disabled={disabled}
>
<Button disabled={disabled} startIcon={icon} onClick={onClick}>
{label}
</Button>
<Button
disabled={disabled}
size="small"
aria-controls={open ? 'split-button-menu' : undefined}
aria-expanded={open ? 'true' : undefined}
aria-label="select other options"
aria-haspopup="menu"
onClick={handleToggle}
>
<ArrowDropDownIcon />
</Button>
</ButtonGroup>
<Popper
sx={{
zIndex: 1,
}}
open={open}
anchorEl={anchorRef.current}
role={undefined}
transition
disablePortal
>
{({ TransitionProps, placement }) => (
<Grow
{...TransitionProps}
style={{
transformOrigin:
placement === 'bottom' ? 'center top' : 'center bottom',
}}
>
<Paper>
<ClickAwayListener onClickAway={handleClose}>
<MenuList id="split-button-menu" autoFocusItem>
{children}
</MenuList>
</ClickAwayListener>
</Paper>
</Grow>
)}
</Popper>
</>
);
}
7 changes: 4 additions & 3 deletions frontend/src/translations/locales/ar-SA.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"welcome": "مرحبا، {{name}}",
"anonWarning": "أنت تستخدم حساب مجهول. قد ترغب في تسجيل الدخول للتأكد من أن البيانات الخاصة بك يمكن استرجاعها عند استخدام جهاز آخر.",
"howDoesThatWork": "كيف يعمل ذلك؟",
"login": "تسجيل الدخول"
"login": "تسجيل الدخول",
"searchNoMatch": "لم نتمكن من العثور على رجعي يطابق بحثك ({{search}})."
},
"PreviousGame": {
"createdBy": "تم إنشاؤها بواسطة",
Expand Down Expand Up @@ -182,7 +183,7 @@
"standardTab": {
"header": "موضوع جديد",
"text": ": انقر أدناه و إبدء إعادة النظر",
"button": "إنشاء جلسة عمل جديدة",
"button": "بدء ريترو",
"customizeButton": "تخصيص"
},
"optionsTab": {
Expand Down Expand Up @@ -433,7 +434,7 @@
"wantToPayYearly": "أريد أن أدفع سنويا (كل 12 شهرا)، واحصل على شهر واحد مجانا في السنة!"
},
"Encryption": {
"createEncryptedSession": "جلسة مشفرة",
"createEncryptedSession": "بدء ريترو مشفر",
"sessionNotEncrypted": "هذه الجلسة غير مشفرة.",
"sessionEncryptedHaveKeyTooltip": "هذه الجلسة مشفرة، والمفتاح مخزون في المتصفح الخاص بك. يمكنك فتح هذه الجلسة دون الحاجة إلى توفير كلمة المرور مرة أخرى.",
"sessionEncryptedNoKeyTooltip": "هذه الجلسة مشفرة، والمفتاح غير مخزن في المتصفح الخاص بك. سوف يطلب منك مفتاح فك التشفير عند افتتاح هذه الجلسة.",
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/translations/locales/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"welcome": "Willkommen, {{name}}",
"anonWarning": "Du verwendest ein anonymes Konto. Du solltest dich einloggen, um sicherzustellen, dass deine Daten abgerufen werden können, wenn du ein anderes Gerät verwendest.",
"howDoesThatWork": "Wie funktioniert das?",
"login": "Anmelden"
"login": "Anmelden",
"searchNoMatch": "Wir konnten keine Retrospektive finden, die Ihrer Suche entspricht ({{search}})."
},
"PreviousGame": {
"createdBy": "Erstellt von",
Expand Down Expand Up @@ -182,7 +183,7 @@
"standardTab": {
"header": "Erstellen",
"text": "Klicke unten und starte deine Retrospektive:",
"button": "Erstelle eine neue Session",
"button": "Retro starten",
"customizeButton": "Personalisieren"
},
"optionsTab": {
Expand Down Expand Up @@ -433,7 +434,7 @@
"wantToPayYearly": "Ich möchte jährlich bezahlen (alle 12 Monate) und einen Monat gratis pro Jahr!"
},
"Encryption": {
"createEncryptedSession": "Verschlüsselte Sitzung",
"createEncryptedSession": "Starten Sie ein verschlüsseltes Retro",
"sessionNotEncrypted": "Diese Sitzung ist nicht verschlüsselt.",
"sessionEncryptedHaveKeyTooltip": "Diese Sitzung ist verschlüsselt und der Schlüssel wird in Ihrem Browser gespeichert. Sie können diese Sitzung öffnen, ohne das Passwort erneut eingeben zu müssen.",
"sessionEncryptedNoKeyTooltip": "Diese Sitzung ist verschlüsselt und der Schlüssel wird nicht in Ihrem Browser gespeichert. Sie werden beim Öffnen dieser Sitzung nach dem Entschlüsselungsschlüssel gefragt.",
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/translations/locales/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"welcome": "Welcome, {{name}}",
"anonWarning": "You are using an Anonymous account. You might want to login to make sure your data can be retrieved when using another device.",
"howDoesThatWork": "How does that work?",
"login": "Login"
"login": "Login",
"searchNoMatch": "We could not find a retrospective matching your search ({{search}})."
},
"PreviousGame": {
"createdBy": "Created by",
Expand Down Expand Up @@ -182,7 +183,7 @@
"standardTab": {
"header": "Create",
"text": "Click below and start retrospecting:",
"button": "Create a new session",
"button": "Start a Retro",
"customizeButton": "Customise"
},
"optionsTab": {
Expand Down Expand Up @@ -433,7 +434,7 @@
"wantToPayYearly": "I want to pay annually (every 12 months), and get one month free per year!"
},
"Encryption": {
"createEncryptedSession": "Encrypted Session",
"createEncryptedSession": "Start an Encrypted Retro",
"sessionNotEncrypted": "This session is not encrypted.",
"sessionEncryptedHaveKeyTooltip": "This session is encrypted, and the key is stored in your browser. You can open this session without having to provide the password again.",
"sessionEncryptedNoKeyTooltip": "This session is encrypted, and the key is not stored in your browser. You will be asked for the decryption key when opening this session.",
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/translations/locales/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"welcome": "Bienvenido, {{name}}",
"anonWarning": "Estás usando una cuenta anónima. Tal vez quieras iniciar sesión para asegurarte de que tus datos pueden ser recuperados cuando usas otro dispositivo.",
"howDoesThatWork": "¿Cómo funciona esto?",
"login": "Ingresar"
"login": "Ingresar",
"searchNoMatch": "No hemos podido encontrar un retrospectivo que coincida con tu búsqueda ({{search}})."
},
"PreviousGame": {
"createdBy": "Creado por",
Expand Down Expand Up @@ -182,7 +183,7 @@
"standardTab": {
"header": "Crear una sesión",
"text": "Pulse abajo y empieze la retrospectiva:",
"button": "Crear una sesión nueva",
"button": "Iniciar una Retro",
"customizeButton": "Personalizar"
},
"optionsTab": {
Expand Down Expand Up @@ -433,7 +434,7 @@
"wantToPayYearly": "Quiero pagar anualmente (cada 12 meses), y obtener un mes gratis por año!"
},
"Encryption": {
"createEncryptedSession": "Sesión cifrada",
"createEncryptedSession": "Iniciar una Retro Cifrada",
"sessionNotEncrypted": "Esta sesión no está cifrada.",
"sessionEncryptedHaveKeyTooltip": "Esta sesión está cifrada, y la clave se almacena en su navegador. Puede abrir esta sesión sin tener que proporcionar la contraseña de nuevo.",
"sessionEncryptedNoKeyTooltip": "Esta sesión está cifrada, y la clave no se almacena en su navegador. Se le pedirá la clave de descifrado al abrir esta sesión.",
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/translations/locales/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"welcome": "Bienvenue, {{name}}",
"anonWarning": "Vous utilisez un compte anonyme. Connectez-vous afin que vos données puissent être récupérées lorsque vous utilisez un autre appareil.",
"howDoesThatWork": "Comment cela fonctionne-t-il ?",
"login": "Connexion"
"login": "Connexion",
"searchNoMatch": "Nous n'avons pu trouver une retrospective correspondant à votre recherche ({{search}})."
},
"PreviousGame": {
"createdBy": "Créé par",
Expand Down Expand Up @@ -182,7 +183,7 @@
"standardTab": {
"header": "Créer",
"text": "Cliquez ci-dessous et commencez à retrospecter:",
"button": "Nouvelle session",
"button": "Commencer une Rétro",
"customizeButton": "Personnaliser"
},
"optionsTab": {
Expand Down Expand Up @@ -433,7 +434,7 @@
"wantToPayYearly": "Je souhaite payer annuellement et obtenir un mois gratuit par an !"
},
"Encryption": {
"createEncryptedSession": "Session cryptée",
"createEncryptedSession": "Commencer une Rétro cryptée",
"sessionNotEncrypted": "Cette session n'est pas cryptée.",
"sessionEncryptedHaveKeyTooltip": "Cette session est chiffrée et la clef est stockée dans votre navigateur. Vous pouvez ouvrir cette session sans avoir à en donner le mot de passe.",
"sessionEncryptedNoKeyTooltip": "Cette session est chiffrée et la clef n'a pas été trouvée dans votre navigateur. Il vous sera demandé de donner le mot de passe lors de l'ouverture de cette session.",
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/translations/locales/hu-HU.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"welcome": "Isten hozott, {{name}}",
"anonWarning": "",
"howDoesThatWork": "Hogyan működik?",
"login": ""
"login": "",
"searchNoMatch": ""
},
"PreviousGame": {
"createdBy": "Készítette",
Expand Down Expand Up @@ -182,7 +183,7 @@
"standardTab": {
"header": "Ülés létrehozása",
"text": "Kattints ide a kezdéshez:",
"button": "Új ülés indítása",
"button": "",
"customizeButton": "Testreszab"
},
"optionsTab": {
Expand Down Expand Up @@ -433,7 +434,7 @@
"wantToPayYearly": "Évente szeretnék fizetni (12 havonta), és évente egy hónapot ingyen kapok!"
},
"Encryption": {
"createEncryptedSession": "Titkosított munkamenet",
"createEncryptedSession": "",
"sessionNotEncrypted": "Ez a munkamenet nincs titkosítva.",
"sessionEncryptedHaveKeyTooltip": "Ez a munkamenet titkosított, és a kulcsot a böngésző tárolja. Ezt a munkamenetet a jelszó újbóli megadása nélkül is megnyithatja.",
"sessionEncryptedNoKeyTooltip": "Ez a munkamenet titkosított, és a kulcsot nem tárolja a böngésző. A munkamenet megnyitásakor a rendszer kérni fogja a visszafejtési kulcsot.",
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/translations/locales/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"welcome": "Benvenuto, {{name}}",
"anonWarning": "Stai utilizzando un account anonimo. Potresti voler effettuare il login per assicurarsi che i tuoi dati possano essere recuperati quando usi un altro dispositivo.",
"howDoesThatWork": "Come funziona quello?",
"login": "Accedi"
"login": "Accedi",
"searchNoMatch": "Non siamo riusciti a trovare una retrospettiva corrispondente alla tua ricerca ({{search}})."
},
"PreviousGame": {
"createdBy": "Creato da",
Expand Down Expand Up @@ -182,7 +183,7 @@
"standardTab": {
"header": "Crea",
"text": "Clicca qui sotto per iniziare la retrospective",
"button": "Crea una nuova sessione",
"button": "Avvia un retro",
"customizeButton": "Personalizza"
},
"optionsTab": {
Expand Down Expand Up @@ -433,7 +434,7 @@
"wantToPayYearly": "Voglio pagare annualmente (ogni 12 mesi), e ottenere un mese gratis all'anno!"
},
"Encryption": {
"createEncryptedSession": "Sessione Criptata",
"createEncryptedSession": "Avvia un retro crittografato",
"sessionNotEncrypted": "Questa sessione non è cifrata.",
"sessionEncryptedHaveKeyTooltip": "Questa sessione è crittografata e la chiave è memorizzata nel tuo browser. Puoi aprire questa sessione senza dover fornire nuovamente la password.",
"sessionEncryptedNoKeyTooltip": "Questa sessione è crittografata e la chiave non è memorizzata nel tuo browser. Ti verrà chiesta la chiave di decrittazione quando apri questa sessione.",
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/translations/locales/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"welcome": "ようこそ、 {{name}}",
"anonWarning": "匿名アカウントを使用しています。別のデバイスを使用しているときにデータを取得できることを確認するためにログインする場合があります。",
"howDoesThatWork": "それはどのように機能しますか?",
"login": "ログイン"
"login": "ログイン",
"searchNoMatch": "検索に一致する回顧展が見つかりませんでした ({{search}})。"
},
"PreviousGame": {
"createdBy": "作成者:",
Expand Down Expand Up @@ -182,7 +183,7 @@
"standardTab": {
"header": "作成",
"text": "セッションを作成してレトロスペクティブをはじめる",
"button": "新しいセッションを作成する",
"button": "Retroを始める",
"customizeButton": "カスタマイズ"
},
"optionsTab": {
Expand Down Expand Up @@ -433,7 +434,7 @@
"wantToPayYearly": "私は毎年(12ヶ月ごと)を支払い、毎年1ヶ月無料にしたいと思います!"
},
"Encryption": {
"createEncryptedSession": "暗号化セッション",
"createEncryptedSession": "暗号化されたレトロを開始",
"sessionNotEncrypted": "このセッションは暗号化されていません。",
"sessionEncryptedHaveKeyTooltip": "このセッションは暗号化されており、キーはブラウザに保存されます。再度パスワードを入力することなく、このセッションを開くことができます。",
"sessionEncryptedNoKeyTooltip": "このセッションは暗号化されており、キーはブラウザに保存されていません。このセッションを開くときに復号キーを求められます。",
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/translations/locales/nl-NL.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"welcome": "Welkom, {{name}}",
"anonWarning": "Je gebruikt een anonieme account. Je kunt misschien inloggen om ervoor te zorgen dat je gegevens kunnen worden opgehaald wanneer je een ander apparaat gebruikt.",
"howDoesThatWork": "Hoe werkt dat?",
"login": "Aanmelden"
"login": "Aanmelden",
"searchNoMatch": "We konden geen terugwerkende kracht vinden die overeenkomt met uw zoekopdracht ({{search}})."
},
"PreviousGame": {
"createdBy": "Aangemaakt door",
Expand Down Expand Up @@ -182,7 +183,7 @@
"standardTab": {
"header": "Starten",
"text": "Klik hieronder en begin je retrospective:",
"button": "Start een nieuwe sessie",
"button": "Start een Retro",
"customizeButton": "Aanpassen"
},
"optionsTab": {
Expand Down Expand Up @@ -433,7 +434,7 @@
"wantToPayYearly": "Ik wil jaarlijks betalen (elke 12 maanden) en een maand gratis per jaar!"
},
"Encryption": {
"createEncryptedSession": "Versleutelde sessie",
"createEncryptedSession": "Start een versleutelde Retro",
"sessionNotEncrypted": "Deze sessie is niet versleuteld.",
"sessionEncryptedHaveKeyTooltip": "Deze sessie is versleuteld, en de sleutel wordt opgeslagen in uw browser. U kunt deze sessie openen zonder het wachtwoord opnieuw op te geven.",
"sessionEncryptedNoKeyTooltip": "Deze sessie is versleuteld en de sleutel is niet opgeslagen in uw browser. U wordt gevraagd om de decoderingssleutel bij het openen van deze sessie.",
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/translations/locales/pl-PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"welcome": "Witaj, {{name}}",
"anonWarning": "Używasz konta anonimowego. Możesz się zalogować, aby mieć pewność, że dane mogą być pobrane podczas korzystania z innego urządzenia.",
"howDoesThatWork": "Jak to działa?",
"login": "Logowanie"
"login": "Logowanie",
"searchNoMatch": "Nie mogliśmy znaleźć retrospektywnego pasującego do Twojego wyszukiwania ({{search}})."
},
"PreviousGame": {
"createdBy": "Utworzony przez",
Expand Down Expand Up @@ -182,7 +183,7 @@
"standardTab": {
"header": "Stwórz",
"text": "Kliknij poniżej i zacznij retrospektywę:",
"button": "Stwórz nową sesję",
"button": "Rozpocznij Retro",
"customizeButton": "Dostosuj"
},
"optionsTab": {
Expand Down Expand Up @@ -433,7 +434,7 @@
"wantToPayYearly": "Chcę płacić corocznie (co 12 miesięcy) i otrzymywać miesiąc za darmo!"
},
"Encryption": {
"createEncryptedSession": "Zaszyfrowana sesja",
"createEncryptedSession": "Uruchom zaszyfrowany Retro",
"sessionNotEncrypted": "Ta sesja nie jest zaszyfrowana.",
"sessionEncryptedHaveKeyTooltip": "Ta sesja jest zaszyfrowana, a klucz jest przechowywany w przeglądarce. Możesz otworzyć tę sesję bez konieczności ponownego podania hasła.",
"sessionEncryptedNoKeyTooltip": "Ta sesja jest zaszyfrowana, a klucz nie jest przechowywany w przeglądarce. Zostaniesz poproszony o klucz deszyfrowania podczas otwierania tej sesji.",
Expand Down
Loading

0 comments on commit aa2bb95

Please sign in to comment.