mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
#58 fixed dialog routers
This commit is contained in:
parent
3e8c2d4b6e
commit
124719c243
15 changed files with 93 additions and 39 deletions
|
@ -16,22 +16,29 @@ const SubmitBar: FC<Props> = ({ isLab }) => {
|
|||
const onFocus = useCallback(() => setFocused(true), [setFocused]);
|
||||
const onBlur = useCallback(() => setFocused(false), [setFocused]);
|
||||
|
||||
const createUrl = useCallback(
|
||||
(type: string) => {
|
||||
return [url.replace(/\/$/, ''), 'create', type].join('/');
|
||||
},
|
||||
[url]
|
||||
);
|
||||
|
||||
return (
|
||||
<div className={classNames(styles.wrap, { [styles.lab]: isLab })}>
|
||||
<div className={classNames(styles.panel, { [styles.active]: focused })}>
|
||||
<Link to={`${url}/create/image`} className={styles.link}>
|
||||
<Link to={createUrl('image')} className={styles.link}>
|
||||
<Icon icon="image" size={32} />
|
||||
</Link>
|
||||
|
||||
<Link to={`${url}/create/text`} className={styles.link}>
|
||||
<Link to={createUrl('text')} className={styles.link}>
|
||||
<Icon icon="text" size={32} />
|
||||
</Link>
|
||||
|
||||
<Link to={`${url}/create/video`} className={styles.link}>
|
||||
<Link to={createUrl('video')} className={styles.link}>
|
||||
<Icon icon="video" size={32} />
|
||||
</Link>
|
||||
|
||||
<Link to={`${url}/create/audio`} className={styles.link}>
|
||||
<Link to={createUrl('audio')} className={styles.link}>
|
||||
<Icon icon="audio" size={32} />
|
||||
</Link>
|
||||
</div>
|
||||
|
|
|
@ -7,7 +7,7 @@ import { Padder } from '~/components/containers/Padder';
|
|||
import { useNodeFormContext } from '~/utils/hooks/useNodeFormFormik';
|
||||
|
||||
const EditorButtons: FC = () => {
|
||||
const { values, handleChange } = useNodeFormContext();
|
||||
const { values, handleChange, isSubmitting } = useNodeFormContext();
|
||||
|
||||
return (
|
||||
<Padder style={{ position: 'relative' }}>
|
||||
|
@ -20,12 +20,14 @@ const EditorButtons: FC = () => {
|
|||
handler={handleChange('title')}
|
||||
autoFocus
|
||||
maxLength={256}
|
||||
disabled={isSubmitting}
|
||||
/>
|
||||
|
||||
<Button
|
||||
title="Сохранить"
|
||||
iconRight="check"
|
||||
color={values.is_promoted ? 'primary' : 'lab'}
|
||||
disabled={isSubmitting}
|
||||
/>
|
||||
</Group>
|
||||
</Padder>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue