feat(contexts): add Channels and Guilds
This commit is contained in:
@ -10,6 +10,8 @@ import {
|
||||
} from 'utils/authentication'
|
||||
import { GuildMember, GuildMemberProvider } from 'contexts/GuildMember'
|
||||
import { GuildLeftSidebar } from 'components/Application/GuildLeftSidebar'
|
||||
import { ChannelsProvider } from 'contexts/Channels'
|
||||
import { GuildsProvider } from 'contexts/Guilds'
|
||||
|
||||
export interface ChannelPageProps extends PagePropsWithAuthentication {
|
||||
channelId: number
|
||||
@ -20,27 +22,26 @@ export interface ChannelPageProps extends PagePropsWithAuthentication {
|
||||
const ChannelPage: NextPage<ChannelPageProps> = (props) => {
|
||||
const { channelId, guildId, authentication, guildMember } = props
|
||||
|
||||
const path = {
|
||||
channelId,
|
||||
guildId
|
||||
}
|
||||
|
||||
return (
|
||||
<AuthenticationProvider authentication={authentication}>
|
||||
<GuildMemberProvider guildMember={guildMember}>
|
||||
<Head title='Thream | Application' />
|
||||
<Application
|
||||
path={{
|
||||
channelId,
|
||||
guildId
|
||||
}}
|
||||
guildLeftSidebar={
|
||||
<GuildLeftSidebar
|
||||
path={{
|
||||
channelId,
|
||||
guildId
|
||||
}}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Messages />
|
||||
</Application>
|
||||
</GuildMemberProvider>
|
||||
<GuildsProvider>
|
||||
<GuildMemberProvider guildMember={guildMember}>
|
||||
<ChannelsProvider path={path}>
|
||||
<Head title='Thream | Application' />
|
||||
<Application
|
||||
path={path}
|
||||
guildLeftSidebar={<GuildLeftSidebar path={path} />}
|
||||
>
|
||||
<Messages />
|
||||
</Application>
|
||||
</ChannelsProvider>
|
||||
</GuildMemberProvider>
|
||||
</GuildsProvider>
|
||||
</AuthenticationProvider>
|
||||
)
|
||||
}
|
||||
|
@ -8,14 +8,17 @@ import {
|
||||
PagePropsWithAuthentication
|
||||
} from 'utils/authentication'
|
||||
import { CreateGuild } from 'components/Application/CreateGuild'
|
||||
import { GuildsProvider } from 'contexts/Guilds'
|
||||
|
||||
const CreateGuildPage: NextPage<PagePropsWithAuthentication> = (props) => {
|
||||
return (
|
||||
<AuthenticationProvider authentication={props.authentication}>
|
||||
<Head title='Thream | Create a Guild' />
|
||||
<Application path='/application/guilds/create'>
|
||||
<CreateGuild />
|
||||
</Application>
|
||||
<GuildsProvider>
|
||||
<Head title='Thream | Create a Guild' />
|
||||
<Application path='/application/guilds/create'>
|
||||
<CreateGuild />
|
||||
</Application>
|
||||
</GuildsProvider>
|
||||
</AuthenticationProvider>
|
||||
)
|
||||
}
|
||||
|
@ -8,14 +8,17 @@ import {
|
||||
PagePropsWithAuthentication
|
||||
} from 'utils/authentication'
|
||||
import { JoinGuildsPublic } from 'components/Application/JoinGuildsPublic'
|
||||
import { GuildsProvider } from 'contexts/Guilds'
|
||||
|
||||
const JoinGuildPage: NextPage<PagePropsWithAuthentication> = (props) => {
|
||||
return (
|
||||
<AuthenticationProvider authentication={props.authentication}>
|
||||
<Head title='Thream | Application' />
|
||||
<Application path='/application/guilds/join'>
|
||||
<JoinGuildsPublic />
|
||||
</Application>
|
||||
<GuildsProvider>
|
||||
<Head title='Thream | Application' />
|
||||
<Application path='/application/guilds/join'>
|
||||
<JoinGuildsPublic />
|
||||
</Application>
|
||||
</GuildsProvider>
|
||||
</AuthenticationProvider>
|
||||
)
|
||||
}
|
||||
|
@ -8,14 +8,17 @@ import {
|
||||
AuthenticationProvider,
|
||||
PagePropsWithAuthentication
|
||||
} from 'utils/authentication'
|
||||
import { GuildsProvider } from 'contexts/Guilds'
|
||||
|
||||
const ApplicationPage: NextPage<PagePropsWithAuthentication> = (props) => {
|
||||
return (
|
||||
<AuthenticationProvider authentication={props.authentication}>
|
||||
<Head title='Thream | Application' />
|
||||
<Application path='/application'>
|
||||
<PopupGuild />
|
||||
</Application>
|
||||
<GuildsProvider>
|
||||
<Head title='Thream | Application' />
|
||||
<Application path='/application'>
|
||||
<PopupGuild />
|
||||
</Application>
|
||||
</GuildsProvider>
|
||||
</AuthenticationProvider>
|
||||
)
|
||||
}
|
||||
|
@ -8,14 +8,17 @@ import {
|
||||
PagePropsWithAuthentication
|
||||
} from 'utils/authentication'
|
||||
import { UserProfile } from 'components/Application/UserProfile'
|
||||
import { GuildsProvider } from 'contexts/Guilds'
|
||||
|
||||
const UserProfilePage: NextPage<PagePropsWithAuthentication> = (props) => {
|
||||
return (
|
||||
<AuthenticationProvider authentication={props.authentication}>
|
||||
<Head title='Thream | Settings' />
|
||||
<Application path='/application/users/[userId]'>
|
||||
<UserProfile user={props.authentication.user} />
|
||||
</Application>
|
||||
<GuildsProvider>
|
||||
<Head title='Thream | Settings' />
|
||||
<Application path='/application/users/[userId]'>
|
||||
<UserProfile user={props.authentication.user} />
|
||||
</Application>
|
||||
</GuildsProvider>
|
||||
</AuthenticationProvider>
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user