mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-21 23:19:09 +00:00
refactor: smaller settings
This commit is contained in:
committed by
Carlos Valente
parent
4a70bcfe64
commit
ed65a4db67
@@ -57,6 +57,7 @@ $text-body-size: calc(1rem - 1px);
|
|||||||
|
|
||||||
// media queries
|
// media queries
|
||||||
$min-tablet: 500px;
|
$min-tablet: 500px;
|
||||||
|
$small-screen: 800px;
|
||||||
|
|
||||||
.blink {
|
.blink {
|
||||||
animation: blink 1s step-start infinite;
|
animation: blink 1s step-start infinite;
|
||||||
|
|||||||
+7
-19
@@ -1,24 +1,20 @@
|
|||||||
.tableSettings {
|
.tableSettings {
|
||||||
grid-area: settings;
|
grid-area: settings;
|
||||||
padding: 1rem;
|
padding: 0.5rem 1rem;
|
||||||
background-color: $ui-black;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
gap: 5rem;
|
||||||
font-size: $inner-section-text-size;
|
font-size: $inner-section-text-size;
|
||||||
}
|
|
||||||
|
|
||||||
.leftPanel {
|
@media (max-width: $small-screen) {
|
||||||
display: flex;
|
gap: 1rem;
|
||||||
flex-direction: column;
|
}
|
||||||
width: 100%;
|
|
||||||
gap: 0.5rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.sectionTitle {
|
.sectionTitle {
|
||||||
color: $gray-700;
|
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
.options {
|
.row {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
column-gap: 1rem;
|
column-gap: 1rem;
|
||||||
@@ -30,12 +26,4 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rightPanel {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 0.5rem;
|
|
||||||
|
|
||||||
padding-left: 2rem;
|
|
||||||
}
|
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
import { memo, ReactNode } from 'react';
|
import { memo, ReactNode } from 'react';
|
||||||
import { Button, Checkbox, Switch } from '@chakra-ui/react';
|
import { Button, Checkbox } from '@chakra-ui/react';
|
||||||
import { Column } from '@tanstack/react-table';
|
import { Column } from '@tanstack/react-table';
|
||||||
import { OntimeRundownEntry } from 'ontime-types';
|
import { OntimeRundownEntry } from 'ontime-types';
|
||||||
|
|
||||||
import { useCuesheetSettings } from '../store/cuesheetSettingsStore';
|
import * as Editor from '../../../features/editors/editor-utils/EditorUtils';
|
||||||
|
|
||||||
import style from './CuesheetTableSettings.module.scss';
|
import style from './CuesheetTableSettings.module.scss';
|
||||||
|
|
||||||
// reusable button styles
|
// reusable button styles
|
||||||
const buttonProps = {
|
const buttonProps = {
|
||||||
size: 'sm',
|
size: 'xs',
|
||||||
variant: 'ontime-subtle',
|
variant: 'ontime-subtle',
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -22,26 +22,12 @@ interface CuesheetTableSettingsProps {
|
|||||||
|
|
||||||
function CuesheetTableSettings(props: CuesheetTableSettingsProps) {
|
function CuesheetTableSettings(props: CuesheetTableSettingsProps) {
|
||||||
const { columns, handleResetResizing, handleResetReordering, handleClearToggles } = props;
|
const { columns, handleResetResizing, handleResetReordering, handleClearToggles } = props;
|
||||||
const {
|
|
||||||
followSelected,
|
|
||||||
showIndexColumn,
|
|
||||||
toggleFollow,
|
|
||||||
showPrevious,
|
|
||||||
togglePreviousVisibility,
|
|
||||||
showDelayBlock,
|
|
||||||
hideSeconds,
|
|
||||||
showDelayedTimes,
|
|
||||||
toggleIndexColumn,
|
|
||||||
toggleDelayedTimes,
|
|
||||||
toggleDelayVisibility,
|
|
||||||
toggleSecondsVisibility,
|
|
||||||
} = useCuesheetSettings();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={style.tableSettings}>
|
<div className={style.tableSettings}>
|
||||||
<div className={style.leftPanel}>
|
<div>
|
||||||
<div className={style.sectionTitle}>Toggle column visibility</div>
|
<Editor.Label className={style.sectionTitle}>Toggle column visibility</Editor.Label>
|
||||||
<div className={style.options}>
|
<div className={style.row}>
|
||||||
{columns.map((column) => {
|
{columns.map((column) => {
|
||||||
const columnHeader = column.columnDef.header;
|
const columnHeader = column.columnDef.header;
|
||||||
const visible = column.getIsVisible();
|
const visible = column.getIsVisible();
|
||||||
@@ -57,47 +43,20 @@ function CuesheetTableSettings(props: CuesheetTableSettingsProps) {
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div className={style.sectionTitle}>Table Options</div>
|
|
||||||
<div className={style.options}>
|
|
||||||
<label className={style.option}>
|
|
||||||
<Switch variant='ontime' size='sm' isChecked={followSelected} onChange={() => toggleFollow()} />
|
|
||||||
Follow selected event
|
|
||||||
</label>
|
|
||||||
<label className={style.option}>
|
|
||||||
<Switch variant='ontime' size='sm' isChecked={showPrevious} onChange={() => togglePreviousVisibility()} />
|
|
||||||
Show past events
|
|
||||||
</label>
|
|
||||||
<label className={style.option}>
|
|
||||||
<Switch variant='ontime' size='sm' isChecked={showIndexColumn} onChange={() => toggleIndexColumn()} />
|
|
||||||
Show Event Order
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div className={style.sectionTitle}>Delay Flow</div>
|
|
||||||
<div className={style.options}>
|
|
||||||
<label className={style.option}>
|
|
||||||
<Switch variant='ontime' size='sm' isChecked={showDelayedTimes} onChange={() => toggleDelayedTimes()} />
|
|
||||||
Show delayed times
|
|
||||||
</label>
|
|
||||||
<label className={style.option}>
|
|
||||||
<Switch variant='ontime' size='sm' isChecked={showDelayBlock} onChange={() => toggleDelayVisibility()} />
|
|
||||||
Show delay blocks
|
|
||||||
</label>
|
|
||||||
<label className={style.option}>
|
|
||||||
<Switch variant='ontime' size='sm' isChecked={hideSeconds} onChange={() => toggleSecondsVisibility()} />
|
|
||||||
Hide seconds
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div className={style.rightPanel}>
|
<div className={style.column}>
|
||||||
<Button onClick={handleClearToggles} {...buttonProps}>
|
<Editor.Label className={style.sectionTitle}>Reset Options</Editor.Label>
|
||||||
Show All
|
<div className={style.row}>
|
||||||
</Button>
|
<Button onClick={handleClearToggles} {...buttonProps}>
|
||||||
<Button onClick={handleResetResizing} {...buttonProps}>
|
Show All
|
||||||
Reset Resizing
|
</Button>
|
||||||
</Button>
|
<Button onClick={handleResetResizing} {...buttonProps}>
|
||||||
<Button onClick={handleResetReordering} {...buttonProps}>
|
Reset Resizing
|
||||||
Reset Reordering
|
</Button>
|
||||||
</Button>
|
<Button onClick={handleResetReordering} {...buttonProps}>
|
||||||
|
Reset Reordering
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user