aboutsummaryrefslogtreecommitdiff
path: root/extension/src/components/BMEditor.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'extension/src/components/BMEditor.tsx')
-rw-r--r--extension/src/components/BMEditor.tsx43
1 files changed, 21 insertions, 22 deletions
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 (
<div id="settings-menu" className={activeEdit ? "open" : "closed"}>
@@ -26,28 +23,30 @@ function BMEditor() {
<CloseIcon/>
</button>
- <h1>Edit {isFolder ? "Folder" : "Bookmark"}</h1>
-
- <h3>Name</h3>
- <input type={"text"} defaultValue={activeEdit?.title} onChange={e => {
- getBrowser().bookmarks.update(activeEdit!.id, {title: e.target.value})
- }}/>
+ {activeEdit && (<>
+ <h1>Edit {isFolder ? "Folder" : "Bookmark"}</h1>
- {!isFolder && (<>
- <h3>URL</h3>
- <input type={"url"} defaultValue={activeEdit?.url} onChange={e => {
- getBrowser().bookmarks.update(activeEdit!.id, {url: e.target.value})
+ <h3>Name</h3>
+ <input type={"text"} defaultValue={activeEdit?.title} onChange={e => {
+ getBrowser().bookmarks.update(activeEdit!.id, {title: e.target.value})
}}/>
- </>)}
- <h3>Icon</h3>
- {/*<RadioButtonGroup value={undefined}>*/}
- {iconOptions && iconOptions.map(s =>
- // <option value={s}>
- <img src={s}/>
- // </option>
- )}
- {/*</RadioButtonGroup>*/}
+ {!isFolder && (<>
+ <h3>URL</h3>
+ <input type={"url"} defaultValue={activeEdit?.url} onChange={e => {
+ getBrowser().bookmarks.update(activeEdit!.id, {url: e.target.value})
+ }}/>
+ </>)}
+
+ <h3>Icon</h3>
+ {/*<RadioButtonGroup value={undefined}>*/}
+ {iconOptions && iconOptions.map(s =>
+ // <option value={s}>
+ <img src={s}/>
+ // </option>
+ )}
+ {/*</RadioButtonGroup>*/}
+ </>)}
</div>
);
}