style: small presentation tweaks

This commit is contained in:
cv
2023-09-27 15:08:14 +02:00
parent 30905757f3
commit 13d72dd1a4
9 changed files with 96 additions and 43 deletions
@@ -38,6 +38,12 @@
gap: $element-inner-spacing; gap: $element-inner-spacing;
} }
.noHover {
&:hover {
background-color: inherit;
}
}
.title { .title {
font-size: $inner-section-text-size; font-size: $inner-section-text-size;
display: block; display: block;
@@ -107,6 +107,16 @@ $el-padding-with-compensation: 24px; // 16 + 8
color: $error-red; color: $error-red;
} }
.success {
@include subsection;
color: $action-blue;
}
.feedbackSection {
justify-content: flex-start;
}
.buttonSection { .buttonSection {
margin-top: $section-spacing; margin-top: $section-spacing;
display: flex; display: flex;
@@ -117,6 +127,10 @@ $el-padding-with-compensation: 24px; // 16 + 8
flex-grow: 1; flex-grow: 1;
} }
.vSpacer {
height: 2rem;
}
.shiftRight { .shiftRight {
align-self: flex-end; align-self: flex-end;
} }
@@ -135,6 +149,12 @@ $el-padding-with-compensation: 24px; // 16 + 8
grid-template-columns: auto 1fr; grid-template-columns: auto 1fr;
} }
.twoEqualColumn {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1rem;
}
.padBottom { .padBottom {
padding-bottom: $element-spacing; padding-bottom: $element-spacing;
} }
@@ -15,9 +15,10 @@ export default function PreviewExcel(props: PreviewExcelProps) {
const { rundown, project, userFields } = props; const { rundown, project, userFields } = props;
return ( return (
<div className={style.columnSection}> <div className={`${style.column} ${style.noHover}`}>
<div className={style.title}>Review Project Data</div> <div className={style.title}>Review Project Data</div>
<PreviewProjectData project={project} /> <PreviewProjectData project={project} />
<div className={style.vSpacer} />
<div className={style.title}>Review Rundown</div> <div className={style.title}>Review Rundown</div>
<PreviewRundown rundown={rundown} userFields={userFields} /> <PreviewRundown rundown={rundown} userFields={userFields} />
</div> </div>
@@ -79,37 +79,39 @@ export default function PreviewRundown({ rundown, userFields }: PreviewRundownPr
const skip = booleanToText(event.skip); const skip = booleanToText(event.skip);
return ( return (
<tr key={key}> <tr key={key}>
<th> <td className={style.center}>
<Tag>{index + 1}</Tag> <Tag>{index + 1}</Tag>
</th> </td>
<th>Event</th> <td className={style.center}>
<th>{event.cue}</th> <Tag>Event</Tag>
<th>{event.title}</th> </td>
<th>{event.subtitle}</th> <td className={style.nowrap}>{event.cue}</td>
<th>{event.presenter}</th> <td>{event.title}</td>
<th>{event.note}</th> <td>{event.subtitle}</td>
<th>{millisToString(event.timeStart)}</th> <td>{event.presenter}</td>
<th>{millisToString(event.timeEnd)}</th> <td>{event.note}</td>
<th>{millisToString(event.duration)}</th> <td>{millisToString(event.timeStart)}</td>
<th>{isPublic && <Tag>{isPublic}</Tag>}</th> <td>{millisToString(event.timeEnd)}</td>
<th>{skip && <Tag>{skip}</Tag>}</th> <td>{millisToString(event.duration)}</td>
<th style={{ ...colour }}>{event.colour}</th> <td>{isPublic && <Tag>{isPublic}</Tag>}</td>
<th> <td>{skip && <Tag>{skip}</Tag>}</td>
<td style={{ ...colour }}>{event.colour}</td>
<td>
<Tag>{event.timerType}</Tag> <Tag>{event.timerType}</Tag>
</th> </td>
<th> <td>
<Tag>{event.endAction}</Tag> <Tag>{event.endAction}</Tag>
</th> </td>
<th>{event.user0}</th> <td>{event.user0}</td>
<th>{event.user1}</th> <td>{event.user1}</td>
<th>{event.user2}</th> <td>{event.user2}</td>
<th>{event.user3}</th> <td>{event.user3}</td>
<th>{event.user4}</th> <td>{event.user4}</td>
<th>{event.user5}</th> <td>{event.user5}</td>
<th>{event.user6}</th> <td>{event.user6}</td>
<th>{event.user7}</th> <td>{event.user7}</td>
<th>{event.user8}</th> <td>{event.user8}</td>
<th>{event.user9}</th> <td>{event.user9}</td>
</tr> </tr>
); );
} }
@@ -42,4 +42,19 @@
tr:nth-child(odd) { tr:nth-child(odd) {
background-color: $gray-50; background-color: $gray-50;
} }
td {
text-align: left;
vertical-align: top;
padding: 0 0.5em;
}
.center {
text-align: center;
}
.nowrap {
white-space: nowrap;
}
} }
@@ -21,10 +21,10 @@ export default function UploadEntry(props: UploadEntryProps) {
if (errors) { if (errors) {
return ( return (
<div className={`${style.uploadedItem} ${style.error}`}> <div className={`${style.uploadedItem} ${style.error}`}>
<IoClose className={style.cancelUpload} onClick={handleClear} />
<IoWarningOutline className={style.icon} /> <IoWarningOutline className={style.icon} />
<span className={style.fileTitle}>{errors}</span> <span className={style.fileTitle}>{errors}</span>
<span className={style.fileInfo}>Please try again</span> <span className={style.fileInfo}>Please try again</span>
<Progress className={style.fileProgress} value={progress} />
</div> </div>
); );
} }
@@ -1,10 +1,8 @@
import { MutableRefObject } from 'react'; import { MutableRefObject } from 'react';
import { Input } from '@chakra-ui/react';
import ModalSplitInput from '../../ModalSplitInput'; import { ExcelInputOptions } from '../UploadModal';
import ImportMapTable, { type TableEntry } from './ImportMapTable'; import ImportMapTable, { type TableEntry } from './ImportMapTable';
import { ExcelInputOptions } from '../UploadModal';
import style from '../UploadModal.module.scss'; import style from '../UploadModal.module.scss';
@@ -60,16 +58,16 @@ export default function ExcelFileOptions(props: ExcelFileOptionsProps) {
return ( return (
<div className={style.uploadOptions}> <div className={style.uploadOptions}>
<div className={style.twoColumn}> <div className={style.twoEqualColumn}>
<ImportMapTable title='Import options' fields={worksheet} handleOnChange={updateRef} /> <ImportMapTable title='Import options' fields={worksheet} handleOnChange={updateRef} />
</div> </div>
<div className={style.twoColumn}> <div className={style.twoEqualColumn}>
<ImportMapTable title='Timings' fields={timings} handleOnChange={updateRef} /> <ImportMapTable title='Timings' fields={timings} handleOnChange={updateRef} />
<ImportMapTable title='Options' fields={options} handleOnChange={updateRef} /> <ImportMapTable title='Options' fields={options} handleOnChange={updateRef} />
</div> </div>
<div className={style.twoColumn}> <div className={style.twoEqualColumn}>
<ImportMapTable title='Titles' fields={titles} handleOnChange={updateRef} /> <ImportMapTable title='Titles' fields={titles} handleOnChange={updateRef} />
<ImportMapTable title='User Fields' fields={userFields} handleOnChange={updateRef} /> <ImportMapTable title='User Fields' fields={userFields} handleOnChange={updateRef} />
</div> </div>
@@ -3,20 +3,31 @@
.importTable { .importTable {
margin: 0.5rem; margin: 0.5rem;
font-size: $inner-section-text-size;
height: fit-content; height: fit-content;
thead { thead {
color: $gray-500; color: $gray-500;
text-transform: uppercase; text-transform: uppercase;
width: 10em;
} }
tr:hover { tr:hover {
background-color: $gray-50; background-color: $gray-50;
} }
tbody {
td {
max-width: fit-content;
}
}
} }
.label { .label {
display: inline-block; display: inline-block;
min-width: 6em;
font-size: $inner-section-text-size;
}
.input {
width: 100%; width: 100%;
} }
@@ -19,18 +19,18 @@ export default function ImportMapTable(props: ImportMapTableProps) {
return ( return (
<table className={style.importTable}> <table className={style.importTable}>
<thead> <thead>
<tr>{title}</tr> <tr>
<td colSpan={2}>{title}</td>
</tr>
</thead> </thead>
<tbody> <tbody>
{fields.map((field) => { {fields.map((field) => {
return ( return (
<tr key={field.title}> <tr key={field.title}>
<td> <td className={style.label}>
<label className={style.label} htmlFor={field.title}> <label htmlFor={field.title}>{field.title}</label>
{field.title}
</label>
</td> </td>
<td> <td className={style.input}>
<Input <Input
id={field.title} id={field.title}
size='xs' size='xs'