Fix Top Header layout following changes in the Shadcn Sidebar;

Fix useMobile breakpoint to 1024px, to match our Tailwind convention for mobile breakpoints (lg)
This commit is contained in:
gbuomprisco
2024-11-21 12:31:16 +08:00
parent afe1ca43cc
commit 977c958975
6 changed files with 20 additions and 10 deletions

View File

@@ -49,13 +49,19 @@ export function HomeMenuNavigation(props: { workspace: UserWorkspace }) {
</div> </div>
<div className={'flex justify-end space-x-2.5'}> <div className={'flex justify-end space-x-2.5'}>
<UserNotifications userId={user.id} />
<If condition={featuresFlagConfig.enableTeamAccounts}> <If condition={featuresFlagConfig.enableTeamAccounts}>
<HomeAccountSelector userId={user.id} accounts={accounts} /> <HomeAccountSelector userId={user.id} accounts={accounts} />
</If> </If>
<UserNotifications userId={user.id} /> <div>
<ProfileAccountDropdownContainer
<ProfileAccountDropdownContainer user={user} account={workspace} /> user={user}
account={workspace}
showProfileName={false}
/>
</div>
</div> </div>
</div> </div>
); );

View File

@@ -48,7 +48,9 @@ export function TeamAccountNavigationMenu(props: {
</BorderedNavigationMenu> </BorderedNavigationMenu>
</div> </div>
<div className={'flex justify-end space-x-2.5'}> <div className={'flex justify-end space-x-2.5 items-center'}>
<TeamAccountNotifications accountId={account.id} userId={user.id} />
<TeamAccountAccountsSelector <TeamAccountAccountsSelector
userId={user.id} userId={user.id}
selectedAccount={account.slug} selectedAccount={account.slug}
@@ -59,9 +61,9 @@ export function TeamAccountNavigationMenu(props: {
}))} }))}
/> />
<TeamAccountNotifications accountId={account.id} userId={user.id} /> <div>
<ProfileAccountDropdownContainer user={user} account={account} showProfileName={false} />
<ProfileAccountDropdownContainer user={user} account={account} /> </div>
</div> </div>
</div> </div>
); );

View File

@@ -19,6 +19,7 @@ const features = {
export function ProfileAccountDropdownContainer(props: { export function ProfileAccountDropdownContainer(props: {
user?: User; user?: User;
showProfileName?: boolean;
account?: { account?: {
id: string | null; id: string | null;
@@ -42,6 +43,7 @@ export function ProfileAccountDropdownContainer(props: {
user={userData} user={userData}
account={props.account} account={props.account}
signOutRequested={() => signOut.mutateAsync()} signOutRequested={() => signOut.mutateAsync()}
showProfileName={props.showProfileName}
/> />
); );
} }

View File

@@ -1,6 +1,6 @@
import * as React from 'react'; import * as React from 'react';
const MOBILE_BREAKPOINT = 768; const MOBILE_BREAKPOINT = 1024;
export function useIsMobile() { export function useIsMobile() {
const [isMobile, setIsMobile] = React.useState<boolean | undefined>( const [isMobile, setIsMobile] = React.useState<boolean | undefined>(

View File

@@ -37,7 +37,7 @@ const RouteGroup = z.object({
}); });
export const NavigationConfigSchema = z.object({ export const NavigationConfigSchema = z.object({
style: z.enum(['custom', 'sidebar', 'header']).default('sidebar'), style: z.enum(['custom', 'sidebar', 'header']).default('header'),
sidebarCollapsed: z sidebarCollapsed: z
.enum(['false', 'true']) .enum(['false', 'true'])
.default('false') .default('false')

View File

@@ -114,7 +114,7 @@ export function PageBody(
export function PageNavigation(props: React.PropsWithChildren) { export function PageNavigation(props: React.PropsWithChildren) {
return ( return (
<div className={'hidden flex-1 bg-inherit lg:flex'}>{props.children}</div> <div className={'flex-1 bg-inherit'}>{props.children}</div>
); );
} }