From a6683fd2cd7ad3b9c38263d691776e7ba206ee44 Mon Sep 17 00:00:00 2001 From: Carlos Valente Date: Fri, 15 Dec 2023 22:25:26 +0100 Subject: [PATCH] style: small UI suggestion --- .../modals/sheets-modal/SheetsModal.tsx | 183 ++++++++++-------- .../modals/sheets-modal/Step.module.scss | 44 +++++ .../src/features/modals/sheets-modal/Step.tsx | 37 ++++ 3 files changed, 187 insertions(+), 77 deletions(-) create mode 100644 apps/client/src/features/modals/sheets-modal/Step.module.scss create mode 100644 apps/client/src/features/modals/sheets-modal/Step.tsx diff --git a/apps/client/src/features/modals/sheets-modal/SheetsModal.tsx b/apps/client/src/features/modals/sheets-modal/SheetsModal.tsx index 1e3f806ad..bfa3f3780 100644 --- a/apps/client/src/features/modals/sheets-modal/SheetsModal.tsx +++ b/apps/client/src/features/modals/sheets-modal/SheetsModal.tsx @@ -1,9 +1,11 @@ import { ChangeEvent, useEffect, useRef, useState } from 'react'; import { + Alert, + AlertDescription, + AlertIcon, + AlertTitle, Button, Input, - InputGroup, - InputRightAddon, Modal, ModalBody, ModalCloseButton, @@ -13,10 +15,6 @@ import { ModalOverlay, Select, } from '@chakra-ui/react'; -import { IoArrowDownCircleOutline } from '@react-icons/all-files/io5/IoArrowDownCircleOutline'; -import { IoArrowUpCircleOutline } from '@react-icons/all-files/io5/IoArrowUpCircleOutline'; -import { IoCheckmarkCircleOutline } from '@react-icons/all-files/io5/IoCheckmarkCircleOutline'; -import { IoCloseCircleOutline } from '@react-icons/all-files/io5/IoCloseCircleOutline'; import { useQueryClient } from '@tanstack/react-query'; import { OntimeRundown, ProjectData, UserFields } from 'ontime-types'; @@ -34,8 +32,11 @@ import useSheet from '../../../common/hooks-query/useSheet'; import useSheetState from '../../../common/hooks-query/useSheetState'; import { projectDataPlaceholder } from '../../../common/models/ProjectData'; import { userFieldsPlaceholder } from '../../../common/models/UserFields'; +import ModalLink from '../ModalLink'; import PreviewExcel from '../upload-modal/preview/PreviewExcel'; +import Step from './Step'; + interface SheetsModalProps { onClose: () => void; isOpen: boolean; @@ -180,85 +181,113 @@ export default function SheetsModal(props: SheetsModalProps) { > - Sheets! + Rundown from sheets - {rundown && ( + + +
+ Sync with Google Sheets + + Add information here, maybe a link too.
+ The save button is also confusing, can we clarify? should the push data and pull data not be the end + game buttons here? + For more information, see the docs +
+
+
+ {!rundown ? ( + <> + + + + + + + + + + + + + + + + + + +
+ + +
+
+ + ) : ( )} - {!rundown && ( - <> - -
- - {sheetState?.secret ? 'have good secret' : 'no or bad secret'} -
-
- - {sheetState?.auth ? 'You are authenticated' : 'You are not authenticated'} -
-
- - - - - {sheetState?.id ? : } - - -
-
- - -
-
-
- - -
- - )}
diff --git a/apps/client/src/features/modals/sheets-modal/Step.module.scss b/apps/client/src/features/modals/sheets-modal/Step.module.scss new file mode 100644 index 000000000..f761289a9 --- /dev/null +++ b/apps/client/src/features/modals/sheets-modal/Step.module.scss @@ -0,0 +1,44 @@ +@use '../../../theme/ontimeColours' as *; + +.wrapper { + padding: 0.5rem; +} + +.header { + width: 100%; + display: flex; + align-items: center; + gap: 0.5rem; + font-size: 1rem; + padding-bottom: 1rem; +} + +.step { + width: 1.25rem; + height: 1.25rem; + font-size: 0.75rem; + display: grid; + place-content: center; + background-color: $gray-900; + color: $ui-white; + border-radius: 99px; +} + +.title { + display: inline; + color: $gray-500; + text-transform: uppercase; +} + +.check { + color: $green-700; +} + +.errorIcon { + color: $red-700; +} + +.errorText { + color: $red-700; + font-size: 0.75rem; +} diff --git a/apps/client/src/features/modals/sheets-modal/Step.tsx b/apps/client/src/features/modals/sheets-modal/Step.tsx new file mode 100644 index 000000000..db29dd04f --- /dev/null +++ b/apps/client/src/features/modals/sheets-modal/Step.tsx @@ -0,0 +1,37 @@ +import { PropsWithChildren, useState } from 'react'; +import { IoCheckmark } from '@react-icons/all-files/io5/IoCheckmark'; +import { IoClose } from '@react-icons/all-files/io5/IoClose'; + +import style from './Step.module.scss'; + +interface StepProps { + step: number; + title: string; + disabled: boolean; + completed: boolean; + error?: string; +} + +export default function Step(props: PropsWithChildren) { + const { step, title, disabled, completed, error, children } = props; + const [collapsed, setCollapsed] = useState(disabled); + + const handleCollapse = () => setCollapsed((prev) => !prev); + + return ( +
+
+ {step} + {title} + {completed && } + {error && } +
+ {!collapsed && ( + <> + {error &&
{error}
} + {children} + + )} +
+ ); +}