mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-22 15:39:11 +00:00
feat: create block from rundown empty
This commit is contained in:
committed by
Carlos Valente
parent
0a44bfe783
commit
67f914bdc0
@@ -2,3 +2,10 @@
|
|||||||
padding-block: 1.5rem;
|
padding-block: 1.5rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.inline {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 2rem;
|
||||||
|
}
|
||||||
|
|||||||
@@ -329,7 +329,7 @@ export default function Rundown({ data }: RundownProps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (sortableData.length < 1) {
|
if (sortableData.length < 1) {
|
||||||
return <RundownEmpty handleAddNew={() => insertAtId({ type: SupportedEntry.Event }, cursor)} />;
|
return <RundownEmpty handleAddNew={(type: SupportedEntry) => insertAtId({ type }, cursor)} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1. gather presentation options
|
// 1. gather presentation options
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import { IoAdd } from 'react-icons/io5';
|
import { IoAdd } from 'react-icons/io5';
|
||||||
import { Button } from '@chakra-ui/react';
|
import { Button } from '@chakra-ui/react';
|
||||||
|
import { SupportedEntry } from 'ontime-types';
|
||||||
|
|
||||||
import Empty from '../../common/components/state/Empty';
|
import Empty from '../../common/components/state/Empty';
|
||||||
|
|
||||||
import style from './Empty.module.scss';
|
import style from './Empty.module.scss';
|
||||||
|
|
||||||
interface RundownEmptyProps {
|
interface RundownEmptyProps {
|
||||||
handleAddNew: () => void;
|
handleAddNew: (type: SupportedEntry) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function RundownEmpty(props: RundownEmptyProps) {
|
export default function RundownEmpty(props: RundownEmptyProps) {
|
||||||
@@ -14,10 +15,16 @@ export default function RundownEmpty(props: RundownEmptyProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={style.empty}>
|
<div className={style.empty}>
|
||||||
<Empty style={{ marginTop: '7vh', marginBottom: '1.5rem' }} />
|
<Empty style={{ marginTop: '5vh', marginBottom: '3rem' }} />
|
||||||
<Button onClick={handleAddNew} variant='ontime-filled' leftIcon={<IoAdd />}>
|
<div className={style.inline}>
|
||||||
Create Event
|
<Button onClick={() => handleAddNew(SupportedEntry.Event)} variant='ontime-filled' leftIcon={<IoAdd />}>
|
||||||
</Button>
|
Create Event
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Button onClick={() => handleAddNew(SupportedEntry.Block)} variant='ontime-filled' leftIcon={<IoAdd />}>
|
||||||
|
Create Block
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user