From 18f2cf304715179271eeb28b3aa0258b2feb159c Mon Sep 17 00:00:00 2001 From: georg-stone Date: Thu, 2 Jan 2025 00:09:54 -0500 Subject: [PATCH] add items hidden mode --- apps/new-tab/src/App.tsx | 169 +++++++++++++++++++--------------- apps/new-tab/src/Settings.tsx | 6 +- 2 files changed, 99 insertions(+), 76 deletions(-) diff --git a/apps/new-tab/src/App.tsx b/apps/new-tab/src/App.tsx index a7c2c6f..ebafd8d 100644 --- a/apps/new-tab/src/App.tsx +++ b/apps/new-tab/src/App.tsx @@ -6,9 +6,12 @@ import { Bookmark, Check, Clock, + Eye, + EyeOff, Grid, GripVertical, Key, + Menu, Plus, Settings, X, @@ -170,6 +173,10 @@ const App: Component = () => { "wallpaperBlur", 0 ); + const [itemsHidden, setItemsHidden] = createStoredSignal( + "itemsHidden", + "false" + ); onMount(() => { if (chrome.bookmarks !== undefined) { chrome.bookmarks.getTree((bookmarkTreeNodes) => { @@ -528,6 +535,7 @@ const App: Component = () => { style={{ "align-content": layout() == "center" ? "center" : "flex-start", "padding-top": layout() == "top" ? "2.5rem" : "0", + display: itemsHidden() == "true" ? "none" : "", }} > {mode() === "widgets" && ( @@ -697,79 +705,94 @@ const App: Component = () => { )} -
- - {mode() === "widgets" && ( - - - - - - - {chrome.i18n.getMessage("blocks")} - - {chrome.i18n.getMessage("blocks_description")} - -
- - - - - - - - - - -
-
-
- )} +
+ + + +
diff --git a/apps/new-tab/src/Settings.tsx b/apps/new-tab/src/Settings.tsx index 45d1606..ea0c3f4 100644 --- a/apps/new-tab/src/Settings.tsx +++ b/apps/new-tab/src/Settings.tsx @@ -21,7 +21,7 @@ import { cn } from "./libs/cn"; import { TextField, TextFieldRoot } from "./components/ui/textfield"; import { Button } from "./components/ui/button"; -function SettingsTrigger() { +function SettingsTrigger({ className }: { className?: string }) { function textToImage(text: string) { const canvas = document.createElement("canvas"); const ctx: any = canvas.getContext("2d"); @@ -52,7 +52,7 @@ function SettingsTrigger() { return canvas.toDataURL(); } - const [open, setOpen] = createSignal(true); + const [open, setOpen] = createSignal(false); const [font, setFont] = createStoredSignal("font", "sans"); const [theme, setTheme] = createStoredSignal("kb-color-mode", "system"); const [background, setBackground] = createStoredSignal("background", "image"); @@ -463,7 +463,7 @@ function SettingsTrigger() { } return ( -
+