Conversation
src/Hint/Hint.jsx
Outdated
| /** | ||
| * Tail position | ||
| */ | ||
| tailPosition: PropTypes.oneOf(['leftTop', 'rightTop', 'topLeft']) |
There was a problem hiding this comment.
надо добавить другие позиции: leftBottom, rightBottom, topRight, bottomLeft, bottomRight
src/Hint/Hint.jsx
Outdated
|
|
||
| import { StyleSheet, css } from '../helpers/styles'; | ||
|
|
||
| export default class Hint extends React.Component { |
There was a problem hiding this comment.
переделать на stateless-functions https://facebook.github.io/react/docs/reusable-components.html#stateless-functions
src/Hint/Hint.jsx
Outdated
| <View | ||
| styles={[ | ||
| STYLE.triangle, | ||
| (props.tailPosition === 'leftTop' || props.tailPosition === 'rightTop') && STYLE.triangleHorizontal , |
There was a problem hiding this comment.
используй для стилей позиции 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.
Лучше сделать нативный селект с возможными позициями и в зависимости от выбора менять tailPosition
Это будет один хороший пример демонстрирующий все возможные подсказки
src/Hint/Hint.jsx
Outdated
| import { StyleSheet, css } from '../helpers/styles'; | ||
|
|
||
| const Hint = (props) => { | ||
| const { tailPosition, ...styles } = props; |
src/Hint/Hint.jsx
Outdated
| const { tailPosition, ...styles } = props; | ||
| return ( | ||
| <View className={css(STYLE.hint)} styles={props.styles}> | ||
| <View className={css( |
There was a problem hiding this comment.
className={css...} -> styles={[]}
src/Hint/Hint.jsx
Outdated
| const Hint = (props) => { | ||
| const { tailPosition, ...styles } = props; | ||
| return ( | ||
| <View className={css(STYLE.hint)} styles={props.styles}> |
There was a problem hiding this comment.
styles={[STYLE.hint, ...(props.styles || {})]}
src/Hint/Hint.jsx
Outdated
| /** | ||
| * Tail position | ||
| */ | ||
| tailPosition: PropTypes.oneOf(['leftTop', 'rightTop', 'topLeft', 'leftBottom', 'rightBottom', 'topRight', 'bottomLeft', 'bottomRight']).isRequired |
There was a problem hiding this comment.
длинновато,
[
'leftTop',
'rightTop'
]
No description provided.