mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-10-09 20:33:03 +02:00
Add option to hide noStrudel logo in nav bar
This commit is contained in:
5
.changeset/giant-beans-pull.md
Normal file
5
.changeset/giant-beans-pull.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"nostrudel": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Add option to hide noStrudel logo in nav bar
|
@@ -13,6 +13,7 @@ import { offlineMode } from "../../services/offline-mode";
|
|||||||
import WifiOff from "../icons/wifi-off";
|
import WifiOff from "../icons/wifi-off";
|
||||||
import { useTaskManagerContext } from "../../views/task-manager/provider";
|
import { useTaskManagerContext } from "../../views/task-manager/provider";
|
||||||
import TaskManagerButtons from "./task-manager-buttons";
|
import TaskManagerButtons from "./task-manager-buttons";
|
||||||
|
import localSettings from "../../services/local-settings";
|
||||||
|
|
||||||
const hideScrollbar = css`
|
const hideScrollbar = css`
|
||||||
-ms-overflow-style: none;
|
-ms-overflow-style: none;
|
||||||
@@ -26,6 +27,7 @@ export default function DesktopSideNav(props: Omit<FlexProps, "children">) {
|
|||||||
const account = useCurrentAccount();
|
const account = useCurrentAccount();
|
||||||
const { openModal } = useContext(PostModalContext);
|
const { openModal } = useContext(PostModalContext);
|
||||||
const offline = useSubject(offlineMode);
|
const offline = useSubject(offlineMode);
|
||||||
|
const showBrandLogo = useSubject(localSettings.showBrandLogo);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
@@ -42,22 +44,24 @@ export default function DesktopSideNav(props: Omit<FlexProps, "children">) {
|
|||||||
css={hideScrollbar}
|
css={hideScrollbar}
|
||||||
>
|
>
|
||||||
<Flex direction="column" flexShrink={0} gap="2">
|
<Flex direction="column" flexShrink={0} gap="2">
|
||||||
<Flex gap="2" alignItems="center" position="relative" my="2">
|
{showBrandLogo && (
|
||||||
<Avatar src="/apple-touch-icon.png" size="md" />
|
<Flex gap="2" alignItems="center" position="relative" my="2">
|
||||||
<Heading size="md">
|
<Avatar src="/apple-touch-icon.png" size="md" />
|
||||||
<LinkOverlay as={RouterLink} to="/">
|
<Heading size="md">
|
||||||
noStrudel
|
<LinkOverlay as={RouterLink} to="/">
|
||||||
</LinkOverlay>
|
noStrudel
|
||||||
</Heading>
|
</LinkOverlay>
|
||||||
{offline && (
|
</Heading>
|
||||||
<IconButton
|
{offline && (
|
||||||
aria-label="Disable offline mode"
|
<IconButton
|
||||||
title="Disable offline mode"
|
aria-label="Disable offline mode"
|
||||||
icon={<WifiOff boxSize={5} color="orange" />}
|
title="Disable offline mode"
|
||||||
onClick={() => offlineMode.next(false)}
|
icon={<WifiOff boxSize={5} color="orange" />}
|
||||||
/>
|
onClick={() => offlineMode.next(false)}
|
||||||
)}
|
/>
|
||||||
</Flex>
|
)}
|
||||||
|
</Flex>
|
||||||
|
)}
|
||||||
{account && (
|
{account && (
|
||||||
<>
|
<>
|
||||||
<AccountSwitcher />
|
<AccountSwitcher />
|
||||||
|
@@ -51,6 +51,9 @@ const addClientTag = new BooleanLocalStorageEntry("add-client-tag", false);
|
|||||||
const verifyEventMethod = new LocalStorageEntry("verify-event-method", "wasm"); // wasm, internal, none
|
const verifyEventMethod = new LocalStorageEntry("verify-event-method", "wasm"); // wasm, internal, none
|
||||||
const enableKeyboardShortcuts = new BooleanLocalStorageEntry("enable-keyboard-shortcuts", true);
|
const enableKeyboardShortcuts = new BooleanLocalStorageEntry("enable-keyboard-shortcuts", true);
|
||||||
|
|
||||||
|
// display settings
|
||||||
|
const showBrandLogo = new BooleanLocalStorageEntry("show-brand-logo", true);
|
||||||
|
|
||||||
const localSettings = {
|
const localSettings = {
|
||||||
idbMaxEvents,
|
idbMaxEvents,
|
||||||
wasmPersistForDays,
|
wasmPersistForDays,
|
||||||
@@ -62,6 +65,7 @@ const localSettings = {
|
|||||||
addClientTag,
|
addClientTag,
|
||||||
verifyEventMethod,
|
verifyEventMethod,
|
||||||
enableKeyboardShortcuts,
|
enableKeyboardShortcuts,
|
||||||
|
showBrandLogo,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (import.meta.env.DEV) {
|
if (import.meta.env.DEV) {
|
||||||
|
@@ -23,6 +23,7 @@ export default function DisplaySettings() {
|
|||||||
|
|
||||||
const hideZapBubbles = useSubject(localSettings.hideZapBubbles);
|
const hideZapBubbles = useSubject(localSettings.hideZapBubbles);
|
||||||
const enableNoteDrawer = useSubject(localSettings.enableNoteThreadDrawer);
|
const enableNoteDrawer = useSubject(localSettings.enableNoteThreadDrawer);
|
||||||
|
const showBrandLogo = useSubject(localSettings.showBrandLogo);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<VerticalPageLayout flex={1}>
|
<VerticalPageLayout flex={1}>
|
||||||
@@ -165,6 +166,21 @@ export default function DisplaySettings() {
|
|||||||
<span>Enabled: Clicking on an embedded note will open it in a side drawer</span>
|
<span>Enabled: Clicking on an embedded note will open it in a side drawer</span>
|
||||||
</FormHelperText>
|
</FormHelperText>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
<FormControl>
|
||||||
|
<Flex alignItems="center">
|
||||||
|
<FormLabel htmlFor="showBrandLogo" mb="0">
|
||||||
|
Show noStrudel logo
|
||||||
|
</FormLabel>
|
||||||
|
<Switch
|
||||||
|
id="showBrandLogo"
|
||||||
|
isChecked={showBrandLogo}
|
||||||
|
onChange={(e) => localSettings.showBrandLogo.next(e.currentTarget.checked)}
|
||||||
|
/>
|
||||||
|
</Flex>
|
||||||
|
<FormHelperText>
|
||||||
|
<span>Show / Hide the noStrudel logo in the side nav</span>
|
||||||
|
</FormHelperText>
|
||||||
|
</FormControl>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<FormLabel htmlFor="muted-words" mb="0">
|
<FormLabel htmlFor="muted-words" mb="0">
|
||||||
Muted words
|
Muted words
|
||||||
|
Reference in New Issue
Block a user