@remit/ui 0.0.26 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -155,6 +155,7 @@ describe("AppShell nav: pane vs slide-over by width (#784)", () => {
|
|
|
155
155
|
it("≥1024px: nav is a persistent pane, no trigger", () => {
|
|
156
156
|
const html = render({ flatList: true, initialWidth: 1100 });
|
|
157
157
|
assert.match(html, navMarker, "nav renders as a pane");
|
|
158
|
+
assert.match(html, /Settings/, "the desktop nav pins a Settings footer");
|
|
158
159
|
assert.doesNotMatch(
|
|
159
160
|
html,
|
|
160
161
|
navTriggerMarker,
|
|
@@ -107,6 +107,43 @@ describe("NavSidebar", () => {
|
|
|
107
107
|
assert.match(html, /text-accent-2/);
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
+
it("pins a Settings footer on the desktop variant", () => {
|
|
111
|
+
const html = renderToString(
|
|
112
|
+
createElement(NavSidebar, {
|
|
113
|
+
accounts,
|
|
114
|
+
selectedNavId: "personal-inbox",
|
|
115
|
+
onSelectNav: () => undefined,
|
|
116
|
+
}),
|
|
117
|
+
);
|
|
118
|
+
assert.match(html, /Settings/);
|
|
119
|
+
assert.match(html, /lucide-settings/);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it("renders the Settings footer as an anchor via linkComponent", () => {
|
|
123
|
+
const html = renderToString(
|
|
124
|
+
createElement(NavSidebar, {
|
|
125
|
+
accounts,
|
|
126
|
+
selectedNavId: "personal-inbox",
|
|
127
|
+
onSelectNav: () => undefined,
|
|
128
|
+
linkComponent: hrefLink,
|
|
129
|
+
}),
|
|
130
|
+
);
|
|
131
|
+
assert.match(html, /<a href="\/mail\/settings"/);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it("omits the Settings footer on the drawer variant", () => {
|
|
135
|
+
const html = renderToString(
|
|
136
|
+
createElement(NavSidebar, {
|
|
137
|
+
accounts,
|
|
138
|
+
selectedNavId: "personal-inbox",
|
|
139
|
+
onSelectNav: () => undefined,
|
|
140
|
+
variant: "drawer",
|
|
141
|
+
}),
|
|
142
|
+
);
|
|
143
|
+
assert.doesNotMatch(html, /Settings/);
|
|
144
|
+
assert.doesNotMatch(html, /lucide-settings/);
|
|
145
|
+
});
|
|
146
|
+
|
|
110
147
|
it("renders navigation entries as anchors via linkComponent", () => {
|
|
111
148
|
const html = renderToString(
|
|
112
149
|
createElement(NavSidebar, {
|
|
@@ -77,6 +77,8 @@ export const Brief: Story = { args: { selectedNavId: "brief" } };
|
|
|
77
77
|
|
|
78
78
|
export const Flagged: Story = { args: { selectedNavId: "flagged" } };
|
|
79
79
|
|
|
80
|
+
export const Settings: Story = { args: { selectedNavId: "settings" } };
|
|
81
|
+
|
|
80
82
|
export const ManyFolders: Story = {
|
|
81
83
|
args: {
|
|
82
84
|
accounts: [manyFoldersAccount],
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
Mails,
|
|
13
13
|
Search,
|
|
14
14
|
Send,
|
|
15
|
+
Settings,
|
|
15
16
|
Sparkles,
|
|
16
17
|
Star,
|
|
17
18
|
Trash2,
|
|
@@ -620,6 +621,17 @@ export function NavSidebar({
|
|
|
620
621
|
starts at the top; the datum bar exists only over the
|
|
621
622
|
list/reading/intelligence panes */}
|
|
622
623
|
{navBody}
|
|
624
|
+
<div className="border-t border-line px-2 py-2">
|
|
625
|
+
<NavItem
|
|
626
|
+
navId="settings"
|
|
627
|
+
linkComponent={linkComponent}
|
|
628
|
+
icon={<Settings className="size-4" />}
|
|
629
|
+
label="Settings"
|
|
630
|
+
ariaLabel="Settings"
|
|
631
|
+
active={selectedNavId === "settings"}
|
|
632
|
+
onClick={() => onSelectNav?.("settings")}
|
|
633
|
+
/>
|
|
634
|
+
</div>
|
|
623
635
|
</aside>
|
|
624
636
|
);
|
|
625
637
|
}
|