refactor: small code improvements

refactor: remove unused code

refactor: extract loader component

refactor: prevent keyword collision

refactor: cleanup hook pending states
This commit is contained in:
Carlos Valente
2025-07-23 21:13:14 +02:00
committed by Carlos Valente
parent 8c90f5043f
commit e204f671be
10 changed files with 30 additions and 25 deletions
@@ -18,7 +18,7 @@ import CodeEditorModal from './composite/StyleEditorModal';
const cssOverrideDocsUrl = 'https://docs.getontime.no/features/custom-styling/';
export default function ViewSettings() {
const { data, isPending, mutateAsync } = useViewSettings();
const { data, status, mutateAsync } = useViewSettings();
const [isCodeEditorOpen, codeEditorHandler] = useDisclosure();
const {
@@ -87,7 +87,7 @@ export default function ViewSettings() {
<ExternalLink href={cssOverrideDocsUrl}>See the docs</ExternalLink>
</Info>
<Panel.Section>
<Panel.Loader isLoading={isPending} />
<Panel.Loader isLoading={status === 'pending'} />
<Panel.Error>{errors.root?.message}</Panel.Error>
<Panel.ListGroup>
<CodeEditorModal isOpen={isCodeEditorOpen} onClose={codeEditorHandler.close} />
@@ -16,7 +16,7 @@ export default function RundownEmpty(props: RundownEmptyProps) {
return (
<div className={style.empty}>
<Empty style={{ marginTop: '5vh', marginBottom: '3rem' }} />
<Empty injectedStyles={{ marginTop: '5vh', marginBottom: '3rem' }} />
<div className={style.inline}>
<Button onClick={() => handleAddNew(SupportedEntry.Event)} variant='primary' size='large'>
<IoAdd />