From 514a33483697ff231c075cbb9130606af19d9298 Mon Sep 17 00:00:00 2001 From: sowgro Date: Tue, 17 Dec 2024 12:47:45 -0500 Subject: Improve BMEditor --- extension/src/components/BMEditor.tsx | 43 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'extension/src/components/BMEditor.tsx') diff --git a/extension/src/components/BMEditor.tsx b/extension/src/components/BMEditor.tsx index 1ac72c6..2579bdb 100644 --- a/extension/src/components/BMEditor.tsx +++ b/extension/src/components/BMEditor.tsx @@ -2,7 +2,6 @@ import React, {useContext, useEffect, useState} from "react"; import CloseIcon from "../assets/close.svg?react" import {ActiveEdit} from "./Body.tsx"; import {getBrowser} from "../main.tsx"; -import RadioButtonGroup from "./RadioButtonGroup.tsx"; function BMEditor() { @@ -17,8 +16,6 @@ function BMEditor() { }); }, [activeEdit]); - if (!activeEdit) return; - let isFolder = activeEdit && activeEdit.children && activeEdit.children.length > 0; return (
@@ -26,28 +23,30 @@ function BMEditor() { -

Edit {isFolder ? "Folder" : "Bookmark"}

- -

Name

- { - getBrowser().bookmarks.update(activeEdit!.id, {title: e.target.value}) - }}/> + {activeEdit && (<> +

Edit {isFolder ? "Folder" : "Bookmark"}

- {!isFolder && (<> -

URL

- { - getBrowser().bookmarks.update(activeEdit!.id, {url: e.target.value}) +

Name

+ { + getBrowser().bookmarks.update(activeEdit!.id, {title: e.target.value}) }}/> - )} -

Icon

- {/**/} - {iconOptions && iconOptions.map(s => - // - )} - {/**/} + {!isFolder && (<> +

URL

+ { + getBrowser().bookmarks.update(activeEdit!.id, {url: e.target.value}) + }}/> + )} + +

Icon

+ {/**/} + {iconOptions && iconOptions.map(s => + // + )} + {/**/} + )}
); } -- cgit v1.2.3