-
Notifications
You must be signed in to change notification settings - Fork 5
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
Hint #41
base: master
Are you sure you want to change the base?
Hint #41
Conversation
/** | ||
* Tail position | ||
*/ | ||
tailPosition: PropTypes.oneOf(['leftTop', 'rightTop', 'topLeft']) |
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.
надо добавить другие позиции: leftBottom, rightBottom, topRight, bottomLeft, bottomRight
|
||
import { StyleSheet, css } from '../helpers/styles'; | ||
|
||
export default class Hint extends React.Component { |
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.
переделать на stateless-functions https://facebook.github.io/react/docs/reusable-components.html#stateless-functions
<View | ||
styles={[ | ||
STYLE.triangle, | ||
(props.tailPosition === 'leftTop' || props.tailPosition === 'rightTop') && STYLE.triangleHorizontal , |
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.
используй для стилей позиции getPreset https://github.com/roistat/react-ui/blob/master/src/Button/Button.jsx#L94
<Hint tailPosition={'leftTop'}>Hint</Hint> | ||
</View> | ||
|
||
*Hint, showed on hover* |
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.
Лучше сделать нативный селект с возможными позициями и в зависимости от выбора менять tailPosition
Это будет один хороший пример демонстрирующий все возможные подсказки
import { StyleSheet, css } from '../helpers/styles'; | ||
|
||
const Hint = (props) => { | ||
const { tailPosition, ...styles } = 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.
...styles убрать
const { tailPosition, ...styles } = props; | ||
return ( | ||
<View className={css(STYLE.hint)} styles={props.styles}> | ||
<View className={css( |
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.
className={css...} -> styles={[]}
const Hint = (props) => { | ||
const { tailPosition, ...styles } = props; | ||
return ( | ||
<View className={css(STYLE.hint)} styles={props.styles}> |
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.
styles={[STYLE.hint, ...(props.styles || {})]}
/** | ||
* Tail position | ||
*/ | ||
tailPosition: PropTypes.oneOf(['leftTop', 'rightTop', 'topLeft', 'leftBottom', 'rightBottom', 'topRight', 'bottomLeft', 'bottomRight']).isRequired |
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.
длинновато,
[
'leftTop',
'rightTop'
]
No description provided.