add NavigationButton component, use in settings

This commit is contained in:
marlon-erler
2026-04-10 19:20:47 +00:00
parent 32c58ef041
commit 8ea35bafb2
4 changed files with 64 additions and 25 deletions
+29
View File
@@ -0,0 +1,29 @@
import * as React from "bloatless-react";
import CoreViewModel from "../../ViewModel/Global/coreViewModel";
export function NavigationButton<T>(
coreViewModel: CoreViewModel,
label: string,
navigationState: React.State<T | undefined>,
page: T,
arrowMobileOnly?: boolean,
) {
const isSelected = React.createProxyState(
[navigationState],
() => navigationState.value == page,
);
function open() {
navigationState.value = page;
}
const iconClass = `icon ${arrowMobileOnly == true ? "mobile-only" : ""}`;
return (
<button toggle:selected={isSelected} on:click={open}>
{label}
<span class={iconClass}>arrow_forward</span>
</button>
);
}
+1 -1
View File
@@ -34,7 +34,7 @@
}
.split-modal[navigation] > div,
.split-modal[navigation] > div > .scroll-area{
.split-modal[navigation] > div > .scroll-area {
justify-content: start;
}