File tree Expand file tree Collapse file tree 8 files changed +61
-10
lines changed
Expand file tree Collapse file tree 8 files changed +61
-10
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
2+ import omit from 'lodash/omit' ;
23
34const effects = [
45 'bounce' ,
@@ -81,13 +82,15 @@ const effects = [
8182
8283const Animated = ( props ) => {
8384 const names = [ 'animated' ] ;
85+ const remove = [ ] ;
8486 for ( const effect of effects ) {
8587 if ( effect in props ) {
8688 names . push ( effect ) ;
89+ remove . push ( effect ) ;
8790 }
8891 }
8992 return (
90- < div className = { names . join ( ' ' ) } >
93+ < div className = { names . join ( ' ' ) } { ... omit ( props , remove ) } >
9194 { props . children }
9295 </ div >
9396 ) ;
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ type $AppCardProps =
1616class AppCard extends PureComponent < $AppCardProps > {
1717 state = { expanded : false } ;
1818 render = ( ) => (
19- < Animated bounce >
19+ < Animated rubberBand >
2020 < Card
2121 expanded = { this . state . expanded }
2222 onExpandChange = { ( ) => console . log ( 'hello' ) }
Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import MenuItem from 'material-ui/MenuItem' ;
3+ import CodeIcon from 'material-ui/svg-icons/action/code' ;
4+ import BugIcon from 'material-ui/svg-icons/action/bug-report' ;
5+ import HelpIcon from 'material-ui/svg-icons/communication/live-help' ;
6+ import open from 'open' ;
7+
8+ import info from '../../../package.json' ;
9+
10+ const DrawerMenu = ( ) => (
11+ < div >
12+ < div style = { { textAlign : 'center' } } >
13+ < strong > { info . name } </ strong > v< em > { info . version } </ em >
14+ </ div >
15+ < MenuItem
16+ leftIcon = { < CodeIcon /> }
17+ onClick = { ( ) => open ( info . repository . url ) }
18+ >
19+ View source
20+ </ MenuItem >
21+ < MenuItem
22+ leftIcon = { < BugIcon /> }
23+ onClick = { ( ) => open ( info . bugs . url ) }
24+ >
25+ Report a bug
26+ </ MenuItem >
27+ < MenuItem
28+ leftIcon = { < HelpIcon /> }
29+ onClick = { ( ) => open ( info . wiki . url ) }
30+ >
31+ Documentation
32+ </ MenuItem >
33+ </ div >
34+ ) ;
35+
36+ export default DrawerMenu ;
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import Toggle from 'material-ui/Toggle';
1010import { raiseError } from '../../redux/actions/errorsActions' ;
1111import { pickFile } from '../../helpers/fsHelpers' ;
1212import Row from '../FlexBox/Row' ;
13+ import Animated from '../Base/Animated' ;
1314
1415class Init extends PureComponent < $InitProps , $InitState > {
1516 state = {
@@ -20,7 +21,7 @@ class Init extends PureComponent<$InitProps, $InitState> {
2021 nameError : '' ,
2122 } ;
2223 render = ( ) => (
23- < div style = { { margin : 12 } } >
24+ < Animated jello style = { { margin : 12 } } >
2425 < Row style = { { marginBottom : 12 } } >
2526 < IconButton >
2627 < NameIcon />
@@ -54,7 +55,7 @@ class Init extends PureComponent<$InitProps, $InitState> {
5455 />
5556 </ div >
5657 </ Row >
57- </ div >
58+ </ Animated >
5859 ) ;
5960 onChangeBase = event => this . setState ( {
6061 base : event . target . value ,
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ import path from 'path';
66
77import * as appsActions from '../../redux/actions/appsActions' ;
88import Init from './Init' ;
9- import styles from './Open.styles' ;
109import Terminal from '../Terminal/Console' ;
10+ import Animated from '../Base/Animated' ;
1111
1212class Open extends PureComponent {
1313 state = {
@@ -17,7 +17,7 @@ class Open extends PureComponent {
1717 showTerminal : false ,
1818 } ;
1919 render = ( ) => (
20- < div >
20+ < Animated jello >
2121 < Card style = { { marginBottom : 12 } } expanded = { this . state . expand } >
2222 < CardHeader
2323 title = "Open React Native app"
@@ -73,7 +73,7 @@ class Open extends PureComponent {
7373 >
7474 < Init onCreate = { this . onCreate } />
7575 </ Popover >
76- </ div >
76+ </ Animated >
7777 ) ;
7878 handleClick = ( event ) => {
7979 // This prevents ghost click.
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ import get from 'lodash/get';
88import IconButton from 'material-ui/IconButton' ;
99import map from 'lodash/map' ;
1010import MenuIcon from 'material-ui/svg-icons/navigation/menu' ;
11- import MenuItem from 'material-ui/MenuItem' ;
1211import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider' ;
1312import path from 'path' ;
1413import React , { PureComponent } from 'react' ;
@@ -17,6 +16,7 @@ import TextField from 'material-ui/TextField';
1716
1817import { clearError } from '../../redux/actions/errorsActions' ;
1918import AppCard from './AppCard' ;
19+ import DrawerMenu from './DrawerMenu' ;
2020import Index from './Index' ;
2121import merge from '../../styles/mixins/merge' ;
2222import styles from './Router.styles' ;
@@ -76,8 +76,8 @@ class Router extends PureComponent<$RouterProps, $RoouterState> {
7676 < IconButton >
7777 < CloseIcon onClick = { this . handleToggle } />
7878 </ IconButton >
79+ < DrawerMenu />
7980 </ div >
80- < MenuItem > Menu Item</ MenuItem >
8181 </ Drawer >
8282 < Snackbar
8383 open = { this . props . error instanceof Error }
Original file line number Diff line number Diff line change 99 "babel-polyfill" : " ^6.26.0" ,
1010 "lodash" : " ^4.17.5" ,
1111 "material-ui" : " ^0.20.0" ,
12+ "open" : " ^0.0.5" ,
1213 "react" : " ^16.3.1" ,
1314 "react-dom" : " ^16.3.1" ,
1415 "react-redux" : " ^5.0.7" ,
4142 "type" : " git" ,
4243 "url" : " https://github.com/co2-git/ReactNative.git"
4344 },
44- "author" : " francoisrvespa@gmail.com"
45+ "author" : " francoisrvespa@gmail.com" ,
46+ "bugs" : {
47+ "url" : " https://github.com/co2-git/ReactNative/issues"
48+ },
49+ "wiki" : {
50+ "url" : " https://github.com/co2-git/ReactNative/wiki"
51+ }
4552}
Original file line number Diff line number Diff line change @@ -2408,6 +2408,10 @@ onetime@^2.0.0:
24082408 dependencies :
24092409 mimic-fn "^1.0.0"
24102410
2411+ open@^0.0.5 :
2412+ version "0.0.5"
2413+ resolved "https://registry.yarnpkg.com/open/-/open-0.0.5.tgz#42c3e18ec95466b6bf0dc42f3a2945c3f0cad8fc"
2414+
24112415optionator@^0.8.2 :
24122416 version "0.8.2"
24132417 resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64"
You can’t perform that action at this time.
0 commit comments