wip
This commit is contained in:
@@ -68,12 +68,12 @@ export function ActiveAccount() {
|
||||
className="h-9 w-9 shrink-0 rounded-lg object-cover"
|
||||
/>
|
||||
<div className="flex flex-col items-start">
|
||||
<p className="max-w-[10rem] truncate text-base font-semibold leading-none text-white">
|
||||
<div className="max-w-[10rem] truncate text-sm font-semibold text-white">
|
||||
{user?.name || user?.display_name || user?.displayName}
|
||||
</p>
|
||||
<span className="max-w-[7rem] truncate text-sm leading-none text-white/50">
|
||||
</div>
|
||||
<div className="max-w-[7rem] truncate text-sm text-white/50">
|
||||
{user?.nip05 || displayNpub(db.account.pubkey, 12)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
<div className="inline-flex divide-x divide-white/5 rounded-lg border-t border-white/5 bg-white/10">
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
import { HTMLProps, ReactNode, useCallback } from 'react';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
import { useStorage } from '@libs/storage/provider';
|
||||
|
||||
export function Frame({
|
||||
children,
|
||||
className,
|
||||
lighter,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
className: HTMLProps<HTMLElement>['className'];
|
||||
lighter?: boolean;
|
||||
}) {
|
||||
const { db } = useStorage();
|
||||
|
||||
const platformStyles = useCallback(() => {
|
||||
switch (db.platform) {
|
||||
case 'darwin':
|
||||
if (lighter) return 'bg-black/80';
|
||||
return 'bg-black/90';
|
||||
default:
|
||||
return 'bg-black';
|
||||
}
|
||||
}, []);
|
||||
|
||||
return <div className={twMerge(className, platformStyles())}>{children}</div>;
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Outlet, ScrollRestoration } from 'react-router-dom';
|
||||
|
||||
import { Frame } from '@shared/frame';
|
||||
import { Navigation } from '@shared/navigation';
|
||||
|
||||
export function AppLayout() {
|
||||
@@ -9,14 +8,14 @@ export function AppLayout() {
|
||||
<div className="shrink-0">
|
||||
<Navigation />
|
||||
</div>
|
||||
<Frame className="h-full w-full flex-1">
|
||||
<div className="h-full w-full flex-1">
|
||||
<Outlet />
|
||||
<ScrollRestoration
|
||||
getKey={(location) => {
|
||||
return location.pathname;
|
||||
}}
|
||||
/>
|
||||
</Frame>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import { Outlet } from 'react-router-dom';
|
||||
|
||||
import { Frame } from '@shared/frame';
|
||||
|
||||
export function AuthLayout() {
|
||||
return (
|
||||
<Frame className="relative h-screen w-screen">
|
||||
<div className="relative h-screen w-screen">
|
||||
<div className="absolute left-0 top-0 z-50 h-16 w-full" data-tauri-drag-region />
|
||||
<Outlet />
|
||||
</Frame>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import { Outlet } from 'react-router-dom';
|
||||
|
||||
import { Frame } from '@shared/frame';
|
||||
|
||||
export function NoteLayout() {
|
||||
return (
|
||||
<Frame className="relative h-screen w-screen">
|
||||
<div className="relative h-screen w-screen">
|
||||
<div className="absolute left-0 top-0 z-50 h-16 w-full" data-tauri-drag-region />
|
||||
<Outlet />
|
||||
</Frame>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { Link, NavLink, Outlet, ScrollRestoration } from 'react-router-dom';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
import { Frame } from '@shared/frame';
|
||||
import { ArrowLeftIcon, SecureIcon, SettingsIcon } from '@shared/icons';
|
||||
|
||||
export function SettingsLayout() {
|
||||
return (
|
||||
<div className="flex h-screen w-screen">
|
||||
<Frame className="relative flex h-full w-[232px] flex-col" lighter>
|
||||
<div className="relative flex h-full w-[232px] flex-col">
|
||||
<div data-tauri-drag-region className="h-11 w-full shrink-0" />
|
||||
<div className="scrollbar-hide flex h-full flex-1 flex-col gap-2 overflow-y-auto pb-32">
|
||||
<div className="inline-flex items-center gap-2 border-l-2 border-transparent pl-4">
|
||||
@@ -56,7 +55,7 @@ export function SettingsLayout() {
|
||||
</NavLink>
|
||||
</div>
|
||||
</div>
|
||||
</Frame>
|
||||
</div>
|
||||
<div className="h-full w-full flex-1 bg-black/90 backdrop-blur-xl">
|
||||
<Outlet />
|
||||
<ScrollRestoration
|
||||
|
||||
@@ -5,7 +5,6 @@ import { useStorage } from '@libs/storage/provider';
|
||||
|
||||
import { ActiveAccount } from '@shared/accounts/active';
|
||||
import { ComposerModal } from '@shared/composer';
|
||||
import { Frame } from '@shared/frame';
|
||||
import {
|
||||
ArrowLeftIcon,
|
||||
ArrowRightIcon,
|
||||
@@ -21,10 +20,7 @@ export function Navigation() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<Frame
|
||||
className="relative flex h-full w-[232px] flex-col border-r border-white/5"
|
||||
lighter
|
||||
>
|
||||
<div className="relative flex h-full w-[232px] flex-col border-r border-white/5">
|
||||
<div
|
||||
data-tauri-drag-region
|
||||
className="inline-flex h-16 w-full items-center justify-between px-3"
|
||||
@@ -147,6 +143,6 @@ export function Navigation() {
|
||||
<div className="relative shrink-0">
|
||||
<ActiveAccount />
|
||||
</div>
|
||||
</Frame>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user