diff --git a/pkgs/webview-ui/app/gtk.webview.js b/pkgs/webview-ui/app/gtk.webview.js index a768e1b5e..e75eecc12 100644 --- a/pkgs/webview-ui/app/gtk.webview.js +++ b/pkgs/webview-ui/app/gtk.webview.js @@ -1,3 +1,12 @@ +/** + * This script generates a custom index.html file for the webview UI. + * It reads the manifest.json file generated by Vite and uses it to generate the HTML file. + * It also processes the CSS files to rewrite the URLs in the CSS files to match the new location of the assets. + * The script is run after the Vite build is complete. + * + * This is necessary because the webview UI is loaded from the local file system and the URLs in the CSS files need to be rewritten to match the new location of the assets. + * The generated index.html file is then used as the entry point for the webview UI. + */ import fs from "node:fs"; import postcss from "postcss"; import path from "node:path"; diff --git a/pkgs/webview-ui/app/src/components/BackButton.tsx b/pkgs/webview-ui/app/src/components/BackButton.tsx index 5db02fb5f..a0072c0a2 100644 --- a/pkgs/webview-ui/app/src/components/BackButton.tsx +++ b/pkgs/webview-ui/app/src/components/BackButton.tsx @@ -6,10 +6,11 @@ export const BackButton = () => { const navigate = useNavigate(); return ( ); }; diff --git a/pkgs/webview-ui/app/src/components/MachineListItem.tsx b/pkgs/webview-ui/app/src/components/MachineListItem.tsx index 832a30edf..00871060d 100644 --- a/pkgs/webview-ui/app/src/components/MachineListItem.tsx +++ b/pkgs/webview-ui/app/src/components/MachineListItem.tsx @@ -106,109 +106,104 @@ export const MachineListItem = (props: MachineListItemProps) => { setUpdating(false); }; return ( -
  • -
    -
    - -
    -
    -
    - -

    - {name} -

    -
    -
    - {(d) => d()?.description} -
    -
    - - {(d) => ( - <> - - {(tags) => ( - - - {(tag) => ( - - )} - - - )} - - {d()?.deploy?.targetHost} - - )} - -
    -
    -
    -
    - } + + {name} + + +
    + {(d) => d()?.description}
    +
    + + {(d) => ( + <> + + {(tags) => ( + + + {(tag) => ( + + )} + + + )} + + {d()?.deploy?.targetHost} + + )} + +
    +
    +
    +
    + }> + +
    -
  • + ); }; diff --git a/pkgs/webview-ui/app/src/components/Sidebar/SidebarHeader.tsx b/pkgs/webview-ui/app/src/components/Sidebar/SidebarHeader.tsx index ecac8e546..0c4d5457b 100644 --- a/pkgs/webview-ui/app/src/components/Sidebar/SidebarHeader.tsx +++ b/pkgs/webview-ui/app/src/components/Sidebar/SidebarHeader.tsx @@ -1,27 +1,20 @@ -import { createSignal, Show } from "solid-js"; - +import { createSignal } from "solid-js"; import { Typography } from "@/src/components/Typography"; import { SidebarFlyout } from "./SidebarFlyout"; +import "./css/sidebar.css"; -interface SidebarHeader { +interface SidebarProps { clanName: string; + showFlyout?: () => boolean; } -export const SidebarHeader = (props: SidebarHeader) => { - const { clanName } = props; - - const [showFlyout, toggleFlyout] = createSignal(false); - - function handleClick() { - toggleFlyout(!showFlyout()); - } - - const renderClanProfile = () => ( +const ClanProfile = (props: SidebarProps) => { + return (
    { color="primary" inverted={true} > - {clanName.slice(0, 1).toUpperCase()} + {props.clanName.slice(0, 1).toUpperCase()}
    ); +}; - const renderClanTitle = () => ( +const ClanTitle = (props: SidebarProps) => { + return ( { color="primary" inverted={true} > - {clanName} + {props.clanName} ); +}; + +export const SidebarHeader = (props: SidebarProps) => { + const [showFlyout, toggleFlyout] = createSignal(false); + + function handleClick() { + toggleFlyout(!showFlyout()); + } return ( diff --git a/pkgs/webview-ui/app/src/components/Sidebar/SidebarListItem.tsx b/pkgs/webview-ui/app/src/components/Sidebar/SidebarListItem.tsx index 189b5cffe..eb0b848b6 100644 --- a/pkgs/webview-ui/app/src/components/Sidebar/SidebarListItem.tsx +++ b/pkgs/webview-ui/app/src/components/Sidebar/SidebarListItem.tsx @@ -14,7 +14,7 @@ export const SidebarListItem = (props: SidebarListItem) => {