From c4878b6f662523cc5c1070265b9f973b1288ba49 Mon Sep 17 00:00:00 2001 From: SamTV12345 <40429738+samtv12345@users.noreply.github.com> Date: Fri, 24 May 2024 23:08:04 +0200 Subject: [PATCH] Added icons. --- admin/src/index.css | 42 +++++++++-- admin/src/pages/HelpPage.tsx | 135 ++++++++++++++++++++--------------- 2 files changed, 117 insertions(+), 60 deletions(-) diff --git a/admin/src/index.css b/admin/src/index.css index a7330448e..b3099be8e 100644 --- a/admin/src/index.css +++ b/admin/src/index.css @@ -582,12 +582,45 @@ pre { grid-area: action; } -.help-block { - display: grid; - grid-template-columns: repeat(2, minmax(0, 1fr)); - gap: 20px + +.help-block{ + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 10px; } +.help-block svg { + position: absolute; + width: 40px; + height: 40px; + right: 10px; + top: 25%; + color: var(--etherpad-color); +} + + +.help-block div { + background: white; + gap: 10px; +} + +.help-block > div { + position: relative; + padding: 20px; + box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); + border-radius: 0.375rem; /* 6px */ + +} + + +/* Heading of a card */ +.help-block > div > div:first-child { + font-size: 1.25rem; /* 20px */ + font-weight: 700; + color: #333; +} + + .search-field { position: relative; } @@ -801,3 +834,4 @@ input, button, select, optgroup, textarea { background-color: var(--etherpad-color); color: white } + diff --git a/admin/src/pages/HelpPage.tsx b/admin/src/pages/HelpPage.tsx index dd9695b0a..01150883b 100644 --- a/admin/src/pages/HelpPage.tsx +++ b/admin/src/pages/HelpPage.tsx @@ -2,69 +2,92 @@ import {Trans} from "react-i18next"; import {useStore} from "../store/store.ts"; import {useEffect, useState} from "react"; import {HelpObj} from "./Plugin.ts"; +import {HistoryIcon, ArrowUpFromDotIcon, HashIcon, UnplugIcon, PuzzleIcon, WebhookIcon, LucideWebhook} from 'lucide-react' export const HelpPage = () => { - const settingsSocket = useStore(state=>state.settingsSocket) - const [helpData, setHelpData] = useState(); + const settingsSocket = useStore(state => state.settingsSocket) + const [helpData, setHelpData] = useState(); - useEffect(() => { - if(!settingsSocket) return; - settingsSocket?.on('reply:help', (data) => { - setHelpData(data) - }); + useEffect(() => { + if (!settingsSocket) return; + settingsSocket?.on('reply:help', (data) => { + setHelpData(data) + }); - settingsSocket?.emit('help'); - }, [settingsSocket]); + settingsSocket?.emit('help'); + }, [settingsSocket]); - const renderHooks = (hooks:Record>) => { - return Object.keys(hooks).map((hookName, i) => { - return
-

{hookName}

-
    - {Object.keys(hooks[hookName]).map((hook, i) =>
  • {hook} -
      - {Object.keys(hooks[hookName][hook]).map((subHook, i) =>
    • {subHook}
    • )} -
    -
  • )} -
-
- }) + const renderHooks = (hooks: Record>) => { + return Object.keys(hooks).map((hookName, i) => { + return
+

{hookName}

+
    + {Object.keys(hooks[hookName]).map((hook, i) =>
  • {hook} +
      + {Object.keys(hooks[hookName][hook]).map((subHook, i) =>
    • {subHook}
    • )} +
    +
  • )} +
+
+ }) + } + + + if (!helpData) return
+ + return
+

+
+
+
+ +
+
+ {helpData.epVersion} +
+ +
+
+
+ +
+
{helpData.latestVersion}
+ +
+
+
+ Git sha +
+
+ {helpData.gitCommit} +
+ +
+
+

+
    + {helpData.installedPlugins.map((plugin, i) =>
  • {plugin}
  • )} +
+ +

+
    + {helpData.installedParts.map((part, i) =>
  • {part}
  • )} +
+ +

+ { + renderHooks(helpData.installedServerHooks) } +

+ - if (!helpData) return
- - return
-

-
-
-
{helpData?.epVersion}
-
-
{helpData.latestVersion}
-
Git sha
-
{helpData.gitCommit}
-
-

-
    - {helpData.installedPlugins.map((plugin, i) =>
  • {plugin}
  • )} -
- -

-
    - {helpData.installedParts.map((part, i) =>
  • {part}
  • )} -
- -

- { - renderHooks(helpData.installedServerHooks) - } - -

- - { - renderHooks(helpData.installedClientHooks) - } -

- +

+
+ { + renderHooks(helpData.installedClientHooks) + }
+ +
}