From 462bc38ebefec31a2b6abaff8ee7d7711eb13280 Mon Sep 17 00:00:00 2001 From: cmaddox5 Date: Thu, 9 Nov 2023 13:19:29 -0500 Subject: [PATCH] Gave page a conditional layout to be used later for navigation. --- .../ConfigureScreensPage.tsx | 77 ++++++++++++++++--- 1 file changed, 68 insertions(+), 9 deletions(-) diff --git a/assets/js/components/Dashboard/PermanentConfiguration/ConfigureScreensPage.tsx b/assets/js/components/Dashboard/PermanentConfiguration/ConfigureScreensPage.tsx index 0f61a8bb..d983aeae 100644 --- a/assets/js/components/Dashboard/PermanentConfiguration/ConfigureScreensPage.tsx +++ b/assets/js/components/Dashboard/PermanentConfiguration/ConfigureScreensPage.tsx @@ -1,13 +1,45 @@ -import React, { ComponentType } from "react"; +import React, { ComponentType, useState } from "react"; import { Col, Container, Row } from "react-bootstrap"; import Appbar from "./AppBar"; import ButtonImage from "./ButtonImage"; import "../../../../css/screenplay.scss"; const ConfigureScreensPage: ComponentType = () => { + const [selectedScreenType, setSelectedScreenType] = useState(); + + const selectScreenType = (screenType: string) => + setSelectedScreenType(screenType); + + console.log(selectedScreenType); + + let layout; + switch (selectedScreenType) { + case "gl-eink": + layout = ; + break; + default: + layout = ( + + ); + } + return (
+ {layout} +
+ ); +}; + +interface SelectScreenTypeComponentProps { + selectScreenType: (screenType: string) => void; +} + +const SelectScreenTypeComponent: ComponentType = + (props: SelectScreenTypeComponentProps) => { + const { selectScreenType } = props; + + return ( @@ -18,29 +50,56 @@ const ConfigureScreensPage: ComponentType = () => { - + selectScreenType("bus-eink")} + /> - + selectScreenType("bus-shelter")} + /> - + selectScreenType("gl-eink")} + /> - + selectScreenType("dup")} + /> - + selectScreenType("pre-fare")} + /> - + selectScreenType("solari")} + /> - - ); + ); + }; + +const GlEinkConfigPage: ComponentType = () => { + return
GL-Eink
; }; export default ConfigureScreensPage;