Skip to content

Hint#41

Open
Kanonir87 wants to merge 8 commits intoroistat:masterfrom
Kanonir87:Hint
Open

Hint#41
Kanonir87 wants to merge 8 commits intoroistat:masterfrom
Kanonir87:Hint

Conversation

@Kanonir87
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/Hint/Hint.jsx Outdated
/**
* Tail position
*/
tailPosition: PropTypes.oneOf(['leftTop', 'rightTop', 'topLeft'])
Copy link
Copy Markdown
Contributor

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

Comment thread src/Hint/Hint.jsx Outdated

import { StyleSheet, css } from '../helpers/styles';

export default class Hint extends React.Component {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/Hint/Hint.jsx Outdated
<View
styles={[
STYLE.triangle,
(props.tailPosition === 'leftTop' || props.tailPosition === 'rightTop') && STYLE.triangleHorizontal ,
Copy link
Copy Markdown
Contributor

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

Comment thread src/Hint/Hint.md
<Hint tailPosition={'leftTop'}>Hint</Hint>
</View>

*Hint, showed on hover*
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше сделать нативный селект с возможными позициями и в зависимости от выбора менять tailPosition
Это будет один хороший пример демонстрирующий все возможные подсказки

Comment thread src/Hint/Hint.jsx Outdated
import { StyleSheet, css } from '../helpers/styles';

const Hint = (props) => {
const { tailPosition, ...styles } = props;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...styles убрать

Comment thread src/Hint/Hint.jsx Outdated
const { tailPosition, ...styles } = props;
return (
<View className={css(STYLE.hint)} styles={props.styles}>
<View className={css(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

className={css...} -> styles={[]}

Comment thread src/Hint/Hint.jsx Outdated
const Hint = (props) => {
const { tailPosition, ...styles } = props;
return (
<View className={css(STYLE.hint)} styles={props.styles}>
Copy link
Copy Markdown
Contributor

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 || {})]}

Comment thread src/Hint/Hint.jsx Outdated
/**
* Tail position
*/
tailPosition: PropTypes.oneOf(['leftTop', 'rightTop', 'topLeft', 'leftBottom', 'rightBottom', 'topRight', 'bottomLeft', 'bottomRight']).isRequired
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

длинновато,

[
    'leftTop',
    'rightTop'
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants