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 Mar 28, 2019. It is now read-only.

Commit695dee7

Browse files
committed
forms sample based on formik
1 parent510d00f commit695dee7

35 files changed

+795
-40
lines changed

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ npm-debug.log
55
.idea
66
.vscode
77
yarn-error.log
8+
.vscode

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,4 @@ yarn install
9696
* add e2e tests (https://codeburst.io/composable-end-to-end-tests-for-react-apps-2ec82170af62)
9797
* document debugging with Chrome and Firefox tools (maybe improve indoqa-webpack)
9898
* lighthouse check
99+
* Typescript?

‎package.json‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,24 @@
88
"url":"git@github.com:Indoqa/indoqa-react-redux.git"
99
},
1010
"scripts": {
11-
"start":"indoqa-dev-server ./indoqa-webpack-options.js",
11+
"analyze":"source-map-explorer ./target/assets/app-*",
1212
"build":"indoqa-webpack ./indoqa-webpack-options.js",
1313
"docs":"indoqa-webpack ./indoqa-webpack-docs.js",
1414
"flow":"flow",
1515
"lint":"indoqa-eslint ./src/main",
1616
"package":"yarn run lint && yarn run flow && yarn run test && indoqa-webpack ./indoqa-webpack-options.js",
17+
"postinstall":"yarn run package",
18+
"start":"indoqa-dev-server ./indoqa-webpack-options.js",
1719
"test":"indoqa-jest",
1820
"test:watch":"yarn run test --watch",
19-
"test:coverage":"yarn run test --coverage",
20-
"postinstall":"yarn run package"
21+
"test:coverage":"yarn run test --coverage"
2122
},
2223
"dependencies": {
2324
"fela":"^6.1.8",
2425
"fela-monolithic":"^5.0.22",
2526
"fela-plugin-named-media-query":"^5.0.13",
2627
"fela-preset-web":"^8.0.7",
28+
"formik":"^0.11.11",
2729
"history":"^4.7.2",
2830
"i18next":"^11.3.2",
2931
"i18next-browser-languagedetector":"^2.2.0",
@@ -35,17 +37,21 @@
3537
"react-fela":"^7.3.0",
3638
"react-i18next":"7.7.0",
3739
"react-redux":"^5.0.7",
40+
"react-router":"^4.2.2",
3841
"react-router-dom":"^4.2.2",
3942
"react-router-redux":"^5.0.0-alpha.9",
4043
"redux":"^3.7.2",
4144
"redux-logger":"^3.0.6",
4245
"redux-observable":"^0.19.0",
4346
"reselect":"^3.0.1",
44-
"rxjs":"^5.5.11"
47+
"rxjs":"^5.5.11",
48+
"shortid":"^2.2.8",
49+
"yup":"0.24.1"
4550
},
4651
"devDependencies": {
4752
"flow-bin":"^0.73.0",
48-
"indoqa-webpack":"^1.2.0"
53+
"indoqa-webpack":"^1.2.0",
54+
"source-map-explorer":"1.5.0"
4955
},
5056
"proxy": {
5157
"/geonames": {

‎src/main/app/App.react.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,26 @@ import {buildTheme} from 'indoqa-react-fela'
55
import{Switch,Route}from'react-router-dom'
66
import{I18nextProvider}from'react-i18next'
77

8+
importFormsPagefrom'../forms/components/FormsPage.redux.js'
89
importTimePagefrom'../time/components/TimePage.react.js'
910
importTodosPagefrom'../todos/components/TodosPage.react.js'
11+
importUserPagefrom'../forms/components/UserPage.redux.js'
1012
importWordsPagefrom'../words/components/WordsPage.react'
1113

1214
importi18nfrom'./i18n'
1315

1416
importthemefrom'./theme.js'
1517

1618
classAppextendsReact.Component<{}>{
17-
1819
render(){
1920
return(
2021
<ThemeProvidertheme={buildTheme(theme)}>
2122
<I18nextProvideri18n={i18n}>
2223
<Switch>
2324
<Routeexactpath="/"component={TimePage}/>
25+
<Routeexactpath="/forms"component={FormsPage}/>
26+
<Routeexactpath="/forms/users/"component={UserPage}/>
27+
<Routeexactpath="/forms/users/:id"component={UserPage}/>
2428
<Routeexactpath="/todos"component={TodosPage}/>
2529
<Routeexactpath="/words"component={WordsPage}/>
2630
</Switch>

‎src/main/app/rootEpic.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
//@flow
22
import{ajax}from'rxjs/observable/dom/ajax'
33
import{combineEpics}from'redux-observable'
4+
5+
importformsEpicsfrom'../forms/store/forms.epics'
46
importtimeEpicsfrom'../time/store/time.epics.js'
57
importwordsEpicsfrom'../words/store/words.epics'
68

79
constcombinedEpics=combineEpics(
10+
...formsEpics,
811
...timeEpics,
912
...wordsEpics
1013
)

‎src/main/app/rootReducer.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
//@flow
22
import{combineReducersWithRouter}from'indoqa-react-app'
33

4-
importtimefrom'../time/store/time.reducer.js'
5-
importtodosfrom'../todos/store/todos.reducer.js'
4+
importformsfrom'../forms/store/forms.reducer'
5+
importtimefrom'../time/store/time.reducer'
6+
importtodosfrom'../todos/store/todos.reducer'
67
importwordsfrom'../words/store/words.reducer'
78

89
constreducers={
10+
forms,
911
time,
1012
todos,
1113
words,

‎src/main/app/selectors.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
//@flow
2+
importtype{FormsState}from'../forms/types/FormsState'
23
importtype{TimeState}from'../time/types/TimeState'
34
importtype{TodoState}from'../todos/types/TodoState'
45
importtype{WordsState}from'../words/types/WordsState'
56

67
typeState={
8+
forms:FormsState,
79
time:TimeState,
810
todos:TodoState,
911
words:WordsState,
1012
}
1113

14+
exportconstselectFormsState=(state:State)=>state.forms
1215
exportconstselectTimeState=(state:State)=>state.time
1316
exportconstselectTodoState=(state:State)=>state.todos
1417
exportconstselectWordsState=(state:State)=>state.words

‎src/main/app/theme.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//@flow
22
exportdefault{
33
colors:{
4-
text:'#030303',
4+
text:'#000',
55
disabled:'#727272',
6-
bgLight:'#e5e5e5',
6+
bgLight:'#d5d5d5',
77
},
88
fonts:{
99
text:'sans-serif',
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@flow
2+
import{createComponentWithProxy}from'react-fela'
3+
4+
constButtonLink=({theme})=>({
5+
'& > a':{
6+
color:theme.colors.text,
7+
display:'block',
8+
height:'100%',
9+
textDecoration:'none',
10+
},
11+
})
12+
13+
exportdefaultcreateComponentWithProxy(ButtonLink,'button')
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
//@flow
22
import{createComponentWithProxy}from'react-fela'
3+
import{Box}from'indoqa-react-fela'
34

45
constLogo=({theme})=>{
56
return({
6-
height:'50px',
77
cursor:'pointer',
88
display:'inline-flex',
99
alignItems:'center',
10-
padding:theme.spacing.space1,
10+
height:50,
11+
fontWeight:'bold',
12+
'> a':{
13+
textDecoration:'none',
14+
color:theme.colors.text,
15+
},
1116
})
1217
}
1318

14-
exportdefaultcreateComponentWithProxy(Logo,'div')
19+
exportdefaultcreateComponentWithProxy(Logo,Box)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp