Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

refactor: adjust header metric & style adjust #1150

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion server/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ router.route('/meetups/:slug?').get((req, res) => {
return renderAndCache({ req, res, path: '/meetups' })
})

// 酷导游
// 酷导航
router.route('/cool-guide/:slug?').get((req, res) => {
return renderAndCache({ req, res, path: '/cool-guide' })
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
Wrapper,
InnerWrapper,
RouterWrapper,
} from '../styles/desktop_view/works_layout'
} from '../styles/desktop_view/normal_layout'

/* eslint-disable-next-line */
const log = buildLog('C:Header')
Expand All @@ -40,7 +40,7 @@ const hasNoBorder = (metric: TMetric): boolean =>
METRIC.HELP_CENTER,
])

const WorksHeader: FC<TProps> = ({ metric, c11n, community }) => {
const NormalHeader: FC<TProps> = ({ metric, c11n, community }) => {
return (
<Wrapper
id="whereCallShowDoraemon"
Expand All @@ -61,4 +61,4 @@ const WorksHeader: FC<TProps> = ({ metric, c11n, community }) => {
)
}

export default WorksHeader
export default NormalHeader
11 changes: 4 additions & 7 deletions src/components/Header/DesktopView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { METRIC } from '@/constant'
import type { TProps } from '../index'
import CommunityLayout from './CommunityLayout'
import ArticleLayout from './ArticleLayout'
import WorksLayout from './WorksLayout'
import NormalLayout from './NormalLayout'
// import ArticleEditorView from './ArticleEditorView'

const DesktopView: FC<TProps> = (props) => {
Expand All @@ -17,14 +17,11 @@ const DesktopView: FC<TProps> = (props) => {
case METRIC.WORKS_ARTICLE: {
return <ArticleLayout {...props} />
}
case METRIC.WORKS: {
return <WorksLayout {...props} />
case METRIC.COMMUNITY: {
return <CommunityLayout {...props} />
}
// case METRIC.ARTICLE_EDITOR: {
// return <ArticleEditorView metric={metric} />
// }
default: {
return <CommunityLayout {...props} />
return <NormalLayout {...props} />
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navigator/MainEntries/DesktopView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const DesktopView: FC<TProps> = ({ type }) => {
active={mainPath === ROUTE.COOL_GUIDE}
testid={`header-${ROUTE.COOL_GUIDE}`}
>
酷导游
酷导航
</SiteLink>
</Link>
<DotDivider space={splitMargin} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navigator/MorePanel/MobileView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const items = [
},
{
icon: `${ICON}/route/cool-guide.svg`,
title: '酷导游',
title: '酷导航',
desc: '发现有意思的东西',
href: `/${ROUTE.DISCOVERY}`,
raw: 12,
Expand Down
2 changes: 1 addition & 1 deletion src/containers/content/CoolGuideContent/FilterBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const FilterBar: FC<TProps> = ({ topFilter, menuOnSelect }) => {
<Wrapper testid="filter-bar">
<TopFilter>
<NaviIntro
title="酷导游"
title="酷导航"
desc="the cool guide"
iconSrc={`${ICON_CMD}/navi/cool-guide-logo.svg`}
/>
Expand Down
8 changes: 5 additions & 3 deletions src/containers/content/CoolGuideContent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

import { FC } from 'react'

import { METRIC } from '@/constant'
import type { TMetric } from '@/spec'

import { buildLog } from '@/utils/logger'
import { pluggedIn } from '@/utils/mobx'

Expand All @@ -21,14 +23,14 @@ import { useInit, menuOnSelect } from './logic'
const log = buildLog('C:CoolGuideContent')

type TProps = {
coolGuideContent: TStore
metric: TMetric
coolGuideContent?: TStore
metric?: TMetric
testid?: string
}

const CoolGuideContentContainer: FC<TProps> = ({
coolGuideContent: store,
metric,
metric = METRIC.COOL_GUIDE,
testid = 'cool-guide-content',
}) => {
useInit(store)
Expand Down
2 changes: 1 addition & 1 deletion src/containers/content/RecipesContent/Footer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const Footer = () => {
return (
<Wrapper>
<AboutBlock>
关于酷导游
关于酷导航
<Desc>共收录信息 3485 条,最后更新:3小时前</Desc>
<ArrowButton>参与贡献</ArrowButton>
</AboutBlock>
Expand Down
2 changes: 1 addition & 1 deletion src/containers/content/TrendingContent/Footer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const Footer = () => {
return (
<Wrapper>
<AboutBlock>
关于酷导游
关于酷导航
<Desc>共收录信息 3485 条,最后更新:3小时前</Desc>
<ArrowButton>参与贡献</ArrowButton>
</AboutBlock>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/cool-guide.js → src/pages/cool-guide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import CoolGuideContent from '@/containers/content/CoolGuideContent'

import { useStore } from '@/stores/init'

const fetchData = async (props, opt) => {
const fetchData = async (props, opt = {}) => {
const { realname } = merge({ realname: true }, opt)

const token = realname ? getJwtToken(props) : null
Expand Down Expand Up @@ -65,7 +65,7 @@ const CoolGuidePage = (props) => {

const seoConfig = {
url: `${SITE_URL}/${ROUTE.COOL_GUIDE}`,
title: '酷导游 | coderplanets',
title: '酷导航 | coderplanets',
description: 'IT导航界的特斯拉',
}

Expand Down