Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit5aa8981

Browse files
committed
refactor(constant): use ROUTE on globel SEO
1 parent534a459 commit5aa8981

File tree

6 files changed

+9
-202
lines changed

6 files changed

+9
-202
lines changed

‎src/containers/GlobalLayout/index.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import dynamic from 'next/dynamic'
1111
importuseNetworkfrom'react-use/lib/useNetwork'
1212

1313
import{ICON_CMD}from'@/config'
14-
import{TYPE}from'@/constant'
14+
import{TYPE,ROUTE}from'@/constant'
1515
import{connectStore}from'@/utils'
1616
import{useShortcut,useMedia,usePlatform,useResize}from'@/hooks'
1717

@@ -113,7 +113,7 @@ const GlobalLayoutContainer = ({
113113
>
114114
<ContentWrapper
115115
offsetLeft={
116-
!!(page==='community'||page==='communities')
116+
!!(page===ROUTE.COMMUNITY||page===ROUTE.COMMUNITIES)
117117
}
118118
>
119119
<Headermetric={metric}/>

‎src/pages/community-back.js‎

Lines changed: 0 additions & 197 deletions
This file was deleted.

‎src/pages/community.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Provider } from 'mobx-react'
33
import{merge,pick,toLower}from'ramda'
44

55
import{PAGE_SIZE,SITE_URL}from'@/config'
6+
import{ROUTE}from'@/constant'
67
import{useStore}from'@/stores/init2'
78

89
import{
@@ -160,7 +161,7 @@ function CommunityPage(props) {
160161
return(
161162
<Providerstore={store}>
162163
<GlobalLayout
163-
page="community"
164+
page={ROUTE.COMMUNITY}
164165
seoConfig={seoConfig}
165166
errorCode={errorCode}
166167
errorPath={community.raw}

‎src/pages/home/posts.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Provider } from 'mobx-react'
33
import{merge,pick,toLower}from'ramda'
44

55
import{PAGE_SIZE,SITE_URL}from'@/config'
6+
import{ROUTE}from'@/constant'
67
import{useStore}from'@/stores/init2'
78

89
import{
@@ -160,7 +161,7 @@ function CommunityPage(props) {
160161
return(
161162
<Providerstore={store}>
162163
<GlobalLayout
163-
page="community"
164+
page={ROUTE.COMMUNITY}
164165
seoConfig={seoConfig}
165166
errorCode={errorCode}
166167
errorPath={community.raw}

‎src/pages/index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default class PageCommunity extends React.Component {
6262
<Providerstore={this.store}>
6363
<GlobalLayout
6464
noSidebar={hideSidebar}
65-
page="community"
65+
page={ROUTE.COMMUNITY}
6666
seoConfig={seoConfig}
6767
errorCode={statusCode}
6868
errorPath={target}

‎utils/constant/route.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
constROUTE={
22
// NOTE: the lower-case is MUST
33
HOME:'home',
4+
// this page is not exist on url, but serves default community page
5+
COMMUNITY:'community',
46
COMMUNITIES:'communities',
57
CHEATSHEETS:'cheatsheets',
68
POSTS:'posts',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp