Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor: single thread for pages
  • Loading branch information
mydearxym committed Nov 6, 2022
commit 2699f53c9adc1df8e5d3bf28d8b3b199baedbc3c
53 changes: 53 additions & 0 deletions src/containers/content/CommunityContent/AboutContent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* CommunityContent
*/

import { FC } from 'react'
import { isMobile } from 'react-device-detect'

import { bond } from '@/utils/mobx'

import CommunityDigest from '@/containers/digest/CommunityDigest'
import AboutThread from '@/containers/thread/AboutThread'

import type { TStore } from './store'
import { useInit } from './logic'

import {
Wrapper,
InnerWrapper,
ContentWrapper,
MobileCardsWrapper,
} from './styles'

type TProps = {
communityContent?: TStore
}

/**
* only for AboutThread, but link to the common communityContent store
*/
const CommunityContentContainer: FC<TProps> = ({ communityContent: store }) => {
useInit(store)

return (
<Wrapper testid="about-thread-content">
<CommunityDigest />
{isMobile ? (
<MobileCardsWrapper>
<ContentWrapper>
<AboutThread />
</ContentWrapper>
</MobileCardsWrapper>
) : (
<InnerWrapper>
<ContentWrapper>
<AboutThread />
</ContentWrapper>
</InnerWrapper>
)}
</Wrapper>
)
}

export default bond(CommunityContentContainer, 'communityContent') as FC<TProps>
53 changes: 53 additions & 0 deletions src/containers/content/CommunityContent/ChangeLogContent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* CommunityContent
*/

import { FC } from 'react'
import { isMobile } from 'react-device-detect'

import { bond } from '@/utils/mobx'

import CommunityDigest from '@/containers/digest/CommunityDigest'
import ChangelogThread from '@/containers/thread/ChangelogThread'

import type { TStore } from './store'
import { useInit } from './logic'

import {
Wrapper,
InnerWrapper,
ContentWrapper,
MobileCardsWrapper,
} from './styles'

type TProps = {
communityContent?: TStore
}

/**
* only for AboutThread, but link to the common communityContent store
*/
const CommunityContentContainer: FC<TProps> = ({ communityContent: store }) => {
useInit(store)

return (
<Wrapper testid="changelog-thread-content">
<CommunityDigest />
{isMobile ? (
<MobileCardsWrapper>
<ContentWrapper>
<ChangelogThread />
</ContentWrapper>
</MobileCardsWrapper>
) : (
<InnerWrapper>
<ContentWrapper>
<ChangelogThread />
</ContentWrapper>
</InnerWrapper>
)}
</Wrapper>
)
}

export default bond(CommunityContentContainer, 'communityContent') as FC<TProps>
53 changes: 53 additions & 0 deletions src/containers/content/CommunityContent/DashboardContent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* CommunityContent
*/

import { FC } from 'react'
import { isMobile } from 'react-device-detect'

import { bond } from '@/utils/mobx'

import CommunityDigest from '@/containers/digest/CommunityDigest'
import DashboardThread from '@/containers//thread/DashboardThread'

import type { TStore } from './store'
import { useInit } from './logic'

import {
Wrapper,
InnerWrapper,
ContentWrapper,
MobileCardsWrapper,
} from './styles'

type TProps = {
communityContent?: TStore
}

/**
* only for AboutThread, but link to the common communityContent store
*/
const CommunityContentContainer: FC<TProps> = ({ communityContent: store }) => {
useInit(store)

return (
<Wrapper testid="dashboard-thread-content">
<CommunityDigest />
{isMobile ? (
<MobileCardsWrapper>
<ContentWrapper>
<DashboardThread />
</ContentWrapper>
</MobileCardsWrapper>
) : (
<InnerWrapper>
<ContentWrapper>
<DashboardThread />
</ContentWrapper>
</InnerWrapper>
)}
</Wrapper>
)
}

export default bond(CommunityContentContainer, 'communityContent') as FC<TProps>
53 changes: 53 additions & 0 deletions src/containers/content/CommunityContent/HelpContent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* CommunityContent
*/

import { FC } from 'react'
import { isMobile } from 'react-device-detect'

import { bond } from '@/utils/mobx'

import CommunityDigest from '@/containers/digest/CommunityDigest'
import HelpThread from '@/containers//thread/HelpThread'

import type { TStore } from './store'
import { useInit } from './logic'

import {
Wrapper,
InnerWrapper,
ContentWrapper,
MobileCardsWrapper,
} from './styles'

type TProps = {
communityContent?: TStore
}

/**
* only for AboutThread, but link to the common communityContent store
*/
const CommunityContentContainer: FC<TProps> = ({ communityContent: store }) => {
useInit(store)

return (
<Wrapper testid="help-thread-content">
<CommunityDigest />
{isMobile ? (
<MobileCardsWrapper>
<ContentWrapper>
<HelpThread />
</ContentWrapper>
</MobileCardsWrapper>
) : (
<InnerWrapper>
<ContentWrapper>
<HelpThread />
</ContentWrapper>
</InnerWrapper>
)}
</Wrapper>
)
}

export default bond(CommunityContentContainer, 'communityContent') as FC<TProps>
53 changes: 53 additions & 0 deletions src/containers/content/CommunityContent/KanbanContent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* CommunityContent
*/

import { FC } from 'react'
import { isMobile } from 'react-device-detect'

import { bond } from '@/utils/mobx'

import CommunityDigest from '@/containers/digest/CommunityDigest'
import KanbanThread from '@/containers//thread/KanbanThread'

import type { TStore } from './store'
import { useInit } from './logic'

import {
Wrapper,
InnerWrapper,
ContentWrapper,
MobileCardsWrapper,
} from './styles'

type TProps = {
communityContent?: TStore
}

/**
* only for AboutThread, but link to the common communityContent store
*/
const CommunityContentContainer: FC<TProps> = ({ communityContent: store }) => {
useInit(store)

return (
<Wrapper testid="kanban-thread-content">
<CommunityDigest />
{isMobile ? (
<MobileCardsWrapper>
<ContentWrapper>
<KanbanThread />
</ContentWrapper>
</MobileCardsWrapper>
) : (
<InnerWrapper>
<ContentWrapper>
<KanbanThread />
</ContentWrapper>
</InnerWrapper>
)}
</Wrapper>
)
}

export default bond(CommunityContentContainer, 'communityContent') as FC<TProps>
53 changes: 53 additions & 0 deletions src/containers/content/CommunityContent/PostContent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* CommunityContent
*/

import { FC } from 'react'
import { isMobile } from 'react-device-detect'

import { bond } from '@/utils/mobx'

import CommunityDigest from '@/containers/digest/CommunityDigest'
import ArticlesThread from '@/containers//thread/ArticlesThread'

import type { TStore } from './store'
import { useInit } from './logic'

import {
Wrapper,
InnerWrapper,
ContentWrapper,
MobileCardsWrapper,
} from './styles'

type TProps = {
communityContent?: TStore
}

/**
* only for AboutThread, but link to the common communityContent store
*/
const CommunityContentContainer: FC<TProps> = ({ communityContent: store }) => {
useInit(store)

return (
<Wrapper testid="post-thread-content">
<CommunityDigest />
{isMobile ? (
<MobileCardsWrapper>
<ContentWrapper>
<ArticlesThread />
</ContentWrapper>
</MobileCardsWrapper>
) : (
<InnerWrapper>
<ContentWrapper>
<ArticlesThread />
</ContentWrapper>
</InnerWrapper>
)}
</Wrapper>
)
}

export default bond(CommunityContentContainer, 'communityContent') as FC<TProps>
4 changes: 2 additions & 2 deletions src/containers/content/CommunityContent/ThreadContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import LavaLampLoading from '@/widgets/Loading/LavaLampLoading'

import ArticlesThread from '@/containers//thread/ArticlesThread'
import KanbanThread from '@/containers//thread/KanbanThread'
import ChangeThread from '@/containers//thread/ChangelogThread'
import ChangeLogThread from '@/containers//thread/ChangelogThread'
// import ReposThread from '@/containers/thread/ReposThread'
// import CperMapThread from '@/containers/thread/CperMapThread'
// import WipThread from './WipThread'
Expand Down Expand Up @@ -45,7 +45,7 @@ const ThreadContent: FC<TProps> = ({ thread }) => {
}

case THREAD.CHANGELOG: {
return <ChangeThread />
return <ChangeLogThread />
}

case THREAD.HELP: {
Expand Down
Loading