Skip to content
Merged

fix #30

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,7 @@ function Sidebar(props: {
<h2>{t("feeds")}</h2>
<MenuButton
label={t("addFeed")}
align="left"
icon={<Plus size={16} aria-hidden />}
items={[
{ label: t("addFeed"), action: () => props.onModal({ type: "feedEditor" }) },
Expand All @@ -715,6 +716,7 @@ function Sidebar(props: {
/>
<MenuButton
label={t("feeds")}
align="left"
items={[
{ label: t("syncNow"), action: () => void props.onSync().catch(() => undefined) },
{ label: t("exportOpml"), action: () => undefined, disabled: true }
Expand Down Expand Up @@ -2224,6 +2226,7 @@ function SimpleFlow(props: {

function MenuButton(props: {
label: string;
align?: "left" | "right";
icon?: React.ReactNode;
items: Array<{ label: string; action: () => void; disabled?: boolean; destructive?: boolean }>;
}) {
Expand All @@ -2234,7 +2237,7 @@ function MenuButton(props: {
{props.icon ?? <MoreHorizontal size={17} aria-hidden />}
</button>
{open && (
<div className="menu-popover">
<div className={`menu-popover align-${props.align ?? "right"}`}>
{props.items.map((item) => (
<button
key={item.label}
Expand Down
9 changes: 8 additions & 1 deletion packages/ui/src/styles/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,6 @@ textarea {
position: absolute;
z-index: 30;
top: 34px;
right: 0;
display: flex;
flex-direction: column;
min-width: 210px;
Expand All @@ -904,6 +903,14 @@ textarea {
background: var(--color-surface);
}

.menu-popover.align-right {
right: 0;
}

.menu-popover.align-left {
left: 0;
}

.menu-popover button {
justify-content: flex-start;
border: 0;
Expand Down
Loading