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.

Commit85216e6

Browse files
authored
refactor(have-a-drink): adjust codebase (#1053)
* refactor(have-a-drink): adjust content width && convert to ts* refactor(have-a-drink): extract constant file
1 parentbebefa1 commit85216e6

File tree

19 files changed

+117
-89
lines changed

19 files changed

+117
-89
lines changed

‎src/containers/content/HaveADrinkContent/Body/About.js‎renamed to ‎src/containers/content/HaveADrinkContent/Body/About.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import React from 'react'
88

99
import{Wrapper,Title,Body}from'../styles/body/about'
1010

11-
constAbout=()=>{
11+
constAbout:React.FC=()=>{
1212
return(
1313
<Wrapper>
1414
<Title>关于『来一杯』</Title>

‎src/containers/content/HaveADrinkContent/Body/Catalog.js‎renamed to ‎src/containers/content/HaveADrinkContent/Body/Catalog.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const items = [
128128
},
129129
]
130130

131-
constCatalog=()=>{
131+
constCatalog:React.FC=()=>{
132132
return(
133133
<Wrapper>
134134
{items.map((item)=>(

‎src/containers/content/HaveADrinkContent/Body/Setting.js‎renamed to ‎src/containers/content/HaveADrinkContent/Body/Setting.tsx‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
importReactfrom'react'
22

3+
importtype{TSettingOption}from'../spec'
4+
35
import{
46
Wrapper,
57
Divider,
@@ -11,7 +13,13 @@ import {
1113

1214
import{setSetting}from'../logic'
1315

14-
constSetting=({settingOptions:{ animateType, fontSize}})=>{
16+
typeTProps={
17+
settingOptions:TSettingOption
18+
}
19+
20+
constSetting:React.FC<TProps>=({
21+
settingOptions:{ animateType, fontSize},
22+
})=>{
1523
return(
1624
<Wrapper>
1725
<Block>

‎src/containers/content/HaveADrinkContent/Body/index.js‎renamed to ‎src/containers/content/HaveADrinkContent/Body/index.tsx‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,24 @@ import { AnimateOnChange } from 'react-animation'
99

1010
import{buildLog}from'@/utils'
1111

12+
importtype{TView,TSettingOption}from'../spec'
1213
importCatalogfrom'./Catalog'
1314
importSettingfrom'./Setting'
1415
importAboutfrom'./About'
1516

1617
import{Wrapper,Sentence,Hint}from'../styles/body'
17-
import{LN}from'../logic'
18+
import{VIEW}from'../constant'
1819

1920
/* eslint-disable-next-line */
2021
constlog=buildLog('C:HaveADrinkContent')
2122

22-
constView=({ view, sentence, settingOptions})=>{
23-
const{VIEW}=LN
23+
typeTViewProps={
24+
view:TView
25+
sentence:string
26+
settingOptions:TSettingOption
27+
}
2428

29+
constView:React.FC<TViewProps>=({ view, sentence, settingOptions})=>{
2530
constanimate={
2631
fade:{
2732
durationOut:200,
@@ -59,10 +64,10 @@ const View = ({ view, sentence, settingOptions }) => {
5964
}
6065
}
6166

62-
constBody=({ ...restProps})=>{
67+
constBody=(props)=>{
6368
return(
6469
<Wrapper>
65-
<View{...restProps}/>
70+
<View{...props}/>
6671
</Wrapper>
6772
)
6873
}

‎src/containers/content/HaveADrinkContent/Footer/Contributor.js‎renamed to ‎src/containers/content/HaveADrinkContent/Footer/Contributor.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
/* eslint-disable-next-line */
2121
constlog=buildLog('C:HaveADrinkContent')
2222

23-
constIndexStatus=()=>{
23+
constIndexStatus:React.FC=()=>{
2424
return(
2525
<Wrapper>
2626
<Text>共收录</Text>

‎src/containers/content/HaveADrinkContent/Footer/Feature.js‎renamed to ‎src/containers/content/HaveADrinkContent/Footer/Feature.tsx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,15 @@ import { buildLog } from '@/utils'
1111

1212
importDotDividerfrom'@/components/DotDivider'
1313

14+
import{VIEW}from'../constant'
1415
import{Wrapper,Icon}from'../styles/footer/feature'
15-
import{setView,LN}from'../logic'
16+
import{setView}from'../logic'
1617
// import { useInit } from './logic'
1718

1819
/* eslint-disable-next-line */
1920
constlog=buildLog('C:HaveADrinkContent')
2021

21-
constFeature=()=>{
22-
const{VIEW}=LN
23-
22+
constFeature:React.FC=()=>{
2423
return(
2524
<Wrapper>
2625
<divonClick={()=>setView(VIEW.ABOUT)}>

‎src/containers/content/HaveADrinkContent/Footer/Share.js‎renamed to ‎src/containers/content/HaveADrinkContent/Footer/Share.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { Wrapper, Icon } from '../styles/footer/share'
1515
/* eslint-disable-next-line */
1616
constlog=buildLog('C:HaveADrinkContent')
1717

18-
constReaction=()=>{
18+
constReaction:React.FC=()=>{
1919
return(
2020
<Wrapper>
2121
<Iconsrc={`${ICON_CMD}/drink_share.svg`}/>

‎src/containers/content/HaveADrinkContent/Footer/index.js‎renamed to ‎src/containers/content/HaveADrinkContent/Footer/index.tsx‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ import React from 'react'
88

99
import{buildLog}from'@/utils'
1010

11+
importtype{TView}from'../spec'
12+
1113
importContributorfrom'./Contributor'
1214
importFeaturefrom'./Feature'
1315
importSharefrom'./Share'
1416

17+
import{VIEW}from'../constant'
1518
import{Wrapper}from'../styles/header'
16-
import{LN}from'../logic'
1719

1820
/* eslint-disable-next-line */
1921
constlog=buildLog('C:HaveADrinkContent')
2022

2123
constView=({ view})=>{
22-
const{VIEW}=LN
23-
2424
switch(view){
2525
caseVIEW.DEFAULT:{
2626
return(
@@ -37,7 +37,11 @@ const View = ({ view }) => {
3737
}
3838
}
3939

40-
constFooter=({ view})=>{
40+
typeTProps={
41+
view:TView
42+
}
43+
44+
constFooter:React.FC<TProps>=({ view})=>{
4145
return(
4246
<Wrapper>
4347
<Viewview={view}/>

‎src/containers/content/HaveADrinkContent/Header/IndexStatus.js‎renamed to ‎src/containers/content/HaveADrinkContent/Header/IndexStatus.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { setView } from '../logic'
2121
/* eslint-disable-next-line */
2222
constlog=buildLog('C:HaveADrinkContent')
2323

24-
constIndexStatus=()=>{
24+
constIndexStatus:React.FC=()=>{
2525
return(
2626
<Wrapper>
2727
<Text>共&nbsp;</Text>

‎src/containers/content/HaveADrinkContent/Header/Reaction.js‎renamed to ‎src/containers/content/HaveADrinkContent/Header/Reaction.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { Wrapper } from '../styles/header/reaction'
1414
/* eslint-disable-next-line */
1515
constlog=buildLog('C:HaveADrinkContent')
1616

17-
constReaction=()=>{
17+
constReaction:React.FC=()=>{
1818
return(
1919
<Wrapper>
2020
<div>评论 | 喜欢</div>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp