feat: add user profile page (#6)

This commit is contained in:
Walid
2022-01-14 23:15:51 +01:00
committed by GitHub
parent 9229131c1a
commit ee73885fe9
32 changed files with 698 additions and 193 deletions

View File

@ -14,10 +14,10 @@ const UserProfilePage: NextPage<PagePropsWithAuthentication> = (props) => {
return (
<AuthenticationProvider authentication={props.authentication}>
<GuildsProvider>
<Head title='Thream | Settings' />
<Head title={`Thream | ${props.authentication.user.name}`} />
<Application
path={`/application/users/${props.authentication.user.id}`}
title='Settings'
title={props.authentication.user.name}
>
<UserProfile user={props.authentication.user} />
</Application>

View File

@ -0,0 +1,33 @@
import { NextPage } from 'next'
import { Head } from 'components/Head'
import { Application } from 'components/Application'
import {
authenticationFromServerSide,
AuthenticationProvider,
PagePropsWithAuthentication
} from 'tools/authentication'
import { UserSettings } from 'components/Application/UserSettings'
import { GuildsProvider } from 'contexts/Guilds'
const UserSettingsPage: NextPage<PagePropsWithAuthentication> = (props) => {
return (
<AuthenticationProvider authentication={props.authentication}>
<GuildsProvider>
<Head title='Thream | Settings' />
<Application
path={`/application/users/${props.authentication.user.id}/settings`}
title='Settings'
>
<UserSettings user={props.authentication.user} />
</Application>
</GuildsProvider>
</AuthenticationProvider>
)
}
export const getServerSideProps = authenticationFromServerSide({
shouldBeAuthenticated: true
})
export default UserSettingsPage