From 1d7913aeb728e5ff5552f8895ddfc39178f27bdd Mon Sep 17 00:00:00 2001 From: Timo Date: Mon, 21 Oct 2024 16:05:13 +0200 Subject: [PATCH] ui/sidebar: updates component and introduces new styles (e.g. colors, typograhy) --- .../src/components/Sidebar/SidebarHeader.tsx | 25 +++++++++++++++---- .../components/Sidebar/SidebarListItem.tsx | 5 +++- .../components/Sidebar/css/sidebar-flyout.css | 5 ++-- .../components/Sidebar/css/sidebar-header.css | 5 ++++ .../Sidebar/css/sidebar-profile.css | 4 +++ pkgs/webview-ui/app/src/index.css | 18 ++++++------- 6 files changed, 44 insertions(+), 18 deletions(-) diff --git a/pkgs/webview-ui/app/src/components/Sidebar/SidebarHeader.tsx b/pkgs/webview-ui/app/src/components/Sidebar/SidebarHeader.tsx index 5c4ad0662..8bc0a7be2 100644 --- a/pkgs/webview-ui/app/src/components/Sidebar/SidebarHeader.tsx +++ b/pkgs/webview-ui/app/src/components/Sidebar/SidebarHeader.tsx @@ -1,18 +1,33 @@ -import {SidebarFlyout} from './SidebarFlyout' +import {createSignal} from 'solid-js' + import {Typography} from '@/src/components/Typography' +import {SidebarFlyout} from './SidebarFlyout' interface SidebarHeader { clanName?: string } export const SidebarHeader = (props:SidebarHeader)=>{ - const {clanName} = props + const {clanName} = props; + + const [showFlyout, toggleFlyout] = createSignal(false) + + function handleClick(){ + toggleFlyout(!showFlyout()) + } return } \ No newline at end of file diff --git a/pkgs/webview-ui/app/src/components/Sidebar/SidebarListItem.tsx b/pkgs/webview-ui/app/src/components/Sidebar/SidebarListItem.tsx index ecca66b38..96e380ec3 100644 --- a/pkgs/webview-ui/app/src/components/Sidebar/SidebarListItem.tsx +++ b/pkgs/webview-ui/app/src/components/Sidebar/SidebarListItem.tsx @@ -1,3 +1,5 @@ +import {Typography} from '@/src/components/Typography' + interface SidebarListItem { title:string; delegateClick: () => void; @@ -7,5 +9,6 @@ export const SidebarListItem = (props: SidebarListItem) =>{ const {title} = props; return + {title} + } \ No newline at end of file diff --git a/pkgs/webview-ui/app/src/components/Sidebar/css/sidebar-flyout.css b/pkgs/webview-ui/app/src/components/Sidebar/css/sidebar-flyout.css index f675ab902..a6318033a 100644 --- a/pkgs/webview-ui/app/src/components/Sidebar/css/sidebar-flyout.css +++ b/pkgs/webview-ui/app/src/components/Sidebar/css/sidebar-flyout.css @@ -14,8 +14,7 @@ height: inherit; padding: theme(padding.12) theme(padding.3) theme(padding.3); - background-color: rgba(var(--clr-bg-inv-4)/0.90); - border: 1px solid var(--clr-border-inv-4); - + background-color: rgba(var(--clr-bg-inv-4)/0.95); + border: 1px solid rgb(var(--clr-border-inv-4)); border-radius: theme(borderRadius.lg); } \ No newline at end of file diff --git a/pkgs/webview-ui/app/src/components/Sidebar/css/sidebar-header.css b/pkgs/webview-ui/app/src/components/Sidebar/css/sidebar-header.css index 3e489a0ec..893a4a25e 100644 --- a/pkgs/webview-ui/app/src/components/Sidebar/css/sidebar-header.css +++ b/pkgs/webview-ui/app/src/components/Sidebar/css/sidebar-header.css @@ -1,15 +1,20 @@ .sidebar__header { position: relative; padding: 1px 1px 0; + cursor: pointer; &:after { content: ''; position: absolute; + top: 0; + left: 0; width: 100%; height: 100%; background: rgb(var(--clr-bg-inv-3)); + + border-bottom: 1px solid var(--clr-border-inv-3); border-top-left-radius: theme(borderRadius.xl); border-top-right-radius: theme(borderRadius.xl); } diff --git a/pkgs/webview-ui/app/src/components/Sidebar/css/sidebar-profile.css b/pkgs/webview-ui/app/src/components/Sidebar/css/sidebar-profile.css index 3082b6a67..9c5ffeb94 100644 --- a/pkgs/webview-ui/app/src/components/Sidebar/css/sidebar-profile.css +++ b/pkgs/webview-ui/app/src/components/Sidebar/css/sidebar-profile.css @@ -8,4 +8,8 @@ background: rgb(var(--clr-bg-inv-4)); border-radius: 50%; +} + +.sidebar__profile--flyout{ + background: rgb(var(--clr-bg-def-2)); } \ No newline at end of file diff --git a/pkgs/webview-ui/app/src/index.css b/pkgs/webview-ui/app/src/index.css index 59988df03..e735a6311 100644 --- a/pkgs/webview-ui/app/src/index.css +++ b/pkgs/webview-ui/app/src/index.css @@ -29,11 +29,11 @@ --clr-bg-def-4: theme(colors.clan-secondary.200); --clr-bg-def-5: theme(colors.clan-secondary.300); - --clr-border-def-1: theme(colors.clan-primary.50); - --clr-border-def-2: theme(colors.clan-primary.100); - --clr-border-def-3: theme(colors.clan-primary.200); - --clr-border-def-4: theme(colors.clan-primary.300); - --clr-border-def-5: theme(colors.clan-primary.400); + --clr-border-def-1: theme(colors.clan-secondary.50); + --clr-border-def-2: theme(colors.clan-secondary.100); + --clr-border-def-3: theme(colors.clan-secondary.200); + --clr-border-def-4: theme(colors.clan-secondary.300); + --clr-border-def-5: theme(colors.clan-secondary.400); --clr-bg-inv-1: theme(colors.clan-primary.600); --clr-bg-inv-2: theme(colors.clan-primary.700); @@ -41,10 +41,10 @@ --clr-bg-inv-4: theme(colors.clan-primary.900); --clr-bg-inv-5: theme(colors.clan-primary.950); - --clr-border-inv-1: theme(colors.clan-primary.800); - --clr-border-inv-2: theme(colors.clan-primary.900); - --clr-border-inv-3: theme(colors.clan-primary.900); - --clr-border-inv-4: theme(colors.clan-primary.950); + --clr-border-inv-1: theme(colors.clan-secondary.800); + --clr-border-inv-2: theme(colors.clan-secondary.900); + --clr-border-inv-3: theme(colors.clan-secondary.900); + --clr-border-inv-4: theme(colors.clan-secondary.950); --clr-border-inv-5: theme(colors.black); --clr-bg-inv-acc-1: theme(colors.clan-secondary.500);