feat(contexts): add Channels and Guilds

This commit is contained in:
Divlo
2021-12-28 21:55:32 +01:00
parent d8667b12a0
commit 1c5f643554
19 changed files with 244 additions and 109 deletions

View File

@ -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>
)
}