From ee73885fe9d2fd9cc1403498afc9845c09bbe7b1 Mon Sep 17 00:00:00 2001 From: Walid <87608619+WalidKorchi@users.noreply.github.com> Date: Fri, 14 Jan 2022 23:15:51 +0100 Subject: [PATCH] feat: add user profile page (#6) --- components/Application/Application.tsx | 8 +- .../Application/CreateGuild/CreateGuild.tsx | 25 +- components/Application/Guilds/Guild/Guild.tsx | 5 +- components/Application/Guilds/Guilds.tsx | 2 +- .../Application/UserProfile/UserProfile.tsx | 310 +++++++++--------- .../UserProfileGuild.stories.tsx | 18 + .../UserProfileGuild.test.tsx | 12 + .../UserProfileGuild/UserProfileGuild.tsx | 46 +++ .../UserProfileGuild/index.ts | 1 + .../UserProfileGuilds.stories.tsx | 20 ++ .../UserProfileGuilds.test.tsx | 10 + .../UserProfileGuilds/UserProfileGuilds.tsx | 104 ++++++ .../UserProfile/UserProfileGuilds/index.ts | 1 + .../UserSettings/UserSettings.stories.tsx | 19 ++ .../UserSettings/UserSettings.test.tsx | 16 + .../Application/UserSettings/UserSettings.tsx | 120 +++++++ components/Application/UserSettings/index.ts | 1 + components/Header/Language/index.tsx | 4 +- .../design/Checkbox/Checkbox.stories.tsx | 15 + components/design/Checkbox/Checkbox.test.tsx | 10 + components/design/Checkbox/Checkbox.tsx | 26 ++ components/design/Checkbox/index.ts | 1 + components/design/Input/Input.tsx | 9 +- .../design/Textarea/Textarea.stories.tsx | 15 + components/design/Textarea/Textarea.test.tsx | 10 + components/design/Textarea/Textarea.tsx | 30 ++ components/design/Textarea/index.ts | 1 + i18n.json | 1 + locales/en/application.json | 7 +- locales/fr/application.json | 7 +- .../{[userId].tsx => [userId]/index.tsx} | 4 +- pages/application/users/[userId]/settings.tsx | 33 ++ 32 files changed, 698 insertions(+), 193 deletions(-) create mode 100644 components/Application/UserProfile/UserProfileGuilds/UserProfileGuild/UserProfileGuild.stories.tsx create mode 100644 components/Application/UserProfile/UserProfileGuilds/UserProfileGuild/UserProfileGuild.test.tsx create mode 100644 components/Application/UserProfile/UserProfileGuilds/UserProfileGuild/UserProfileGuild.tsx create mode 100644 components/Application/UserProfile/UserProfileGuilds/UserProfileGuild/index.ts create mode 100644 components/Application/UserProfile/UserProfileGuilds/UserProfileGuilds.stories.tsx create mode 100644 components/Application/UserProfile/UserProfileGuilds/UserProfileGuilds.test.tsx create mode 100644 components/Application/UserProfile/UserProfileGuilds/UserProfileGuilds.tsx create mode 100644 components/Application/UserProfile/UserProfileGuilds/index.ts create mode 100644 components/Application/UserSettings/UserSettings.stories.tsx create mode 100644 components/Application/UserSettings/UserSettings.test.tsx create mode 100644 components/Application/UserSettings/UserSettings.tsx create mode 100644 components/Application/UserSettings/index.ts create mode 100644 components/design/Checkbox/Checkbox.stories.tsx create mode 100644 components/design/Checkbox/Checkbox.test.tsx create mode 100644 components/design/Checkbox/Checkbox.tsx create mode 100644 components/design/Checkbox/index.ts create mode 100644 components/design/Textarea/Textarea.stories.tsx create mode 100644 components/design/Textarea/Textarea.test.tsx create mode 100644 components/design/Textarea/Textarea.tsx create mode 100644 components/design/Textarea/index.ts rename pages/application/users/{[userId].tsx => [userId]/index.tsx} (88%) create mode 100644 pages/application/users/[userId]/settings.tsx diff --git a/components/Application/Application.tsx b/components/Application/Application.tsx index 443c122..23dd4d9 100644 --- a/components/Application/Application.tsx +++ b/components/Application/Application.tsx @@ -24,6 +24,7 @@ export type ApplicationPath = | '/application/guilds/join' | '/application/guilds/create' | `/application/users/${number}` + | `/application/users/${number}/settings` | GuildsChannelsPath export interface ApplicationProps { @@ -172,8 +173,8 @@ export const Application: React.FC = (props) => { >
= (props) => {
- {guildLeftSidebar}
{ const { t } = useTranslation() @@ -54,24 +54,11 @@ export const CreateGuild: React.FC = () => { label={t('common:name')} error={getErrorTranslation(errors.name)} /> - -
-
- -
-
- -
-
- +