Skip to content

Commit

Permalink
fixs
Browse files Browse the repository at this point in the history
  • Loading branch information
OdapX committed Apr 16, 2024
1 parent ef4fbc2 commit c0de2c1
Show file tree
Hide file tree
Showing 5 changed files with 449 additions and 209 deletions.
4 changes: 0 additions & 4 deletions apps/dashboard/components/Layout/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Box, BoxProps } from '@mui/joy';

export const HEADER_HEIGHT = 50;

export default function Header(props: BoxProps) {
return (
<Box
Expand All @@ -21,8 +19,6 @@ export default function Header(props: BoxProps) {
borderBottom: '1px solid',
borderColor: 'divider',
position: 'relative',
height: HEADER_HEIGHT,
maxHeight: HEADER_HEIGHT,
top: 0,
zIndex: 1100,
},
Expand Down
25 changes: 20 additions & 5 deletions apps/dashboard/components/Layout/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ import { appUrl } from '@chaindesk/lib/config';
import { fetcher } from '@chaindesk/lib/swr-fetcher';
import { AppStatus, RouteNames } from '@chaindesk/lib/types';
import { Prisma } from '@chaindesk/prisma';
import DarkModeToggle from '@chaindesk/ui/DarkModeToggle';

import Logo from '../Logo';

function NavigationLink(props: {
href: string;
Expand Down Expand Up @@ -151,9 +154,6 @@ export default function Navigation() {
required: true,
});
const { product } = useProduct();
// const upgradeModal = useModal({
// disableClose: !session?.organization?.isPremium,
// });

const getStatusQuery = useSWR<Prisma.PromiseReturnType<typeof getStatus>>(
'/api/status',
Expand All @@ -178,7 +178,7 @@ export default function Navigation() {
<Link
href={'https://status.chaindesk.ai/'}
target={'_blank'}
className={!open ? 'absolute bottom-[120px]' : ''}
className={!open ? 'absolute bottom-[45px]' : ''}
>
<Chip
color={
Expand Down Expand Up @@ -475,8 +475,23 @@ export default function Navigation() {
animate={open ? 'open' : 'closed'}
variants={animationVariants}
>
<div className="max-h-screen overflow-y-auto">
<div className="max-h-screen overflow-y-auto pl-1 pt-1">
<List size="sm" sx={{ '--ListItem-radius': '8px' }}>
{/* <Stack
direction="row"
width="100%"
gap={1}
justifyContent="space-between"
>
<Stack direction="row" gap={1} justifyItems="center">
<Logo className="w-3 h-3" />
<Typography component="h1" fontWeight="xl">
Chaindesk
</Typography>
</Stack>
<DarkModeToggle variant="plain" color="neutral" />
</Stack> */}

<ListItem nested>
{!!session?.user?.id && (
<Head>
Expand Down
42 changes: 5 additions & 37 deletions apps/dashboard/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import DarkModeToggle from '@chaindesk/ui/DarkModeToggle';
import Logo from '../Logo';
import SEO from '../SEO';

import Header, { HEADER_HEIGHT } from './Header';
import Header from './Header';
import Main from './Main';
import Navigation from './Navigation';
import Root from './Root';
Expand Down Expand Up @@ -151,48 +151,16 @@ export default function Layout(props: Props) {
</Alert>
</Stack>
)}
<Header>
<Box
sx={{
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
gap: 1.5,
}}
>
<IconButton
variant="outlined"
size="sm"
onClick={() => setDrawerOpen(true)}
sx={{ display: { sm: 'none' } }}
>
<MenuIcon />
</IconButton>

<Logo className="w-10" />
<Typography component="h1" fontWeight="xl">
Chaindesk
</Typography>
</Box>

<Box sx={{ display: 'flex', flexDirection: 'row', gap: 1.5 }}>
{/* <Button variant="plain" onClick={shareFeedbackModal.open}>
👋 Share feedback
</Button> */}

<DarkModeToggle />
</Box>
</Header>

<Root
className={mounted ? mode : ''}
sx={{
...(drawerOpen && {
height: `calc(100dvh - ${promoBannerHeight}px - ${HEADER_HEIGHT}px)`,
height: `calc(100dvh - ${promoBannerHeight}px)`,
overflow: 'hidden',
}),
maxHeight: `calc(100dvh - ${promoBannerHeight}px - ${HEADER_HEIGHT}px )`,
minHeight: `calc(100dvh - ${promoBannerHeight}px - ${HEADER_HEIGHT}px)`,
maxHeight: `calc(100dvh - ${promoBannerHeight}px)`,
minHeight: `calc(100dvh - ${promoBannerHeight}px)`,
overflow: 'hidden',
}}
>
Expand All @@ -201,7 +169,7 @@ export default function Layout(props: Props) {

<Main
sx={{
maxHeight: `calc(100dvh - ${promoBannerHeight}px - ${HEADER_HEIGHT}px )`,
maxHeight: `calc(100dvh - ${promoBannerHeight}px )`,
position: 'relative',
width: '100%',
maxWidth: '100%',
Expand Down
5 changes: 3 additions & 2 deletions packages/ui/src/Chatbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,8 @@ function ChatBox({

{!state.isLastMsgInView && (
<Button
variant="outlined"
variant="solid"
color="neutral"
size="sm"
endDecorator={<KeyboardDoubleArrowDownIcon />}
className="absolute bottom-16 right-0 rounded-full z-99"
Expand All @@ -633,7 +634,7 @@ function ChatBox({
})
}
>
To Buttom
Bottom
</Button>
)}

Expand Down
Loading

0 comments on commit c0de2c1

Please sign in to comment.