-
Notifications
You must be signed in to change notification settings - Fork 14
Added common components #54
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
Conversation
|
||
import styles from './styles'; | ||
|
||
export default class CustomButton extends PureComponent { |
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.
Keep export default
at the bottom of this file
customStyles = () => | ||
CustomButton.VARIANTS.map(variant => (this.props[variant] ? styles[variant] : null)).filter( | ||
style => style !== null | ||
); |
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'd extract this function and reuse it in customTextStyles
icon: PropTypes.number, | ||
iconStyle: ViewPropTypes.style, // eslint-disable-line react/no-typos | ||
onPress: PropTypes.func.isRequired, | ||
style: ViewPropTypes.style, // eslint-disable-line react/no-typos |
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.
If applies, I'd delete this rule. What do you think ? @wfolini @sbalay @IgnacioAbadie @ignaciosantise
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.
👍
backgroundColor: transparent | ||
}; | ||
|
||
export default StyleSheet.create({ |
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.
export default
at the bottom
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 think that we have all export default of styles file like @ignaciosantise wrote.
In components maybe, but in style files i like this. Really there is not difference
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.
@mvbattan if we are changing the export position of Stylesheets, we should change all of them in another PR
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.
Agree, let's do it in another PR
.filter(style => style !== null); | ||
CustomText.VARIANTS.map(variant => (this.props[variant] ? styles[variant] : null)).filter( | ||
style => style !== null | ||
); |
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'd reuse the function extracted from CustomButton
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.
👍
display: 'flex', | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
bottom: -4 |
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.
Mmm, why this ? This doesn't have issues with Android
overflow ?
If so, I'd put marginBottom = -4
<View | ||
style={[ | ||
this.props.multiline ? styles.multilineContainer : styles.container, | ||
this.props.bottomBorder ? styles.bottomBorder : {}, |
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.props.bottomBorder && styles.bottomBorder
?
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.
Yeeep!
multiline: PropTypes.bool, | ||
placeholder: PropTypes.string, | ||
titleStyles: Text.propTypes.style, // eslint-disable-line react/no-typos | ||
textStyles: Text.propTypes.style, // eslint-disable-line react/no-typos |
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 comment here.
Mmm isn't this deprecated ? 🤔 I've searched for TextPropTypes
but I've found nothing.
For example, View.propTypes.style
is deprecated.
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.
View.propTypes.style is deprecated, but there's no info about Text.propTypes. and it doesnt throw a warning or sth
|
||
import { gray, black, transparent } from '../../../constants/colors'; | ||
|
||
export default StyleSheet.create({ |
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.
export default
|
||
import { white } from '../../../constants/colors'; | ||
|
||
export default StyleSheet.create({ |
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.
export default
@ignaciosantise check the conflics |
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.
Excellent! some comments that I would like to say
I'd use this icons for login text inputs. They are more beautiful and without color
https://material.io/icons/#ic_visibility
https://material.io/icons/#ic_visibility_off
Also, I'd like us to change the way we pass the props to the CustomText
component and maybe also CustomButton
.
I'd only declare h1
, h2
, h3
, p
, etc props, and for that props declare the font family, color, size, weights, etc following the typesetting styles defined by the design department, like this example...
What u think about this? @ignaciosantise @IgnacioAbadie @mvbattan @sbalay
I think that in this way the app design is going to be more neat and with less possibility of design issues.
@wfolini great! Assets changed ;) About the props, think that configuration will depend on the project. Not all projects follow that design line. I think that colors and sizes should be customizable by props |
}/[email protected]`; | ||
module.exports.CUSTOM_TEXT_INPUT_ASSETS_VISIBILITY_3X = `${ | ||
module.exports.CUSTOM_TEXT_INPUT_ASSETS_PATH | ||
}/[email protected]`; |
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.
Dunno. It's likely this ic_visibility
is being repeated over and over
Summary
showPassword
propKnow Issues:
[TextInput] Dynamic changing of secureTextEntry breaks font and doesn't change cursor position facebook/react-native#5859
Screenshots
Loadable
Android
iOS
Custom text input
Android
iOS