From c868e8287780b1318193b1fc066d43c64fc34d5b Mon Sep 17 00:00:00 2001 From: Savanni D'Gerinel Date: Wed, 21 Aug 2024 00:05:25 -0400 Subject: [PATCH] Fix warnings --- gm-dash/ui/src/Dashboard.tsx | 35 ++++--------------- .../ui/src/components/Launchpad/Launchpad.css | 5 ++- .../ui/src/components/Launchpad/Launchpad.tsx | 19 +++++----- 3 files changed, 18 insertions(+), 41 deletions(-) diff --git a/gm-dash/ui/src/Dashboard.tsx b/gm-dash/ui/src/Dashboard.tsx index efc2d1c..115be48 100644 --- a/gm-dash/ui/src/Dashboard.tsx +++ b/gm-dash/ui/src/Dashboard.tsx @@ -1,10 +1,9 @@ import './Dashboard.css'; -import Card from './components/Card/Card'; -import Launcher from './components/Launcher/Launcher'; import Launchpad from './components/Launchpad/Launchpad'; -const LightThemes = () => +const LightThemes = () => { title: "Darkness" }, ]} /> - -const LightSetup = () =>
- -interface LightProps { - name: string, -} - -const Light = ({ name }: LightProps) =>

{name}

- -const Tracks = () => +const Tracks = () => { title: "Water dripping" }, ]} /> - -interface TrackProps { - name: string, -} -const Track = ({ name }: TrackProps) => - -const Presets = () => +const Presets = () => { title: "Surk colony" }, ]} /> - - -interface PresetProps { - name: string -} - -// const Scene = ({ name }: PresetProps) => - -const SceneEditor = () =>
const Dashboard = () => { return ( diff --git a/gm-dash/ui/src/components/Launchpad/Launchpad.css b/gm-dash/ui/src/components/Launchpad/Launchpad.css index a952b0b..4169e82 100644 --- a/gm-dash/ui/src/components/Launchpad/Launchpad.css +++ b/gm-dash/ui/src/components/Launchpad/Launchpad.css @@ -1,11 +1,14 @@ .launchpad { - display: flex; border: var(--border); border-radius: var(--border-radius); box-shadow: var(--shadow-depression); margin: var(--spacer-l); } +.launchpad__title { + color: var(--title-color); +} + .launchpad_horizontal-flow { display: flex; flex-direction: row; diff --git a/gm-dash/ui/src/components/Launchpad/Launchpad.tsx b/gm-dash/ui/src/components/Launchpad/Launchpad.tsx index 0035069..55d3488 100644 --- a/gm-dash/ui/src/components/Launchpad/Launchpad.tsx +++ b/gm-dash/ui/src/components/Launchpad/Launchpad.tsx @@ -1,7 +1,6 @@ import React from 'react'; import './Launchpad.css'; import Launcher, { LauncherProps } from '../Launcher/Launcher'; -import classnames from 'classnames'; export interface Selectable { onSelected?: (key: string) => void; @@ -10,6 +9,7 @@ export interface Selectable { export type Flow = "horizontal" | "vertical"; interface LaunchpadProps { + title?: string; exclusive: boolean; flow?: Flow; options: Array; @@ -28,22 +28,19 @@ const multiSelect = (state: { [key: string]: boolean }, targetId: string) => { } } -const Launchpad = ({ flow = "horizontal", options, exclusive }: LaunchpadProps) => { +const Launchpad = ({ title, flow = "horizontal", options, exclusive }: LaunchpadProps) => { const [selected, dispatch] = React.useReducer(exclusive ? exclusiveSelect : multiSelect, {}); - let classOptions = [ "launchpad" ]; - - if (flow === "horizontal") { - classOptions.push("launchpad_horizontal-flow"); - } else { - classOptions.push("launchpad_vertical-flow"); - } - let tiedOptions = options.map(option => dispatch(key)} activated={selected[option.title]} /> ); - return (
{tiedOptions}
) + return (
+ {title &&

{title}

} +
+ {tiedOptions} +
+
) } export default Launchpad;