-
Notifications
You must be signed in to change notification settings - Fork 28
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
fix: new modal animation #139
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,200 @@ | ||
Рекомендуемый размер заголовка [H2](#/Компоненты/Heading) с основным текстом [Body M]() (Normal). | ||
|
||
В окнах применяются [Brand Button](#/Компоненты/Button) и [Simple Button](#/Компоненты/Button) в размере Normal. | ||
|
||
```jsx | ||
<Box> | ||
<Actions size="normal"> | ||
<Button | ||
kind="simple" | ||
size="normal" | ||
type="button" | ||
text="Показать окно" | ||
onClick={() => setState({delete: true})} | ||
/> | ||
</Actions> | ||
<SimpleModal | ||
show={state.delete} | ||
size={'m'} | ||
closable | ||
backdropClose | ||
onHide={() => setState({delete: false})} | ||
children={ | ||
<Spacer size="xl"> | ||
<Heading size="2">Удалить из избранного?</Heading> | ||
<Actions size="normal"> | ||
<Button | ||
kind="brand" | ||
size="normal" | ||
type="button" | ||
text="Удалить" | ||
onClick={() => setState({delete: false})} | ||
/> | ||
<Button | ||
kind="simple" | ||
size="normal" | ||
type="button" | ||
text="Отменить" | ||
onClick={() => setState({delete: false})} | ||
/> | ||
</Actions> | ||
</Spacer> | ||
} | ||
/> | ||
</Box> | ||
``` | ||
|
||
|
||
|
||
## Примеры окон | ||
|
||
#### Заголовок, описание и кнопки | ||
|
||
```jsx | ||
<Box> | ||
<Actions size="normal"> | ||
<Button | ||
kind="simple" | ||
size="normal" | ||
type="button" | ||
text="Открыть" | ||
onClick={() => setState({notification: true})} | ||
/> | ||
</Actions> | ||
<SimpleModal | ||
show={state.notification} | ||
size={'m'} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
closable | ||
backdropClose | ||
onHide={() => setState({notification: false})} | ||
children={ | ||
<Spacer size="l"> | ||
<Spacer size="m"> | ||
<Heading size="2">Отключить уведомления?</Heading> | ||
<Paragraph size="m">Вам перестанут приходить сообщения о пополнении и списании</Paragraph> | ||
</Spacer> | ||
<Actions size="normal"> | ||
<Button | ||
kind="brand" | ||
size="normal" | ||
type="button" | ||
text="Отключить уведомления" | ||
onClick={() => setState({notification: false})} | ||
/> | ||
<Button | ||
kind="simple" | ||
size="normal" | ||
type="button" | ||
text="Не отключать" | ||
onClick={() => setState({notification: false})} | ||
/> | ||
</Actions> | ||
</Spacer> | ||
} | ||
/> | ||
</Box> | ||
``` | ||
|
||
#### Заголовок, инпут и кнопка | ||
|
||
```jsx | ||
<Box> | ||
<Actions size="normal"> | ||
<Button | ||
kind="simple" | ||
size="normal" | ||
type="button" | ||
text="Открыть" | ||
onClick={() => setState({email: true})} | ||
/> | ||
</Actions> | ||
<SimpleModal | ||
show={state.email} | ||
size={'m'} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😠 |
||
closable | ||
backdropClose | ||
onHide={() => setState({email: false})} | ||
children={ | ||
<Spacer size="l"> | ||
<Spacer size="l"> | ||
<Heading size="2">Куда отправить квитанцию?</Heading> | ||
<TextField | ||
title="Адрес элктронной почты" | ||
type="text" | ||
value={state.text} | ||
onChange={text => setState({text})} | ||
/> | ||
</Spacer> | ||
<Actions size="normal"> | ||
<Button | ||
kind="brand" | ||
size="normal" | ||
type="button" | ||
text="Отправить" | ||
onClick={() => setState({email: false})} | ||
/> | ||
</Actions> | ||
</Spacer> | ||
} | ||
/> | ||
</Box> | ||
``` | ||
|
||
#### Заголовок, инпут, кнопка и чекбоксы. | ||
|
||
```jsx | ||
initialState = {values: ['selected']}; | ||
<Box> | ||
<Actions size="normal"> | ||
<Button | ||
kind="simple" | ||
size="normal" | ||
type="button" | ||
text="Открыть" | ||
onClick={() => setState({snapping: true})} | ||
/> | ||
</Actions> | ||
<SimpleModal | ||
show={state.snapping} | ||
size={'m'} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. 💩 |
||
closable | ||
backdropClose | ||
onHide={() => setState({snapping: false})} | ||
children={ | ||
<Spacer size="l"> | ||
<Spacer size="l"> | ||
<Heading size="2">Привязка почты к QIWI Кошельку</Heading> | ||
<TextField | ||
title="Адрес элктронной почты" | ||
type="text" | ||
value={state.text} | ||
onChange={text => setState({text})} | ||
/> | ||
</Spacer> | ||
<Actions size="normal"> | ||
<Button | ||
kind="brand" | ||
size="normal" | ||
type="button" | ||
text="Привязать почту" | ||
onClick={() => setState({snapping: false})} | ||
/> | ||
</Actions> | ||
<CheckboxField | ||
options={[{ | ||
label: 'Использовать почту для изменения пароля', | ||
value: 'selected', | ||
disabled: false, | ||
}, { | ||
label: 'Получать письма о полезных функциях и акциях от QIWI', | ||
value: 'normal', | ||
disabled: false, | ||
}]} | ||
values={state.values} | ||
onChange={(values) => setState({values})} | ||
/> | ||
</Spacer> | ||
} | ||
/> | ||
</Box> | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,17 +19,17 @@ const contentTransition: FunctionComponent<SimpleTransitionProps> = (props) => < | |
|
||
contentTransition.defaultProps = { | ||
timeout: { | ||
enter: 370, | ||
exit: 250, | ||
enter: 300, | ||
exit: 150, | ||
}, | ||
enterClassName: (timeout: number) => css({ | ||
opacity: 1, | ||
transform: 'translate3d(0, 0, 0)', | ||
transform: 'scale(1.0)', | ||
transition: `opacity ${timeout}ms ease, transform ${timeout}ms ease`, | ||
}), | ||
exitClassName: (timeout: number) => css({ | ||
opacity: 0, | ||
transform: 'translate3d(0, -100%, 0)', | ||
transform: 'scale(0.94)', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. посмотри как работает рекапча в модалке размером |
||
transition: `opacity ${timeout}ms ease, transform ${timeout}ms ease`, | ||
}), | ||
} | ||
|
@@ -38,8 +38,8 @@ const backdropTransition: FunctionComponent<SimpleTransitionProps> = (props) => | |
|
||
backdropTransition.defaultProps = { | ||
timeout: { | ||
enter: 370, | ||
exit: 250, | ||
enter: 200, | ||
exit: 200, | ||
}, | ||
enterClassName: (timeout: number) => css({ | ||
opacity: 1, | ||
|
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.
size="m"