refactor: use inline elements

This commit is contained in:
Carlos Valente
2025-01-24 16:12:08 +01:00
committed by Carlos Valente
parent a1d34c8f6c
commit a12694b186
26 changed files with 56 additions and 158 deletions
@@ -4,7 +4,6 @@ import { useKeyDown } from '../../common/hooks/useKeyDown';
import AboutPanel from './panel/about-panel/AboutPanel'; import AboutPanel from './panel/about-panel/AboutPanel';
import AutomationPanel from './panel/automations-panel/AutomationPanel'; import AutomationPanel from './panel/automations-panel/AutomationPanel';
import ClientControlPanel from './panel/client-control-panel/ClientControlPanel';
import FeatureSettingsPanel from './panel/feature-settings-panel/FeatureSettingsPanel'; import FeatureSettingsPanel from './panel/feature-settings-panel/FeatureSettingsPanel';
import GeneralPanel from './panel/general-panel/GeneralPanel'; import GeneralPanel from './panel/general-panel/GeneralPanel';
import NetworkLogPanel from './panel/network-panel/NetworkLogPanel'; import NetworkLogPanel from './panel/network-panel/NetworkLogPanel';
@@ -31,9 +30,8 @@ export default function AppSettings() {
{panel === 'feature_settings' && <FeatureSettingsPanel location={location} />} {panel === 'feature_settings' && <FeatureSettingsPanel location={location} />}
{panel === 'sources' && <SourcesPanel />} {panel === 'sources' && <SourcesPanel />}
{panel === 'automation' && <AutomationPanel location={location} />} {panel === 'automation' && <AutomationPanel location={location} />}
{panel === 'client_control' && <ClientControlPanel />}
{panel === 'about' && <AboutPanel />}
{panel === 'network' && <NetworkLogPanel location={location} />} {panel === 'network' && <NetworkLogPanel location={location} />}
{panel === 'about' && <AboutPanel />}
{panel === 'shutdown' && <ShutdownPanel />} {panel === 'shutdown' && <ShutdownPanel />}
</PanelContent> </PanelContent>
</ErrorBoundary> </ErrorBoundary>
@@ -68,16 +68,6 @@
grid-template-columns: 1fr auto; grid-template-columns: 1fr auto;
} }
.actions {
justify-content: flex-end;
}
.actionButtons {
display: flex;
gap: 1rem;
margin-top: 1rem;
}
.outputCard { .outputCard {
border-left: 0.25rem solid $gray-1200; border-left: 0.25rem solid $gray-1200;
padding-left: 0.5rem; padding-left: 0.5rem;
@@ -2,23 +2,11 @@
width: 100%; width: 100%;
} }
.actionButtons { .halfWidth {
display: flex; width: 50%;
gap: $element-spacing;
} }
.halfWidth { .halfWidthNoWrap {
width: 50%; width: 50%;
white-space: nowrap; white-space: nowrap;
} }
.pathList {
width: 100%;
}
.badgeList {
width: 100%;
* {
margin-right: $element-spacing;
}
}
@@ -52,7 +52,7 @@ export default function ClientList() {
<Panel.Table> <Panel.Table>
<thead> <thead>
<tr> <tr>
<td className={style.fullWidth}>Client Name (Connection ID)</td> <td className={style.halfWidth}>Client Name (Connection ID)</td>
<td className={style.fullWidth}>Path</td> <td className={style.fullWidth}>Path</td>
<td /> <td />
</tr> </tr>
@@ -63,7 +63,7 @@ export default function ClientList() {
const isCurrent = id === key; const isCurrent = id === key;
return ( return (
<tr key={key}> <tr key={key}>
<td className={style.badgeList}> <Panel.InlineElements relation='inner' as='td'>
<Badge variant='outline' size='xs'> <Badge variant='outline' size='xs'>
{key} {key}
</Badge> </Badge>
@@ -73,9 +73,9 @@ export default function ClientList() {
</Badge> </Badge>
)} )}
{name} {name}
</td> </Panel.InlineElements>
<td className={style.pathList}>{path}</td> <td>{path}</td>
<td className={style.actionButtons}> <Panel.InlineElements relation='inner'>
<Button <Button
size='xs' size='xs'
className={`${identify ? style.blink : ''}`} className={`${identify ? style.blink : ''}`}
@@ -106,7 +106,7 @@ export default function ClientList() {
> >
Redirect Redirect
</Button> </Button>
</td> </Panel.InlineElements>
</tr> </tr>
); );
})} })}
@@ -119,8 +119,8 @@ export default function ClientList() {
<Panel.Table> <Panel.Table>
<thead> <thead>
<tr> <tr>
<td className={style.halfWidth}>Client Name (Connection ID)</td> <td className={style.halfWidthNoWrap}>Client Name (Connection ID)</td>
<td className={style.halfWidth}>Client type</td> <td className={style.halfWidthNoWrap}>Client type</td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -129,12 +129,12 @@ export default function ClientList() {
return ( return (
<tr key={key}> <tr key={key}>
<td className={style.badgeList}> <Panel.InlineElements relation='inner' as='td'>
<Badge variant='outline' size='sx'> <Badge variant='outline' size='sx'>
{key} {key}
</Badge> </Badge>
{name} {name}
</td> </Panel.InlineElements>
<td>{type}</td> <td>{type}</td>
</tr> </tr>
); );
@@ -6,16 +6,6 @@
width: 100%; width: 100%;
} }
.actions {
display: flex;
gap: 0.5px;
}
.actionButtons {
display: flex;
gap: 1em;
}
.fieldForm { .fieldForm {
padding: 1rem; padding: 1rem;
background-color: $gray-1350; background-color: $gray-1350;
@@ -24,12 +14,6 @@
gap: 1rem; gap: 1rem;
} }
.buttonRow {
display: flex;
justify-content: flex-end;
gap: 1rem;
}
.fit { .fit {
width: fit-content; width: fit-content;
} }
@@ -38,10 +22,6 @@
min-width: 12em; min-width: 12em;
} }
.flex {
display: flex;
}
.twoCols { .twoCols {
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
@@ -92,14 +92,14 @@ export default function UrlPresetsForm() {
<Panel.Card> <Panel.Card>
<Panel.SubHeader> <Panel.SubHeader>
URL presets URL presets
<div className={style.actionButtons}> <Panel.InlineElements>
<Button variant='ontime-ghosted' size='sm' onClick={onReset} isDisabled={!canSubmit}> <Button variant='ontime-ghosted' size='sm' onClick={onReset} isDisabled={!canSubmit}>
Revert to saved Revert to saved
</Button> </Button>
<Button variant='ontime-filled' size='sm' type='submit' isDisabled={!canSubmit} isLoading={isSubmitting}> <Button variant='ontime-filled' size='sm' type='submit' isDisabled={!canSubmit} isLoading={isSubmitting}>
Save Save
</Button> </Button>
</div> </Panel.InlineElements>
</Panel.SubHeader> </Panel.SubHeader>
<Panel.Divider /> <Panel.Divider />
<Alert status='info' variant='ontime-on-dark-info'> <Alert status='info' variant='ontime-on-dark-info'>
@@ -192,7 +192,7 @@ export default function UrlPresetsForm() {
/> />
<Panel.Error>{maybeUrlError}</Panel.Error> <Panel.Error>{maybeUrlError}</Panel.Error>
</td> </td>
<td className={style.flex}> <Panel.InlineElements relation='inner' as='td'>
<TooltipActionBtn <TooltipActionBtn
size='sm' size='sm'
isDisabled={!canTest} isDisabled={!canTest}
@@ -213,7 +213,7 @@ export default function UrlPresetsForm() {
aria-label='Delete entry' aria-label='Delete entry'
data-testid={`field__delete_${index}`} data-testid={`field__delete_${index}`}
/> />
</td> </Panel.InlineElements>
</tr> </tr>
); );
})} })}
@@ -6,6 +6,7 @@ import { CustomField, CustomFieldLabel } from 'ontime-types';
import CopyTag from '../../../../../common/components/copy-tag/CopyTag'; import CopyTag from '../../../../../common/components/copy-tag/CopyTag';
import Swatch from '../../../../../common/components/input/colour-input/Swatch'; import Swatch from '../../../../../common/components/input/colour-input/Swatch';
import * as Panel from '../../../panel-utils/PanelUtils';
import CustomFieldForm from './CustomFieldForm'; import CustomFieldForm from './CustomFieldForm';
@@ -55,7 +56,7 @@ export default function CustomFieldEntry(props: CustomFieldEntryProps) {
{field} {field}
</CopyTag> </CopyTag>
</td> </td>
<td className={style.actions}> <Panel.InlineElements relation='inner' as='td'>
<IconButton <IconButton
size='sm' size='sm'
variant='ontime-ghosted' variant='ontime-ghosted'
@@ -72,7 +73,7 @@ export default function CustomFieldEntry(props: CustomFieldEntryProps) {
aria-label='Delete entry' aria-label='Delete entry'
onClick={() => onDelete(field)} onClick={() => onDelete(field)}
/> />
</td> </Panel.InlineElements>
</tr> </tr>
); );
} }
@@ -107,14 +107,14 @@ export default function CustomFieldForm(props: CustomFieldsFormProps) {
</div> </div>
{errors.root && <Panel.Error>{errors.root.message}</Panel.Error>} {errors.root && <Panel.Error>{errors.root.message}</Panel.Error>}
<div className={style.buttonRow}> <Panel.InlineElements relation='inner' align='end'>
<Button size='sm' variant='ontime-ghosted' onClick={onCancel}> <Button size='sm' variant='ontime-ghosted' onClick={onCancel}>
Cancel Cancel
</Button> </Button>
<Button size='sm' type='submit' variant='ontime-filled' isDisabled={!canSubmit} isLoading={isSubmitting}> <Button size='sm' type='submit' variant='ontime-filled' isDisabled={!canSubmit} isLoading={isSubmitting}>
Save Save
</Button> </Button>
</div> </Panel.InlineElements>
</form> </form>
); );
} }
@@ -1,4 +0,0 @@
.actionButtons {
display: flex;
gap: 1em;
}
@@ -11,8 +11,6 @@ import * as Panel from '../../panel-utils/PanelUtils';
import GeneralPinInput from './GeneralPinInput'; import GeneralPinInput from './GeneralPinInput';
import style from './GeneralPanel.module.scss';
export type GeneralPanelFormValues = { export type GeneralPanelFormValues = {
filename: string; filename: string;
}; };
@@ -66,7 +64,7 @@ export default function GeneralPanelForm() {
<Panel.Card> <Panel.Card>
<Panel.SubHeader> <Panel.SubHeader>
General settings General settings
<div className={style.actionButtons}> <Panel.InlineElements>
<Button isDisabled={!isDirty || isSubmitting} variant='ontime-ghosted' size='sm' onClick={onReset}> <Button isDisabled={!isDirty || isSubmitting} variant='ontime-ghosted' size='sm' onClick={onReset}>
Revert to saved Revert to saved
</Button> </Button>
@@ -80,7 +78,7 @@ export default function GeneralPanelForm() {
> >
Save Save
</Button> </Button>
</div> </Panel.InlineElements>
</Panel.SubHeader> </Panel.SubHeader>
{submitError && <Panel.Error>{submitError}</Panel.Error>} {submitError && <Panel.Error>{submitError}</Panel.Error>}
<Panel.Divider /> <Panel.Divider />
@@ -11,8 +11,6 @@ import useInfo from '../../../../common/hooks-query/useInfo';
import useViewSettings from '../../../../common/hooks-query/useViewSettings'; import useViewSettings from '../../../../common/hooks-query/useViewSettings';
import * as Panel from '../../panel-utils/PanelUtils'; import * as Panel from '../../panel-utils/PanelUtils';
import style from './GeneralPanel.module.scss';
const cssOverrideDocsUrl = 'https://docs.getontime.no/features/custom-styling/'; const cssOverrideDocsUrl = 'https://docs.getontime.no/features/custom-styling/';
export default function ViewSettingsForm() { export default function ViewSettingsForm() {
@@ -71,14 +69,14 @@ export default function ViewSettingsForm() {
<Panel.Card> <Panel.Card>
<Panel.SubHeader> <Panel.SubHeader>
View settings View settings
<div className={style.actionButtons}> <Panel.InlineElements>
<Button isDisabled={!isDirty} variant='ontime-ghosted' size='sm' onClick={onReset}> <Button isDisabled={!isDirty} variant='ontime-ghosted' size='sm' onClick={onReset}>
Revert to saved Revert to saved
</Button> </Button>
<Button type='submit' isLoading={isSubmitting} isDisabled={!isDirty} variant='ontime-filled' size='sm'> <Button type='submit' isLoading={isSubmitting} isDisabled={!isDirty} variant='ontime-filled' size='sm'>
Save Save
</Button> </Button>
</div> </Panel.InlineElements>
</Panel.SubHeader> </Panel.SubHeader>
<Panel.Divider /> <Panel.Divider />
<Alert status='info' variant='ontime-on-dark-info'> <Alert status='info' variant='ontime-on-dark-info'>
@@ -1,10 +1,3 @@
.interfaces {
display: flex;
flex-wrap: wrap;
gap: $section-spacing;
row-gap: $element-inner-spacing;
}
.goIcon { .goIcon {
@include rotate-fourty-five; @include rotate-fourty-five;
margin-left: 0.25rem; margin-left: 0.25rem;
@@ -4,6 +4,7 @@ import CopyTag from '../../../../common/components/copy-tag/CopyTag';
import useInfo from '../../../../common/hooks-query/useInfo'; import useInfo from '../../../../common/hooks-query/useInfo';
import { linkToOtherHost, openLink } from '../../../../common/utils/linkUtils'; import { linkToOtherHost, openLink } from '../../../../common/utils/linkUtils';
import { isLocalhost } from '../../../../externals'; import { isLocalhost } from '../../../../externals';
import * as Panel from '../../panel-utils/PanelUtils';
import style from './NetworkInterfaces.module.scss'; import style from './NetworkInterfaces.module.scss';
@@ -13,7 +14,7 @@ export default function InfoNif() {
const handleClick = (address: string) => openLink(address); const handleClick = (address: string) => openLink(address);
return ( return (
<div className={style.interfaces}> <Panel.InlineElements>
{data.networkInterfaces.map((nif) => { {data.networkInterfaces.map((nif) => {
// interfaces outside localhost wont have access // interfaces outside localhost wont have access
if (nif.name === 'localhost' && !isLocalhost) return null; if (nif.name === 'localhost' && !isLocalhost) return null;
@@ -30,6 +31,6 @@ export default function InfoNif() {
</CopyTag> </CopyTag>
); );
})} })}
</div> </Panel.InlineElements>
); );
} }
@@ -11,8 +11,6 @@ import * as Panel from '../../panel-utils/PanelUtils';
import ProjectCreateForm from './ProjectCreateForm'; import ProjectCreateForm from './ProjectCreateForm';
import ProjectList from './ProjectList'; import ProjectList from './ProjectList';
import style from './ProjectPanel.module.scss';
export default function ManageProjects() { export default function ManageProjects() {
const [searchParams, setSearchParams] = useSearchParams(); const [searchParams, setSearchParams] = useSearchParams();
const [error, setError] = useState(''); const [error, setError] = useState('');
@@ -70,7 +68,7 @@ export default function ManageProjects() {
<Panel.Card> <Panel.Card>
<Panel.SubHeader> <Panel.SubHeader>
Manage projects Manage projects
<div className={style.headerButtons}> <Panel.InlineElements>
<Button <Button
variant='ontime-subtle' variant='ontime-subtle'
onClick={handleSelectFile} onClick={handleSelectFile}
@@ -89,7 +87,7 @@ export default function ManageProjects() {
> >
New New
</Button> </Button>
</div> </Panel.InlineElements>
</Panel.SubHeader> </Panel.SubHeader>
{error && <Panel.Error>{error}</Panel.Error>} {error && <Panel.Error>{error}</Panel.Error>}
<Panel.Divider /> <Panel.Divider />
@@ -69,14 +69,14 @@ export default function ProjectCreateForm(props: ProjectCreateFromProps) {
<Panel.Section as='form' onSubmit={handleSubmit(handleSubmitCreate)}> <Panel.Section as='form' onSubmit={handleSubmit(handleSubmitCreate)}>
<Panel.Title> <Panel.Title>
Create new project Create new project
<div className={style.createActionButtons}> <Panel.InlineElements>
<Button onClick={onClose} variant='ontime-ghosted' size='sm' isDisabled={isSubmitting}> <Button onClick={onClose} variant='ontime-ghosted' size='sm' isDisabled={isSubmitting}>
Cancel Cancel
</Button> </Button>
<Button isDisabled={!isValid} type='submit' isLoading={isSubmitting} variant='ontime-filled' size='sm'> <Button isDisabled={!isValid} type='submit' isLoading={isSubmitting} variant='ontime-filled' size='sm'>
Create Create project
</Button> </Button>
</div> </Panel.InlineElements>
</Panel.Title> </Panel.Title>
{error && <Panel.Error>{error}</Panel.Error>} {error && <Panel.Error>{error}</Panel.Error>}
<Panel.Section className={style.innerColumn}> <Panel.Section className={style.innerColumn}>
@@ -100,7 +100,7 @@ export default function ProjectData() {
<Panel.Card> <Panel.Card>
<Panel.SubHeader> <Panel.SubHeader>
Project data Project data
<div className={style.headerButtons}> <Panel.InlineElements>
<Button variant='ontime-ghosted' size='sm' onClick={onReset} isDisabled={isSubmitting || !isDirty}> <Button variant='ontime-ghosted' size='sm' onClick={onReset} isDisabled={isSubmitting || !isDirty}>
Revert to saved Revert to saved
</Button> </Button>
@@ -113,7 +113,7 @@ export default function ProjectData() {
> >
Save Save
</Button> </Button>
</div> </Panel.InlineElements>
</Panel.SubHeader> </Panel.SubHeader>
<Panel.Divider /> <Panel.Divider />
<Panel.Section> <Panel.Section>
@@ -45,7 +45,7 @@ export default function ProjectForm({ action, filename, onSubmit, onCancel }: Pr
autoComplete='off' autoComplete='off'
{...register('filename', { required: true })} {...register('filename', { required: true })}
/> />
<div className={style.actionButtons}> <Panel.InlineElements relation='inner'>
<Button onClick={onCancel} size='sm' variant='ontime-ghosted' disabled={isSubmitting}> <Button onClick={onCancel} size='sm' variant='ontime-ghosted' disabled={isSubmitting}>
Cancel Cancel
</Button> </Button>
@@ -58,7 +58,7 @@ export default function ProjectForm({ action, filename, onSubmit, onCancel }: Pr
> >
{action} {action}
</Button> </Button>
</div> </Panel.InlineElements>
</form> </form>
); );
} }
@@ -130,7 +130,7 @@ export default function ProjectListItem({
<> <>
<td className={style.containCell}>{filename}</td> <td className={style.containCell}>{filename}</td>
<td>{current ? 'Currently loaded' : new Date(updatedAt).toLocaleString()}</td> <td>{current ? 'Currently loaded' : new Date(updatedAt).toLocaleString()}</td>
<td className={style.actionButton}> <td>
<ActionMenu <ActionMenu
current={current} current={current}
filename={filename} filename={filename}
@@ -75,7 +75,7 @@ export default function ProjectMergeForm(props: ProjectMergeFromProps) {
<Panel.Section as='form' onSubmit={handleSubmit(handleSubmitCreate)}> <Panel.Section as='form' onSubmit={handleSubmit(handleSubmitCreate)}>
<Panel.Title> <Panel.Title>
Merge {`"${fileName}"`} Merge {`"${fileName}"`}
<div className={style.createActionButtons}> <Panel.InlineElements>
<Button onClick={onClose} variant='ontime-ghosted' size='sm' isDisabled={isSubmitting}> <Button onClick={onClose} variant='ontime-ghosted' size='sm' isDisabled={isSubmitting}>
Cancel Cancel
</Button> </Button>
@@ -88,7 +88,7 @@ export default function ProjectMergeForm(props: ProjectMergeFromProps) {
> >
Merge Merge
</Button> </Button>
</div> </Panel.InlineElements>
</Panel.Title> </Panel.Title>
{error && <Panel.Error>{error}</Panel.Error>} {error && <Panel.Error>{error}</Panel.Error>}
<Panel.Section className={cx([style.innerColumn, style.inlineLabels])}> <Panel.Section className={cx([style.innerColumn, style.inlineLabels])}>
@@ -6,39 +6,18 @@
color: $blue-500; color: $blue-500;
} }
.actionButton {
flex: 1;
text-align: right;
}
.form { .form {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
width: 100%; width: 100%;
gap: 1rem;
} }
.formInput { .formInput {
flex: 2; flex: 2;
} }
.headerButtons,
.actionButtons,
.createActionButtons {
display: flex;
align-items: center;
gap: 1rem;
}
.actionButtons {
margin-left: 1rem;
}
.createActionButtons {
margin-left: 1rem;
justify-content: flex-end;
}
.saveButton { .saveButton {
text-transform: capitalize; text-transform: capitalize;
} }
@@ -62,12 +41,6 @@
} }
} }
.flex {
display: flex;
gap: 1rem;
height: 100px;
}
.uploadLogoCard { .uploadLogoCard {
display: flex; display: flex;
gap: 1rem; gap: 1rem;
@@ -12,8 +12,6 @@ import * as Panel from '../../panel-utils/PanelUtils';
import useGoogleSheet from './useGoogleSheet'; import useGoogleSheet from './useGoogleSheet';
import { useSheetStore } from './useSheetStore'; import { useSheetStore } from './useSheetStore';
import style from './SourcesPanel.module.scss';
interface GSheetSetupProps { interface GSheetSetupProps {
onCancel: () => void; onCancel: () => void;
} }
@@ -176,7 +174,7 @@ export default function GSheetSetup(props: GSheetSetupProps) {
</Panel.ListGroup> </Panel.ListGroup>
{!canAuthenticate ? ( {!canAuthenticate ? (
<Panel.ListGroup> <Panel.ListGroup>
<div className={style.buttonRow}> <Panel.InlineElements>
<Button <Button
variant='ontime-subtle' variant='ontime-subtle'
size='sm' size='sm'
@@ -187,11 +185,11 @@ export default function GSheetSetup(props: GSheetSetupProps) {
> >
Connect Connect
</Button> </Button>
</div> </Panel.InlineElements>
</Panel.ListGroup> </Panel.ListGroup>
) : ( ) : (
<Panel.ListGroup> <Panel.ListGroup>
<div className={style.buttonRow}> <Panel.InlineElements>
{isAuthenticating && <Spinner />} {isAuthenticating && <Spinner />}
<CopyTag copyValue={authKey ?? ''} label='Google Auth Key' disabled={!canAuthenticate} size='sm'> <CopyTag copyValue={authKey ?? ''} label='Google Auth Key' disabled={!canAuthenticate} size='sm'>
{authKey ? authKey : 'Upload files to generate Auth Key'} {authKey ? authKey : 'Upload files to generate Auth Key'}
@@ -205,7 +203,7 @@ export default function GSheetSetup(props: GSheetSetupProps) {
> >
Authenticate Authenticate
</Button> </Button>
</div> </Panel.InlineElements>
</Panel.ListGroup> </Panel.ListGroup>
)} )}
</Panel.Section> </Panel.Section>
@@ -8,8 +8,6 @@ import PreviewSpreadsheet from './preview/PreviewRundown';
import useGoogleSheet from './useGoogleSheet'; import useGoogleSheet from './useGoogleSheet';
import { useSheetStore } from './useSheetStore'; import { useSheetStore } from './useSheetStore';
import style from './SourcesPanel.module.scss';
interface ImportReviewProps { interface ImportReviewProps {
rundown: OntimeRundown; rundown: OntimeRundown;
customFields: CustomFields; customFields: CustomFields;
@@ -40,14 +38,14 @@ export default function ImportReview(props: ImportReviewProps) {
<Panel.Section> <Panel.Section>
<Panel.Title> <Panel.Title>
Review Rundown Review Rundown
<div className={style.buttonRow}> <Panel.InlineElements>
<Button onClick={handleCancel} variant='ontime-ghosted' size='sm' isDisabled={loading}> <Button onClick={handleCancel} variant='ontime-ghosted' size='sm' isDisabled={loading}>
Cancel Cancel
</Button> </Button>
<Button onClick={applyImport} variant='ontime-filled' size='sm' isLoading={loading}> <Button onClick={applyImport} variant='ontime-filled' size='sm' isLoading={loading}>
Apply Apply
</Button> </Button>
</div> </Panel.InlineElements>
</Panel.Title> </Panel.Title>
<PreviewSpreadsheet rundown={rundown} customFields={customFields} /> <PreviewSpreadsheet rundown={rundown} customFields={customFields} />
</Panel.Section> </Panel.Section>
@@ -29,17 +29,6 @@
} }
} }
.buttonRow {
display: flex;
gap: 1rem;
align-items: center;
justify-content: end;
}
.inputContainer {
flex: 1;
}
.singleActionCell { .singleActionCell {
width: 50px; width: 50px;
text-align: center; text-align: center;
@@ -84,7 +84,7 @@ export default function ImportMapForm(props: ImportMapFormProps) {
<Panel.Section as='form' id='import-map'> <Panel.Section as='form' id='import-map'>
<Panel.Title> <Panel.Title>
Import options Import options
<div className={style.buttonRow}> <Panel.InlineElements>
{!isSpreadsheet && ( {!isSpreadsheet && (
<Tooltip label='Revoke the google authentication'> <Tooltip label='Revoke the google authentication'>
<Button variant='ontime-subtle' size='sm' onClick={handleRevoke} isDisabled={isLoading}> <Button variant='ontime-subtle' size='sm' onClick={handleRevoke} isDisabled={isLoading}>
@@ -115,7 +115,7 @@ export default function ImportMapForm(props: ImportMapFormProps) {
> >
Import preview Import preview
</Button> </Button>
</div> </Panel.InlineElements>
</Panel.Title> </Panel.Title>
<Panel.Table> <Panel.Table>
<thead> <thead>
@@ -224,11 +224,11 @@ export default function ImportMapForm(props: ImportMapFormProps) {
})} })}
<tr> <tr>
<td /> <td />
<td className={style.buttonRow} colSpan={99}> <Panel.InlineElements as='td' align='end'>
<Button size='sm' variant='ontime-subtle' rightIcon={<IoAdd />} onClick={addCustomImport}> <Button size='sm' variant='ontime-subtle' rightIcon={<IoAdd />} onClick={addCustomImport}>
Add custom field Add custom field
</Button> </Button>
</td> </Panel.InlineElements>
<td /> <td />
</tr> </tr>
</tbody> </tbody>
@@ -42,8 +42,6 @@ $info-hover: $section-white;
} }
.buttonBar { .buttonBar {
display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 1em;
padding-bottom: 0.5rem; padding-bottom: 0.5rem;
} }
+3 -2
View File
@@ -3,6 +3,7 @@ import { Button } from '@chakra-ui/react';
import { LogOrigin } from 'ontime-types'; import { LogOrigin } from 'ontime-types';
import { clearLogs, useLogData } from '../../common/stores/logger'; import { clearLogs, useLogData } from '../../common/stores/logger';
import * as Panel from '../app-settings/panel-utils/PanelUtils';
import style from './Log.module.scss'; import style from './Log.module.scss';
@@ -49,7 +50,7 @@ export default function Log() {
return ( return (
<> <>
<div className={style.buttonBar}> <Panel.InlineElements className={style.buttonBar}>
<Button <Button
variant={showUser ? 'ontime-filled' : 'ontime-outlined'} variant={showUser ? 'ontime-filled' : 'ontime-outlined'}
size='xs' size='xs'
@@ -107,7 +108,7 @@ export default function Log() {
<Button variant='ontime-subtle' size='xs' onClick={clearLogs}> <Button variant='ontime-subtle' size='xs' onClick={clearLogs}>
Clear Clear
</Button> </Button>
</div> </Panel.InlineElements>
<ul className={style.log}> <ul className={style.log}>
{filteredData.map((logEntry) => ( {filteredData.map((logEntry) => (
<li key={logEntry.id} className={`${style.logEntry} ${style[logEntry.level]} `}> <li key={logEntry.id} className={`${style.logEntry} ${style[logEntry.level]} `}>