-
-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue #104 resolved #116
issue #104 resolved #116
Conversation
src/index.js
Outdated
import theme, { withGalio, GalioProvider } from './theme'; | ||
|
||
import galioConfig from './config/galio.json'; | ||
import galioConfig from './fonts/galio.json'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in v0.5.4 we're using ./config/galio.json
which solved an issue regarding deploying apps with Galio for Android. Check #104
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh!!! changing that !!!
@@ -1,40 +1,40 @@ | |||
import React, { Component } from 'react'; | |||
import React from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, close the earlier !!
src/Radio.js
Outdated
@@ -2,21 +2,14 @@ import React from 'react'; | |||
import { View, TouchableOpacity, StyleSheet } from 'react-native'; | |||
import PropTypes from 'prop-types'; | |||
// G A L I O - D E P E N D E N C Y | |||
import { Text } from '.'; | |||
import { Text } from 'galio-framework'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import should've stayed as import { Text } from './';
. Galio is not a dependency of Galio and relative paths are better for users when they're importing our library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
src/Radio.js
Outdated
this.spaceAround = this.spaceAround.bind(this); | ||
} | ||
|
||
function Radio(props) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've noticed the fact that you were most of the times destructuring the props
object so you could use the variables inside the function, you could try and do the same thing here so you won't have to always do that for every function inside this Hook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool !!, will do that!
src/NavBar.js
Outdated
@@ -3,14 +3,14 @@ import { View, TouchableOpacity, StyleSheet, Dimensions } from 'react-native'; | |||
import PropTypes from 'prop-types'; | |||
|
|||
// galio components | |||
import { Block, Text, Icon } from '.'; | |||
import { Block, Text, Icon } from 'galio-framework'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same this as with the Radio
component: ... from './'
.
src/Card.js
Outdated
import { Image, StyleSheet } from 'react-native'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import { Block, Icon, Text } from '.'; | ||
import { Block, Icon, Text } from 'galio-framework'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing as with the other imports, they should be relative.
src/Button.js
Outdated
@@ -2,13 +2,13 @@ import React from 'react'; | |||
import { ActivityIndicator, Dimensions, StyleSheet, TouchableOpacity, Text } from 'react-native'; | |||
import PropTypes from 'prop-types'; | |||
// galio components | |||
import { Icon } from '.'; | |||
import { Icon } from 'galio-framework'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imports should be relative.
Example: .. from './'
.
src/Block.js
Outdated
...props | ||
} = this.props; | ||
function Block(props) { | ||
const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should try destructuring the props in the props
argument of the function. Like in Text.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have actually destructed the props!
like this ( Pattern A )
const {
row,
flex,
center,
middle,
top,
bottom,
right,
left,
shadow,
space,
fluid,
height,
shadowColor,
card,
width,
safe,
children,
style,
styles,
...rest
} = props;
but not like this, ( Pattern B )
function Block({
row,
flex,
center,
middle,
top,
bottom,
right,
left,
shadow,
space,
fluid,
height,
shadowColor,
card,
width,
safe,
children,
style,
styles,
...rest
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have used both pattern A and pattern B in the code !
If you could tell the particulat pattern you want the PR to have for the code consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like the pattern B could be better but we could leave it like that for the moment.
src/Block.js
Outdated
); | ||
} | ||
|
||
return ( | ||
<View {...rest} style={styleBlock}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
place the {...rest}
at the end of the component just like this: <View style={styleBlock} {...rest}>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done !!
.idea/.gitignore
Outdated
@@ -0,0 +1,3 @@ | |||
|
|||
# Default ignored files | |||
/workspace.xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what's the thing with the workspace.xml
and the `.idea. folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take a look and most probably remove this!
Sorry !! I accidentally deleted the branch!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything is fine, I tested everything and it works please reply to my last comments and we're good to go with this PR.
Thanks!
src/Block.js
Outdated
...props | ||
} = this.props; | ||
function Block(props) { | ||
const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like the pattern B could be better but we could leave it like that for the moment.
src/Checkbox.js
Outdated
import GalioTheme, { withGalio } from './theme'; | ||
|
||
function Checkbox(props) { | ||
const [checked, setchecked] = React.useState(props.initialValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hasn't been changed.
src/Checkbox.js
Outdated
function Checkbox(props) { | ||
const [checked, setchecked] = React.useState(props.initialValue); | ||
React.useEffect(() => { | ||
props.onChange(checked); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please reply.
@palingheorghe |
@palingheorghe I have implemented pattern B, and resolved the checkout.js changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only two changes left and we're good.
src/Icon.js
Outdated
@@ -4,44 +4,42 @@ import PropTypes from 'prop-types'; | |||
|
|||
import GalioTheme, { withGalio } from './theme'; | |||
import getIconType from './helpers/getIconType'; | |||
import galioConfig from './config/galio.json'; | |||
import galioConfig from './fonts/galio.json'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change the path here in ./config/galio.json
.
Converted all class based component into react hooks
PS: yarn test -> failed // jest not found !!