Skip to content

Commit e7565b2

Browse files
authored
Merge pull request #37 from DaiPOS/igor/feature/signin_scene
Sign-in scene
2 parents e86e42c + 37804d5 commit e7565b2

File tree

19 files changed

+546
-161
lines changed

19 files changed

+546
-161
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
flow-typed
22
node_modules
3+
docs
4+
src/components/app/App.css

docs/schema.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<!-- eslint-disable -->
2+
13
- users
24
- id
35
- firstName

flow-typed/npm/prop-types_v15.x.x.js

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// flow-typed signature: d9a983bb1ac458a256c31c139047bdbb
2+
// flow-typed version: 927687984d/prop-types_v15.x.x/flow_>=v0.41.x
3+
4+
type $npm$propTypes$ReactPropsCheckType = (
5+
props: any,
6+
propName: string,
7+
componentName: string,
8+
href?: string) => ?Error;
9+
10+
declare module 'prop-types' {
11+
declare var array: React$PropType$Primitive<Array<any>>;
12+
declare var bool: React$PropType$Primitive<boolean>;
13+
declare var func: React$PropType$Primitive<Function>;
14+
declare var number: React$PropType$Primitive<number>;
15+
declare var object: React$PropType$Primitive<Object>;
16+
declare var string: React$PropType$Primitive<string>;
17+
declare var symbol: React$PropType$Primitive<Symbol>;
18+
declare var any: React$PropType$Primitive<any>;
19+
declare var arrayOf: React$PropType$ArrayOf;
20+
declare var element: React$PropType$Primitive<any>; /* TODO */
21+
declare var instanceOf: React$PropType$InstanceOf;
22+
declare var node: React$PropType$Primitive<any>; /* TODO */
23+
declare var objectOf: React$PropType$ObjectOf;
24+
declare var oneOf: React$PropType$OneOf;
25+
declare var oneOfType: React$PropType$OneOfType;
26+
declare var shape: React$PropType$Shape;
27+
28+
declare function checkPropTypes<V>(
29+
propTypes: $Subtype<{[_: $Keys<V>]: $npm$propTypes$ReactPropsCheckType}>,
30+
values: V,
31+
location: string,
32+
componentName: string,
33+
getStack: ?(() => ?string)
34+
) : void;
35+
}

flow-typed/npm/react-router_v4.x.x.js

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
// flow-typed signature: e15aeed0d3686f71822b54cde7b71c83
2+
// flow-typed version: fbf3e77efa/react-router_v4.x.x/flow_>=v0.63.x
3+
4+
declare module "react-router" {
5+
// NOTE: many of these are re-exported by react-router-dom and
6+
// react-router-native, so when making changes, please be sure to update those
7+
// as well.
8+
declare export type Location = {
9+
pathname: string,
10+
search: string,
11+
hash: string,
12+
state?: any,
13+
key?: string
14+
};
15+
16+
declare export type LocationShape = {
17+
pathname?: string,
18+
search?: string,
19+
hash?: string,
20+
state?: any
21+
};
22+
23+
declare export type HistoryAction = "PUSH" | "REPLACE" | "POP";
24+
25+
declare export type RouterHistory = {
26+
length: number,
27+
location: Location,
28+
action: HistoryAction,
29+
listen(
30+
callback: (location: Location, action: HistoryAction) => void
31+
): () => void,
32+
push(path: string | LocationShape, state?: any): void,
33+
replace(path: string | LocationShape, state?: any): void,
34+
go(n: number): void,
35+
goBack(): void,
36+
goForward(): void,
37+
canGo?: (n: number) => boolean,
38+
block(
39+
callback: (location: Location, action: HistoryAction) => boolean
40+
): void,
41+
// createMemoryHistory
42+
index?: number,
43+
entries?: Array<Location>
44+
};
45+
46+
declare export type Match = {
47+
params: { [key: string]: ?string },
48+
isExact: boolean,
49+
path: string,
50+
url: string
51+
};
52+
53+
declare export type ContextRouter = {|
54+
history: RouterHistory,
55+
location: Location,
56+
match: Match,
57+
staticContext?: StaticRouterContext
58+
|};
59+
60+
declare export type GetUserConfirmation = (
61+
message: string,
62+
callback: (confirmed: boolean) => void
63+
) => void;
64+
65+
declare type StaticRouterContext = {
66+
url?: string
67+
};
68+
69+
declare export class StaticRouter extends React$Component<{
70+
basename?: string,
71+
location?: string | Location,
72+
context: StaticRouterContext,
73+
children?: React$Node
74+
}> {}
75+
76+
declare export class MemoryRouter extends React$Component<{
77+
initialEntries?: Array<LocationShape | string>,
78+
initialIndex?: number,
79+
getUserConfirmation?: GetUserConfirmation,
80+
keyLength?: number,
81+
children?: React$Node
82+
}> {}
83+
84+
declare export class Router extends React$Component<{
85+
history: RouterHistory,
86+
children?: React$Node
87+
}> {}
88+
89+
declare export class Prompt extends React$Component<{
90+
message: string | ((location: Location) => string | true),
91+
when?: boolean
92+
}> {}
93+
94+
declare export class Redirect extends React$Component<{|
95+
to: string | LocationShape,
96+
push?: boolean,
97+
from?: string,
98+
exact?: boolean,
99+
strict?: boolean
100+
|}> {}
101+
102+
103+
declare export class Route extends React$Component<{|
104+
component?: React$ComponentType<*>,
105+
render?: (router: ContextRouter) => React$Node,
106+
children?: React$ComponentType<ContextRouter> | React$Node,
107+
path?: string,
108+
exact?: boolean,
109+
strict?: boolean,
110+
location?: LocationShape,
111+
sensitive?: boolean
112+
|}> {}
113+
114+
declare export class Switch extends React$Component<{|
115+
children?: React$Node,
116+
location?: Location
117+
|}> {}
118+
119+
declare export function withRouter<P>(
120+
Component: React$ComponentType<{| ...ContextRouter, ...P |}>
121+
): React$ComponentType<P>;
122+
123+
declare type MatchPathOptions = {
124+
path?: string,
125+
exact?: boolean,
126+
strict?: boolean,
127+
sensitive?: boolean
128+
};
129+
130+
declare export function matchPath(
131+
pathname: string,
132+
options?: MatchPathOptions | string
133+
): null | Match;
134+
}

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@
2323
"gh-pages": "^2.0.1",
2424
"lodash": "^4.17.11",
2525
"moment": "^2.23.0",
26+
"prop-types": "^15.6.2",
2627
"qrious": "^4.0.2",
2728
"react": "16.7.0",
2829
"react-dom": "16.7.0",
2930
"react-html5-camera-photo": "^1.2.9",
3031
"react-redux": "^5.1.0",
3132
"react-redux-firebase": "^2.2.6",
33+
"react-router": "^4.3.1",
3234
"react-router-dom": "^4.3.1",
3335
"react-scripts": "2.1.3",
3436
"recompose": "^0.30.0",
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from 'react'
2+
3+
const ArrowLeft = () => (
4+
<svg
5+
width="20"
6+
height="20"
7+
viewBox="0 0 20 20"
8+
fill="none"
9+
xmlns="http://www.w3.org/2000/svg"
10+
>
11+
<path
12+
d="M0.707107 8.98528L6.36396 3.32842L7.77817 4.74264L3.82828 8.69253L18.3848 8.69253V10.6922L3.82828 10.6922L7.77817 14.6421L6.36396 16.0563L0.707107 10.3995C0.316784 10.0092 0.316784 9.3756 0.707107 8.98528Z"
13+
fill="#333963"
14+
/>
15+
</svg>
16+
)
17+
18+
export default ArrowLeft
223 Bytes
Loading
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/** @jsx jsx */
2+
/* eslint-disable */
3+
4+
import { jsx } from '@emotion/core'
5+
import React from 'react'
6+
import * as ReactRouter from 'react-router'
7+
import vectorImg from './Vector.png'
8+
9+
import style from './index.style.js'
10+
11+
class NextButton extends React.Component {
12+
render() {
13+
return (
14+
<div css={style.button__location}>
15+
<button css={style.continue__button}>
16+
<div css={style.continue__buttonText}>{this.props.children}</div>
17+
<div css={style.continue__buttonCircle}>
18+
<img css={style.vector} src={vectorImg} alt="" />
19+
</div>
20+
</button>
21+
</div>
22+
)
23+
}
24+
25+
handleClick = event => {
26+
const { history, to, onClick } = this.props
27+
console.log(this.props)
28+
onClick && onClick(event)
29+
to && history.push(to)
30+
}
31+
}
32+
33+
export default ReactRouter.withRouter(NextButton)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import STYLE from 'constants/style'
2+
3+
export default {
4+
button__location: {
5+
flex: 1,
6+
display: 'flex',
7+
flexDirection: 'row-reverse',
8+
},
9+
continue__button: {
10+
color: STYLE.COLOR.CYAN,
11+
backgroundColor: 'transparent',
12+
display: 'flex',
13+
alignItems: 'center',
14+
borderWidth: 0,
15+
},
16+
continue__buttonText: {
17+
marginRight: 20,
18+
fontWeight: STYLE.FONT.WEIGHT.BOLD,
19+
fontSize: 16,
20+
},
21+
continue__buttonCircle: {
22+
width: '48px',
23+
height: '48px',
24+
background: '#5EBAA0',
25+
borderRadius: '70px',
26+
27+
display: 'grid',
28+
justifyContent: 'center',
29+
alignContent: 'center',
30+
},
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import * as ReactRedux from 'react-redux'
2+
import PropTypes from 'prop-types'
3+
import authActions from 'redux/actions/auth'
4+
import SignIn from '..'
5+
6+
SignIn.propTypes = {
7+
signIn: PropTypes.func,
8+
authError: PropTypes.string,
9+
}
10+
11+
const mapStateToProp = state => ({
12+
authError: state.auth.authError,
13+
})
14+
15+
const mapDispatchToProps = dispatch => ({
16+
signIn: credentials => dispatch(authActions.signIn(credentials)),
17+
})
18+
19+
export default ReactRedux.connect(
20+
mapStateToProp,
21+
mapDispatchToProps
22+
)(SignIn)

src/components/onboarding/sign-in/containers/index.js

Whitespace-only changes.

0 commit comments

Comments
 (0)