Skip to content

Commit 5f47343

Browse files
committed
[frontend] add bookmarks strip
1 parent 7c77a20 commit 5f47343

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

frontend/src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { ThemeVars } from "./theme";
55
import { config } from "./Browser";
66
import { browser } from "./main";
77
import type { Tab } from "./Tab";
8+
import { BookmarksStrip } from "./components/BookmarksStrip";
89

910
export const App: Component = function (cx) {
1011
return (
@@ -21,6 +22,7 @@ export const App: Component = function (cx) {
2122
}}
2223
/>
2324
<Omnibox tab={use(browser.activetab)} />
25+
<BookmarksStrip />
2426
{cx.children}
2527
</div>
2628
);
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import { css, type Component } from "dreamland/core";
2+
import { Icon } from "./Icon";
3+
import iconAdd from "@ktibow/iconset-ion/add";
4+
import { browser } from "../main";
5+
6+
export const BookmarksStrip: Component = function () {
7+
return (
8+
<div>
9+
<button on:click={() => {}}>
10+
<Icon icon={iconAdd}></Icon>
11+
<span>create bookmark</span>
12+
</button>
13+
{use(browser.globalhistory).mapEach((g) => (
14+
<button on:click={() => {}}>
15+
<img src={g.favicon}></img>
16+
<span>{g.title}</span>
17+
</button>
18+
))}
19+
</div>
20+
);
21+
};
22+
BookmarksStrip.style = css`
23+
:scope {
24+
padding: 0.25em;
25+
height: 2em;
26+
display: flex;
27+
gap: 0.5em;
28+
background: var(--aboutbrowser-omnibox-bg);
29+
}
30+
31+
button {
32+
padding: 0;
33+
border: 0;
34+
display: flex;
35+
align-items: center;
36+
height: 100%;
37+
gap: 0.25em;
38+
39+
padding-left: 0.25em;
40+
padding-right: 0.25em;
41+
background: none;
42+
border-radius: 0.5em;
43+
}
44+
button:hover {
45+
background: gray;
46+
}
47+
button span {
48+
white-space: nowrap;
49+
}
50+
51+
button img {
52+
width: 16px;
53+
height: 16px;
54+
}
55+
`;

frontend/src/components/TabStrip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ DragTab.style = css`
148148
149149
.tooltip {
150150
position: absolute;
151-
top: 5em;
151+
top: 2.25em;
152152
left: 0;
153153
z-index: 1000;
154154
background: var(--aboutbrowser-frame-bg);

0 commit comments

Comments
 (0)