File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ import * as React from 'react'
2+ import { Button } from '@alifd/next'
3+
4+ interface Props {
5+ onGitHubLogin ( e : any ) : void
6+ }
7+
8+ const styles = {
9+ page : {
10+ display : 'flex' ,
11+ alignItems : 'center' ,
12+ justifyContent : 'center' ,
13+ height : window . innerHeight - 20 ,
14+ } ,
15+ }
16+
17+ export const LoginPage = ( props : Props ) => (
18+ < div style = { styles . page } >
19+ < div > Login</ div >
20+ < Button onClick = { props . onGitHubLogin } > Sign in With GitHub</ Button >
21+ </ div >
22+ )
23+
24+ export default ( ) => (
25+ < LoginPage
26+ onGitHubLogin = { ( e : any ) => {
27+ const { value } = e . target
28+ console . log ( 'value' , value )
29+ } }
30+ />
31+ )
Original file line number Diff line number Diff line change 1+ import React from 'react'
2+
3+ import { storiesOf } from '@storybook/react'
4+ import { action } from '@storybook/addon-actions'
5+
6+ import { LoginPage } from '../src/containers/Login'
7+ import SideBarDecorator from './utils/SideBarDecorator'
8+
9+ storiesOf ( 'Login' , module )
10+ . addDecorator ( SideBarDecorator )
11+ . add ( 'Page' , ( ) => < LoginPage onGitHubLogin = { action ( 'onGitHubLogin' ) } /> )
You can’t perform that action at this time.
0 commit comments