diff --git a/src/containers/content/CommunityContent/DocContent.tsx b/src/containers/content/CommunityContent/DocContent.tsx index a504f37e4..d85586f5e 100644 --- a/src/containers/content/CommunityContent/DocContent.tsx +++ b/src/containers/content/CommunityContent/DocContent.tsx @@ -5,9 +5,6 @@ import { FC } from 'react' import useMobileDetect from '@groupher/use-mobile-detect-hook' -import type { TMetric } from '@/spec' -import METRIC from '@/constant/metric' - import { bond } from '@/mobx' import { BANNER_LAYOUT } from '@/constant/layout' import { THREAD } from '@/constant/thread' @@ -20,20 +17,18 @@ import type { TStore } from './store' import { useInit } from './logic' import { Wrapper, InnerWrapper, SidebarWrapper, ContentWrapper, MobileCardsWrapper } from './styles' +import useMetric from '@/hooks/useMetric' type TProps = { communityContent?: TStore - metric?: TMetric } /** * only for AboutThread, but link to the common communityContent store */ -const CommunityContentContainer: FC = ({ - communityContent: store, - metric = METRIC.COMMUNITY, -}) => { +const CommunityContentContainer: FC = ({ communityContent: store }) => { useInit(store) + const metric = useMetric() const { globalLayout } = store const { isMobile } = useMobileDetect() diff --git a/src/containers/digest/CommunityDigest/SimpleLayout/ThreadTab.tsx b/src/containers/digest/CommunityDigest/SimpleLayout/ThreadTab.tsx index a4fc86dbe..d3d281bea 100755 --- a/src/containers/digest/CommunityDigest/SimpleLayout/ThreadTab.tsx +++ b/src/containers/digest/CommunityDigest/SimpleLayout/ThreadTab.tsx @@ -12,6 +12,7 @@ import usePublicThreads from '@/hooks/usePublicThreads' import useHeaderLinks from '@/hooks/useHeaderLinks' import useAccount from '@/hooks/useAccount' import useViewingThread from '@/hooks/useViewingThread' +import usePrimaryColor from '@/hooks/usePrimaryColor' import ExtraLinks from '@/widgets/ExtraLinks/SimpleLayout' @@ -24,6 +25,7 @@ const ThreadTab: FC = ({ ...restProps }) => { const { links: extraLinks, layout: headerLayout } = useHeaderLinks() const threads = usePublicThreads() const activeThread = useViewingThread() + const primaryColor = usePrimaryColor() const { isModerator } = useAccount() @@ -64,7 +66,7 @@ const ThreadTab: FC = ({ ...restProps }) => { href={`/${curCommunity.slug}/${item.slug}`} key={item.slug} $active={activeThread === item.slug} - prefetch={false} + primaryColor={primaryColor} > {item.title} diff --git a/src/containers/digest/CommunityDigest/styles/simple_layout/thread_tab.ts b/src/containers/digest/CommunityDigest/styles/simple_layout/thread_tab.ts index eb771e85c..ae81373e7 100755 --- a/src/containers/digest/CommunityDigest/styles/simple_layout/thread_tab.ts +++ b/src/containers/digest/CommunityDigest/styles/simple_layout/thread_tab.ts @@ -1,8 +1,8 @@ import Link from 'next/link' import styled from 'styled-components' -import type { TActive, TSpace } from '@/spec' -import css, { theme } from '@/css' +import type { TActive, TPrimaryColor, TSpace } from '@/spec' +import css, { theme, primaryTheme } from '@/css' export const NormalWrapper = styled.div` ${css.row('align-center')}; @@ -26,8 +26,10 @@ export const FloatWrapper = styled(NormalWrapper)` margin-left: -100px; ` -export const Title = styled(Link)` - color: ${({ $active }) => ($active ? theme('article.title') : theme('article.digest'))}; +type TTitle = TActive & TPrimaryColor +export const Title = styled(Link)` + color: ${({ $active, primaryColor }) => + $active ? primaryTheme(primaryColor) : theme('article.digest')}; font-size: 14px; opacity: ${({ $active }) => ($active ? 1 : 0.9)}; font-weight: ${({ $active }) => ($active ? 500 : 400)}; @@ -36,7 +38,7 @@ export const Title = styled(Link)` border-radius: 5px; &:hover { - color: ${theme('article.title')}; + color: ${({ primaryColor }) => primaryTheme(primaryColor)}; opacity: 1; cursor: pointer; background: ${theme('hoverBg')}; diff --git a/src/containers/editor/TagSettingEditor/logic.ts b/src/containers/editor/TagSettingEditor/logic.ts index d390e267d..f2fe13434 100644 --- a/src/containers/editor/TagSettingEditor/logic.ts +++ b/src/containers/editor/TagSettingEditor/logic.ts @@ -61,7 +61,6 @@ export const onCreate = (): void => { thread: curThread, } - console.log('## create tag: ', tag) sr71$.mutate(S.createArticleTag, tag) } diff --git a/src/containers/editor/WallpaperEditor/BuildIn/AnglePanel.tsx b/src/containers/editor/WallpaperEditor/BuildIn/AnglePanel.tsx index 8aac3e2a2..59f97eb19 100755 --- a/src/containers/editor/WallpaperEditor/BuildIn/AnglePanel.tsx +++ b/src/containers/editor/WallpaperEditor/BuildIn/AnglePanel.tsx @@ -1,7 +1,9 @@ import { FC, memo } from 'react' +import { observer } from 'mobx-react' import type { TWallpaperGradientDir } from '@/spec' import { GRADIENT_DIRECTION } from '@/constant/wallpaper' +import usePrimaryColor from '@/hooks/usePrimaryColor' import { Wrapper, @@ -24,39 +26,70 @@ type TProps = { } const AnglePanel: FC = ({ direction }) => { + const primaryColor = usePrimaryColor() + const { TOP, TOP_LEFT, TOP_RIGHT, LEFT, RIGHT, BOTTOM, BOTTOM_LEFT, BOTTOM_RIGHT } = GRADIENT_DIRECTION return ( - changeDirection(TOP)}> + changeDirection(TOP)} + > - changeDirection(TOP_LEFT)}> + changeDirection(TOP_LEFT)} + > - changeDirection(TOP_RIGHT)}> + changeDirection(TOP_RIGHT)} + > - changeDirection(BOTTOM)}> + changeDirection(BOTTOM)} + > - changeDirection(BOTTOM_LEFT)}> + changeDirection(BOTTOM_LEFT)} + > changeDirection(BOTTOM_RIGHT)} + primaryColor={primaryColor} > - changeDirection(LEFT)}> + changeDirection(LEFT)} + > - changeDirection(RIGHT)}> + changeDirection(RIGHT)} + > @@ -65,4 +98,4 @@ const AnglePanel: FC = ({ direction }) => { ) } -export default memo(AnglePanel) +export default observer(AnglePanel) diff --git a/src/containers/editor/WallpaperEditor/schema.ts b/src/containers/editor/WallpaperEditor/schema.ts index 8e023e09f..df7d123d5 100755 --- a/src/containers/editor/WallpaperEditor/schema.ts +++ b/src/containers/editor/WallpaperEditor/schema.ts @@ -1,4 +1,5 @@ import { gql } from 'urql/core' +import { F } from '@/schemas' const updateDashboardWallpaper = gql` mutation ( @@ -28,15 +29,7 @@ const updateDashboardWallpaper = gql` slug dashboard { wallpaper { - wallpaperType - wallpaper - direction - customColorValue - bgSize - uploadBgImage - hasPattern - hasBlur - hasShadow + ${F.wallpaper} } } } diff --git a/src/containers/editor/WallpaperEditor/styles/build_in/angle_panel.ts b/src/containers/editor/WallpaperEditor/styles/build_in/angle_panel.ts index 203fb46ff..750f4f5b1 100755 --- a/src/containers/editor/WallpaperEditor/styles/build_in/angle_panel.ts +++ b/src/containers/editor/WallpaperEditor/styles/build_in/angle_panel.ts @@ -1,9 +1,9 @@ import styled from 'styled-components' -import type { TActive } from '@/spec' +import type { TActive, TPrimaryColor } from '@/spec' import { GRADIENT_DIRECTION } from '@/constant/wallpaper' -import css, { theme } from '@/css' +import css, { theme, primaryTheme } from '@/css' import ArrowSVG from '@/icons/ArrowSolid' const metric = { @@ -39,12 +39,6 @@ export const Wrapper = styled.div` border-color: ${theme('divider')}; position: relative; margin-top: 26px; - - &:hover { - background: ${theme('hoverBg')}; - } - - transition: all 0.2s; ` export const NeedleDot = styled.div` ${css.circle(4)}; @@ -65,7 +59,8 @@ export const Needle = styled.div<{ direction: string }>` transform: ${({ direction }) => `rotate(${metric[direction].rotate}) `}; transform-origin: right; ` -const Point = styled.div` +type TPoint = TActive & TPrimaryColor +const Point = styled.div` position: absolute; font-size: 8px; ${css.circle(16)}; @@ -73,12 +68,14 @@ const Point = styled.div` z-index: 2; font-weight: ${({ $active }) => ($active ? 600 : 'bormal')}; - background: ${({ $active }) => ($active ? theme('article.title') : theme('divider'))}; + background: ${({ $active, primaryColor }) => + $active ? primaryTheme(primaryColor) : theme('divider')}; color: ${({ $active }) => (!$active ? theme('article.title') : 'white')}; border: 1px solid transparent; &:hover { border-color: ${theme('article.digest')}; + border-color: ${({ primaryColor }) => primaryTheme(primaryColor)}; font-weight: 600; cursor: pointer; color: white; diff --git a/src/containers/layout/ThemePalette/GlobalStyle.ts b/src/containers/layout/ThemePalette/GlobalStyle.ts index fcf106af9..7374963d3 100755 --- a/src/containers/layout/ThemePalette/GlobalStyle.ts +++ b/src/containers/layout/ThemePalette/GlobalStyle.ts @@ -1,10 +1,11 @@ import { createGlobalStyle } from 'styled-components' -// import { media } from '@/utils/css/media' -import css, { theme } from '@/css' +import type { TPrimaryColor } from '@/spec' +import css, { theme, primaryTheme, primaryLightTheme } from '@/css' + import normalize from './normalize' -const GlobalStyle = createGlobalStyle` +const GlobalStyle = createGlobalStyle` ${normalize}; html { background-color: ${theme('htmlBg')}; @@ -20,12 +21,15 @@ const GlobalStyle = createGlobalStyle` } *::-moz-selection { - background-color: ${theme('selectionBg')} !important; + background-color: ${({ primaryColor }) => primaryLightTheme(primaryColor)} !important; + color: ${({ primaryColor }) => primaryTheme(primaryColor)} !important; } *::selection { - background-color: ${theme('selectionBg')} !important; + background-color: ${({ primaryColor }) => primaryLightTheme(primaryColor)} !important; + color: ${({ primaryColor }) => primaryTheme(primaryColor)} !important; } + a:hover { color: ${theme('a.hover')}; } diff --git a/src/containers/layout/ThemePalette/index.tsx b/src/containers/layout/ThemePalette/index.tsx index 75a16850d..5361696a2 100755 --- a/src/containers/layout/ThemePalette/index.tsx +++ b/src/containers/layout/ThemePalette/index.tsx @@ -9,6 +9,7 @@ import Head from 'next/head' import { ThemeProvider } from 'styled-components' import type { TThemeMap } from '@/spec' +import usePrimaryColor from '@/hooks/usePrimaryColor' import { bond } from '@/mobx' import ThirdPartyOverWrite from './ThirdPartyOverWrite' @@ -24,6 +25,7 @@ type TProps = { } const ThemeContainer: FC = ({ children, theme: { themeData } }) => { + const primaryColor = usePrimaryColor() // see https://css-tricks.com/meta-theme-color-and-trickery/ // theme seems conflict with manifest return ( @@ -36,7 +38,7 @@ const ThemeContainer: FC = ({ children, theme: { themeData } }) => { /> - + {children} diff --git a/src/containers/thread/DashboardThread/BasicInfo/OtherInfo/index.tsx b/src/containers/thread/DashboardThread/BasicInfo/OtherInfo/index.tsx index b18b6691a..8d36d5209 100644 --- a/src/containers/thread/DashboardThread/BasicInfo/OtherInfo/index.tsx +++ b/src/containers/thread/DashboardThread/BasicInfo/OtherInfo/index.tsx @@ -23,8 +23,6 @@ type TProps = { const OtherInfo: FC = ({ testid = 'basic-info', settings, touched }) => { const { city, techstack } = settings - console.log('## city: ', city) - return ( diff --git a/src/containers/thread/DashboardThread/CMS/Docs/Tree/index.tsx b/src/containers/thread/DashboardThread/CMS/Docs/Tree/index.tsx index d5e29347e..347246910 100644 --- a/src/containers/thread/DashboardThread/CMS/Docs/Tree/index.tsx +++ b/src/containers/thread/DashboardThread/CMS/Docs/Tree/index.tsx @@ -33,7 +33,6 @@ const TreeView: FC = ({ pagedDocs }) => { useEffect(() => { const tree = treeRef.current - console.log('## tree: ', tree) /* See the Tree API reference for all you can do with it. */ }, []) @@ -43,7 +42,7 @@ const TreeView: FC = ({ pagedDocs }) => { // treeRef.current.createLeaf() // treeRef.current.createInternal() // console.log('## tree: ', treeRef.current) - console.log('## get Data: ', treeRef.current) + // console.log('## get Data: ', treeRef.current) // treeRef.current.unselectAll() }} > diff --git a/src/containers/thread/DashboardThread/Layout/AvatarLayout.tsx b/src/containers/thread/DashboardThread/Layout/AvatarLayout.tsx index 20a1e4411..06f1df03e 100644 --- a/src/containers/thread/DashboardThread/Layout/AvatarLayout.tsx +++ b/src/containers/thread/DashboardThread/Layout/AvatarLayout.tsx @@ -1,9 +1,11 @@ -import { FC, memo } from 'react' +import { FC } from 'react' +import { observer } from 'mobx-react' import type { TAvatarLayout } from '@/spec' import { AVATAR_LAYOUT } from '@/constant/layout' import { COLOR_NAME } from '@/constant/colors' +import usePrimaryColor from '@/hooks/usePrimaryColor' import CheckLabel from '@/widgets/CheckLabel' @@ -20,6 +22,7 @@ import { Divider, Avatar, AvatarList, + SavingWrapper, } from '../styles/layout/avatar_layout' import { edit } from '../logic' @@ -30,12 +33,14 @@ type TProps = { } const AvatarLayout: FC = ({ layout, isTouched, saving }) => { + const primaryColor = usePrimaryColor() + return ( 用户/用户列表头像展示样式。} /> edit(AVATAR_LAYOUT.SQUARE, 'avatarLayout')}> - + YM @@ -62,7 +67,7 @@ const AvatarLayout: FC = ({ layout, isTouched, saving }) => { edit(AVATAR_LAYOUT.CIRCLE, 'avatarLayout')}> - + YM @@ -93,14 +98,16 @@ const AvatarLayout: FC = ({ layout, isTouched, saving }) => { - + + + ) } -export default memo(AvatarLayout) +export default observer(AvatarLayout) diff --git a/src/containers/thread/DashboardThread/Layout/BannerLayout.tsx b/src/containers/thread/DashboardThread/Layout/BannerLayout.tsx index da0f3b1c1..2469dbde2 100644 --- a/src/containers/thread/DashboardThread/Layout/BannerLayout.tsx +++ b/src/containers/thread/DashboardThread/Layout/BannerLayout.tsx @@ -1,9 +1,12 @@ -import { FC, memo } from 'react' +import { FC } from 'react' +import { observer } from 'mobx-react' import type { TBannerLayout } from '@/spec' import { BANNER_LAYOUT, DASHBOARD_DESC_LAYOUT } from '@/constant/layout' import { callDashboardDesc } from '@/signal' +import usePrimaryColor from '@/hooks/usePrimaryColor' +import useViewingCommunity from '@/hooks/useViewingCommunity' import { Row, Br, Space, SpaceGrow } from '@/widgets/Common' import CheckLabel from '@/widgets/CheckLabel' @@ -15,6 +18,7 @@ import SavingBar from '../SavingBar' import { Wrapper, + CommunityTitle, SelectWrapper, Layout, LayoutTitle, @@ -36,6 +40,9 @@ type TProps = { } const BannerLayout: FC = ({ layout, isTouched, saving }) => { + const primaryColor = usePrimaryColor() + const { title } = useViewingCommunity() + return ( = ({ layout, isTouched, saving }) => { /> edit(BANNER_LAYOUT.HEADER, 'bannerLayout')}> - + - + {title} @@ -81,7 +88,7 @@ const BannerLayout: FC = ({ layout, isTouched, saving }) => { - +

@@ -105,9 +112,9 @@ const BannerLayout: FC = ({ layout, isTouched, saving }) => {
edit(BANNER_LAYOUT.TABBER, 'bannerLayout')}> - + - + {title} @@ -141,7 +148,7 @@ const BannerLayout: FC = ({ layout, isTouched, saving }) => { - +

@@ -165,17 +172,17 @@ const BannerLayout: FC = ({ layout, isTouched, saving }) => {
edit(BANNER_LAYOUT.SIDEBAR, 'bannerLayout')}> - + - +
- + {title}

@@ -236,4 +243,4 @@ const BannerLayout: FC = ({ layout, isTouched, saving }) => { ) } -export default memo(BannerLayout) +export default observer(BannerLayout) diff --git a/src/containers/thread/DashboardThread/Layout/BrandLayout.tsx b/src/containers/thread/DashboardThread/Layout/BrandLayout.tsx index 263c07afe..82e2b9deb 100644 --- a/src/containers/thread/DashboardThread/Layout/BrandLayout.tsx +++ b/src/containers/thread/DashboardThread/Layout/BrandLayout.tsx @@ -1,8 +1,10 @@ -import { FC, memo } from 'react' +import { FC } from 'react' +import { observer } from 'mobx-react' import type { TBrandLayout } from '@/spec' import { BRAND_LAYOUT, DASHBOARD_DESC_LAYOUT } from '@/constant/layout' +import usePrimaryColor from '@/hooks/usePrimaryColor' import { callDashboardDesc } from '@/signal' import { Space, Divider, Inline } from '@/widgets/Common' @@ -32,6 +34,8 @@ type TProps = { } const LogoLayout: FC = ({ layout, isTouched, saving }) => { + const primaryColor = usePrimaryColor() + return ( = ({ layout, isTouched, saving }) => { /> edit(BRAND_LAYOUT.BOTH, 'brandLayout')}> - + @@ -70,7 +74,7 @@ const LogoLayout: FC = ({ layout, isTouched, saving }) => { edit(BRAND_LAYOUT.LOGO, 'brandLayout')}> - + @@ -86,7 +90,7 @@ const LogoLayout: FC = ({ layout, isTouched, saving }) => { edit(BRAND_LAYOUT.TEXT, 'brandLayout')}> - + Groupher @@ -107,4 +111,4 @@ const LogoLayout: FC = ({ layout, isTouched, saving }) => { ) } -export default memo(LogoLayout) +export default observer(LogoLayout) diff --git a/src/containers/thread/DashboardThread/Layout/ChangelogLayout.tsx b/src/containers/thread/DashboardThread/Layout/ChangelogLayout.tsx index 305a92a9e..123ae23f2 100644 --- a/src/containers/thread/DashboardThread/Layout/ChangelogLayout.tsx +++ b/src/containers/thread/DashboardThread/Layout/ChangelogLayout.tsx @@ -1,8 +1,10 @@ -import { FC, memo } from 'react' +import { FC } from 'react' +import { observer } from 'mobx-react' import type { TChangelogLayout } from '@/spec' import { CHANGELOG_LAYOUT, DASHBOARD_DESC_LAYOUT } from '@/constant/layout' +import usePrimaryColor from '@/hooks/usePrimaryColor' import { callDashboardDesc } from '@/signal' import { Row, Br, Space, SpaceGrow, Divider, Inline } from '@/widgets/Common' @@ -37,6 +39,8 @@ type TProps = { } const ChangelogLayout: FC = ({ layout, isTouched, saving }) => { + const primaryColor = usePrimaryColor() + return ( = ({ layout, isTouched, saving }) => { /> edit(CHANGELOG_LAYOUT.CLASSIC, 'changelogLayout')}> - +
@@ -108,7 +112,7 @@ const ChangelogLayout: FC = ({ layout, isTouched, saving }) => {
edit(CHANGELOG_LAYOUT.SIMPLE, 'changelogLayout')}> - + @@ -215,4 +219,4 @@ const ChangelogLayout: FC = ({ layout, isTouched, saving }) => { ) } -export default memo(ChangelogLayout) +export default observer(ChangelogLayout) diff --git a/src/containers/thread/DashboardThread/Layout/DocLayout/index.tsx b/src/containers/thread/DashboardThread/Layout/DocLayout/index.tsx index 5914fc404..1ef5c7eaf 100644 --- a/src/containers/thread/DashboardThread/Layout/DocLayout/index.tsx +++ b/src/containers/thread/DashboardThread/Layout/DocLayout/index.tsx @@ -1,8 +1,10 @@ -import { FC, memo } from 'react' +import { FC } from 'react' +import { observer } from 'mobx-react' import type { TDocFAQLayout, TDocLayout } from '@/spec' import { DOC_LAYOUT, DOC_FAQ_LAYOUT, DASHBOARD_DESC_LAYOUT } from '@/constant/layout' +import usePrimaryColor from '@/hooks/usePrimaryColor' import { callDashboardDesc } from '@/signal' import { Br, Divider } from '@/widgets/Common' @@ -35,6 +37,8 @@ type TProps = { } const DocLayout: FC = ({ layout, faqLayout, isTouched, isFaqTouched, saving }) => { + const primaryColor = usePrimaryColor() + return ( = ({ layout, faqLayout, isTouched, isFaqTouched, sav /> edit(DOC_LAYOUT.BLOCKS, 'docLayout')}> - +
@@ -70,7 +74,7 @@ const DocLayout: FC = ({ layout, faqLayout, isTouched, isFaqTouched, sav edit(DOC_LAYOUT.LISTS, 'docLayout')}> - +
@@ -87,7 +91,7 @@ const DocLayout: FC = ({ layout, faqLayout, isTouched, isFaqTouched, sav edit(DOC_LAYOUT.CARDS, 'docLayout')}> - +
@@ -129,7 +133,7 @@ const DocLayout: FC = ({ layout, faqLayout, isTouched, isFaqTouched, sav /> edit(DOC_FAQ_LAYOUT.COLLAPSE, 'docFaqLayout')}> - +
@@ -145,7 +149,7 @@ const DocLayout: FC = ({ layout, faqLayout, isTouched, isFaqTouched, sav edit(DOC_FAQ_LAYOUT.FLAT, 'docFaqLayout')}> - +
@@ -172,4 +176,4 @@ const DocLayout: FC = ({ layout, faqLayout, isTouched, isFaqTouched, sav ) } -export default memo(DocLayout) +export default observer(DocLayout) diff --git a/src/containers/thread/DashboardThread/Layout/GlowEffect.tsx b/src/containers/thread/DashboardThread/Layout/GlowEffect.tsx index d760977b9..4b5bf4da3 100644 --- a/src/containers/thread/DashboardThread/Layout/GlowEffect.tsx +++ b/src/containers/thread/DashboardThread/Layout/GlowEffect.tsx @@ -1,7 +1,9 @@ -import { FC, memo } from 'react' +import { FC } from 'react' +import { observer } from 'mobx-react' import { keys } from 'ramda' import GLOW_EFFECTS, { GLOW_OPACITY } from '@/constant/glow_effect' +import usePrimaryColor from '@/hooks/usePrimaryColor' import { Br, Row as RowBase } from '@/widgets/Common' import ArrowLinker from '@/widgets/ArrowLinker' @@ -44,6 +46,7 @@ const GlowEffect: FC = ({ isGrowOpacityTouched, saving, }) => { + const primaryColor = usePrimaryColor() const EFFECTS_KEYS = keys(GLOW_EFFECTS) return ( @@ -61,13 +64,22 @@ const GlowEffect: FC = ({ /> - edit('', 'glowType')}> + edit('', 'glowType')} + primaryColor={primaryColor} + > {EFFECTS_KEYS.map((effect) => ( - edit(effect, 'glowType')}> + edit(effect, 'glowType')} + > ))} @@ -77,7 +89,13 @@ const GlowEffect: FC = ({
- + 滑动跟随: = ({ isTouched={isGrowOpacityTouched} field={SETTING_FIELD.GLOW_OPACITY} loading={saving} + left={-10} + top={-8} > 辉光强度: @@ -130,4 +150,4 @@ const GlowEffect: FC = ({ ) } -export default memo(GlowEffect) +export default observer(GlowEffect) diff --git a/src/containers/thread/DashboardThread/Layout/KanbanLayout/ItemLayout.tsx b/src/containers/thread/DashboardThread/Layout/KanbanLayout/ItemLayout.tsx index 4aa6d7375..43457c05a 100644 --- a/src/containers/thread/DashboardThread/Layout/KanbanLayout/ItemLayout.tsx +++ b/src/containers/thread/DashboardThread/Layout/KanbanLayout/ItemLayout.tsx @@ -1,6 +1,8 @@ -import { FC, memo } from 'react' +import { FC } from 'react' +import { observer } from 'mobx-react' import { KANBAN_LAYOUT, DASHBOARD_DESC_LAYOUT } from '@/constant/layout' +import usePrimaryColor from '@/hooks/usePrimaryColor' import { callDashboardDesc } from '@/signal' import { Row, Br, Space, SpaceGrow, Inline } from '@/widgets/Common' @@ -26,6 +28,8 @@ import { edit } from '../../logic' type TProps = Omit const KanbanItemLayout: FC = ({ layout, isTouched, saving }) => { + const primaryColor = usePrimaryColor() + return ( <> = ({ layout, isTouched, saving }) => { /> edit(KANBAN_LAYOUT.SIMPLE, 'kanbanLayout')}> - +
@@ -72,7 +76,7 @@ const KanbanItemLayout: FC = ({ layout, isTouched, saving }) => {
edit(KANBAN_LAYOUT.FULL, 'kanbanLayout')}> - +
@@ -114,4 +118,4 @@ const KanbanItemLayout: FC = ({ layout, isTouched, saving }) => { ) } -export default memo(KanbanItemLayout) +export default observer(KanbanItemLayout) diff --git a/src/containers/thread/DashboardThread/Layout/PostLayout.tsx b/src/containers/thread/DashboardThread/Layout/PostLayout.tsx index 28454f51c..09efffc5e 100644 --- a/src/containers/thread/DashboardThread/Layout/PostLayout.tsx +++ b/src/containers/thread/DashboardThread/Layout/PostLayout.tsx @@ -1,8 +1,10 @@ -import { FC, memo } from 'react' +import { FC } from 'react' +import { observer } from 'mobx-react' import type { TPostLayout } from '@/spec' import { POST_LAYOUT, DASHBOARD_DESC_LAYOUT } from '@/constant/layout' +import usePrimaryColor from '@/hooks/usePrimaryColor' import { callDashboardDesc } from '@/signal' import { Row, Br, Space, SpaceGrow, Inline } from '@/widgets/Common' @@ -37,6 +39,8 @@ type TProps = { } const PostListLayout: FC = ({ layout, isTouched, saving }) => { + const primaryColor = usePrimaryColor() + return ( = ({ layout, isTouched, saving }) => { /> edit(POST_LAYOUT.QUORA, 'postLayout')}> - +
@@ -89,7 +93,7 @@ const PostListLayout: FC = ({ layout, isTouched, saving }) => {
edit(POST_LAYOUT.PH, 'postLayout')}> - + @@ -128,7 +132,7 @@ const PostListLayout: FC = ({ layout, isTouched, saving }) => { edit(POST_LAYOUT.MASONRY, 'postLayout')}> - + @@ -152,7 +156,7 @@ const PostListLayout: FC = ({ layout, isTouched, saving }) => { edit(POST_LAYOUT.MINIMAL, 'postLayout')}> - + @@ -188,7 +192,7 @@ const PostListLayout: FC = ({ layout, isTouched, saving }) => { edit(POST_LAYOUT.COVER, 'postLayout')}> - + @@ -221,4 +225,4 @@ const PostListLayout: FC = ({ layout, isTouched, saving }) => { ) } -export default memo(PostListLayout) +export default observer(PostListLayout) diff --git a/src/containers/thread/DashboardThread/Layout/PrimaryColor.tsx b/src/containers/thread/DashboardThread/Layout/PrimaryColor.tsx index 1606b7a04..0030a4118 100644 --- a/src/containers/thread/DashboardThread/Layout/PrimaryColor.tsx +++ b/src/containers/thread/DashboardThread/Layout/PrimaryColor.tsx @@ -31,7 +31,12 @@ const PrimaryColor: FC = ({ primaryColor, isTouched, saving }) => { } /> - +