From 267b11c9bfcdb9d777da4099997203f4bebb1764 Mon Sep 17 00:00:00 2001 From: Beebles <102569435+beebls@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:17:53 -0600 Subject: fix(motd): run prettier --- frontend/src/components/MotdDisplay.tsx | 84 ++++++++++++++++----------------- frontend/src/components/PluginView.tsx | 2 +- frontend/src/store.ts | 2 +- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/frontend/src/components/MotdDisplay.tsx b/frontend/src/components/MotdDisplay.tsx index 3c651b11..0ad45338 100644 --- a/frontend/src/components/MotdDisplay.tsx +++ b/frontend/src/components/MotdDisplay.tsx @@ -1,36 +1,37 @@ -import {useEffect, useMemo, useState} from 'react' -import { getMotd, Motd } from '../store'; -import { useSetting } from '../utils/hooks/useSetting'; import { DialogButton, Focusable, PanelSection } from '@decky/ui'; +import { useEffect, useMemo, useState } from 'react'; import { FaTimes } from 'react-icons/fa'; +import { Motd, getMotd } from '../store'; +import { useSetting } from '../utils/hooks/useSetting'; + const SEVERITIES = { High: { - color: "#bb1414", - text: "#fff", + color: '#bb1414', + text: '#fff', }, Medium: { - color: "#bbbb14", - text: "#fff", + color: '#bbbb14', + text: '#fff', }, Low: { - color: "#1488bb", - text: "#fff", + color: '#1488bb', + text: '#fff', }, }; const welcomeMotd: Motd = { - id: "welcomeMotd", - name: "Welcome to Decky!", + id: 'welcomeMotd', + name: 'Welcome to Decky!', date: Date.now().toString(), - description: "We hope you enjoy using Decky! If you have any questions or feedback, please let us know.", - severity: "Low", -} + description: 'We hope you enjoy using Decky! If you have any questions or feedback, please let us know.', + severity: 'Low', +}; export function MotdDisplay() { const [motd, setMotd] = useState(null); // showWelcome will display a welcome motd, the welcome motd has an id of "welcome" and once that is saved to hiddenMotdId, it will not show again - const [hiddenMotdId, setHiddenMotdId] = useSetting("hiddenMotdId", "showWelcome") + const [hiddenMotdId, setHiddenMotdId] = useSetting('hiddenMotdId', 'showWelcome'); async function fetchMotd() { const motd = await getMotd(); @@ -38,14 +39,14 @@ export function MotdDisplay() { } useEffect(() => { - void fetchMotd(); - }, []) + void fetchMotd(); + }, []); useEffect(() => { if (hiddenMotdId === 'showWelcome') { setMotd(welcomeMotd); } - }, [hiddenMotdId]) + }, [hiddenMotdId]); function hideMotd() { if (motd) { @@ -62,7 +63,7 @@ export function MotdDisplay() { return null; } - const severity = SEVERITIES[motd?.severity || "Low"]; + const severity = SEVERITIES[motd?.severity || 'Low']; return ( @@ -72,41 +73,40 @@ export function MotdDisplay() { backgroundColor: `${severity.color}33`, color: severity.text, borderColor: severity.color, - borderWidth: "2px", - borderStyle: "solid", - padding: "0.7rem", - display: "flex", - flexDirection: "column", - position: "relative", + borderWidth: '2px', + borderStyle: 'solid', + padding: '0.7rem', + display: 'flex', + flexDirection: 'column', + position: 'relative', }} > -
- {motd?.name} +
+ {motd?.name}
- {motd?.description} + {motd?.description} - ) - -} \ No newline at end of file + ); +} diff --git a/frontend/src/components/PluginView.tsx b/frontend/src/components/PluginView.tsx index 3f72486f..d6f7ff8f 100644 --- a/frontend/src/components/PluginView.tsx +++ b/frontend/src/components/PluginView.tsx @@ -4,10 +4,10 @@ import { useTranslation } from 'react-i18next'; import { FaEyeSlash } from 'react-icons/fa'; import { useDeckyState } from './DeckyState'; +import { MotdDisplay } from './MotdDisplay'; import NotificationBadge from './NotificationBadge'; import { useQuickAccessVisible } from './QuickAccessVisibleState'; import TitleView from './TitleView'; -import { MotdDisplay } from './MotdDisplay'; const PluginView: FC = () => { const { plugins, hiddenPlugins, updates, activePlugin, pluginOrder, setActivePlugin, closeActivePlugin } = diff --git a/frontend/src/store.ts b/frontend/src/store.ts index f3d3addd..e64de8d5 100644 --- a/frontend/src/store.ts +++ b/frontend/src/store.ts @@ -47,7 +47,7 @@ export interface Motd { name: string; description: string; date: string; - severity: "High" | "Medium" | "Low"; + severity: 'High' | 'Medium' | 'Low'; } // name: version -- cgit v1.2.3