Skip to content

Commit

Permalink
Cleaning up document layout
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvicenti committed Jul 26, 2024
1 parent 46fbf2c commit 3ae852c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
8 changes: 2 additions & 6 deletions frontend/apps/desktop/src/components/accessory-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,8 @@ export function AccessoryLayout<
return (
<XStack f={1}>
<PanelGroup direction="horizontal">
<Panel minSize={50}>
<XStack>
<YStack f={1}>{children}</YStack>
</XStack>
</Panel>
<PanelResizeHandle style={{width: 4}} />
<Panel minSize={50}>{children}</Panel>
<PanelResizeHandle />
<Panel
hidden={accessoryKey === undefined}
maxSize={50}
Expand Down
5 changes: 1 addition & 4 deletions frontend/apps/desktop/src/pages/document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Footer from '@/components/footer'
import {FormInput} from '@/components/form-input'
import {FormField} from '@/components/forms'
import {ListItem} from '@/components/list-item'
import {MainWrapperNoScroll} from '@/components/main-wrapper'
import {useMyAccountIds} from '@/models/daemon'
import {useEntity} from '@/models/entities'
import {getFileUrl} from '@/utils/account-url'
Expand Down Expand Up @@ -154,9 +153,7 @@ export default function DocumentPage() {
}}
accessoryOptions={accessoryOptions}
>
<MainWrapperNoScroll>
<MainDocumentPage />
</MainWrapperNoScroll>
<MainDocumentPage />
</AccessoryLayout>
<Footer></Footer>
</>
Expand Down
13 changes: 6 additions & 7 deletions frontend/packages/ui/src/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import {forwardRef} from 'react'
import {ScrollView, YStack, YStackProps} from 'tamagui'
import {forwardRef} from "react";
import {ScrollView, YStack, YStackProps} from "tamagui";

export const MainWrapper = forwardRef(function MainWrapper(
{
children,
noScroll = false,
...props
}: YStackProps & {
noScroll?: boolean
noScroll?: boolean;
},
ref,
ref
) {
return (
// @ts-expect-error
<YStack flex={1} className="content-wrapper" {...props} ref={ref}>
{noScroll ? (
children
Expand All @@ -21,5 +20,5 @@ export const MainWrapper = forwardRef(function MainWrapper(
<ScrollView id="scroll-page-wrapper">{children}</ScrollView>
)}
</YStack>
)
})
);
});

0 comments on commit 3ae852c

Please sign in to comment.