Clean and re-organize post table refactoring (#1000)
* Clean and re-organize post table refactoring * Fix tests
This commit is contained in:
@ -7,7 +7,7 @@ import { useOnboardingStatus } from '@/auth/hooks/useOnboardingStatus';
|
||||
import { OnboardingStatus } from '@/auth/utils/getOnboardingStatus';
|
||||
import { CommandMenu } from '@/command-menu/components/CommandMenu';
|
||||
import { NavbarAnimatedContainer } from '@/ui/navbar/components/NavbarAnimatedContainer';
|
||||
import { MOBILE_VIEWPORT } from '@/ui/themes/themes';
|
||||
import { MOBILE_VIEWPORT } from '@/ui/theme/constants/theme';
|
||||
import { AppNavbar } from '~/AppNavbar';
|
||||
import { CompaniesMockMode } from '~/pages/companies/CompaniesMockMode';
|
||||
|
||||
|
||||
@ -12,6 +12,6 @@ const StyledPanel = styled.div`
|
||||
width: 100%;
|
||||
`;
|
||||
|
||||
export function Panel({ children }: { children: React.ReactNode }) {
|
||||
export function PagePanel({ children }: { children: React.ReactNode }) {
|
||||
return <StyledPanel>{children}</StyledPanel>;
|
||||
}
|
||||
@ -2,7 +2,7 @@ import styled from '@emotion/styled';
|
||||
|
||||
import { RightDrawer } from '@/ui/right-drawer/components/RightDrawer';
|
||||
|
||||
import { Panel } from './Panel';
|
||||
import { PagePanel } from './PagePanel';
|
||||
|
||||
type OwnProps = {
|
||||
children: JSX.Element | JSX.Element[];
|
||||
@ -37,7 +37,7 @@ export function RightDrawerContainer({ children, topMargin }: OwnProps) {
|
||||
return (
|
||||
<StyledMainContainer topMargin={topMargin ?? 0}>
|
||||
<StyledLeftContainer>
|
||||
<Panel>{children}</Panel>
|
||||
<PagePanel>{children}</PagePanel>
|
||||
</StyledLeftContainer>
|
||||
<RightDrawer />
|
||||
</StyledMainContainer>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
import { useIsMobile } from '@/ui/hooks/useIsMobile';
|
||||
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
|
||||
|
||||
export const ShowPageContainer = styled.div`
|
||||
display: flex;
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
import { useIsMobile } from '../../hooks/useIsMobile';
|
||||
import { TopBar } from '../top-bar/components/TopBar';
|
||||
import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile';
|
||||
|
||||
import { PageBar } from '../page-bar/components/PageBar';
|
||||
|
||||
import { RightDrawerContainer } from './RightDrawerContainer';
|
||||
|
||||
@ -23,7 +24,7 @@ export function SubMenuTopBarContainer({ children, title, icon }: OwnProps) {
|
||||
|
||||
return (
|
||||
<StyledContainer isMobile={isMobile}>
|
||||
{isMobile && <TopBar title={title} icon={icon} />}
|
||||
{isMobile && <PageBar title={title} icon={icon} />}
|
||||
<RightDrawerContainer topMargin={16}>{children}</RightDrawerContainer>
|
||||
</StyledContainer>
|
||||
);
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { ReactNode } from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
import { TopBarHotkeys } from '../top-bar/components/TableTopBarHotkeys';
|
||||
import { TOP_BAR_MIN_HEIGHT, TopBar } from '../top-bar/components/TopBar';
|
||||
import { PAGE_BAR_MIN_HEIGHT, PageBar } from '../page-bar/components/PageBar';
|
||||
import { PageBarHotkeys } from '../page-bar/components/PageBarHotkeys';
|
||||
|
||||
import { RightDrawerContainer } from './RightDrawerContainer';
|
||||
|
||||
@ -29,14 +29,14 @@ export function WithTopBarContainer({
|
||||
}: OwnProps) {
|
||||
return (
|
||||
<StyledContainer>
|
||||
<TopBarHotkeys onAddButtonClick={onAddButtonClick} />
|
||||
<TopBar
|
||||
<PageBarHotkeys onAddButtonClick={onAddButtonClick} />
|
||||
<PageBar
|
||||
title={title}
|
||||
hasBackButton={hasBackButton}
|
||||
icon={icon}
|
||||
onAddButtonClick={onAddButtonClick}
|
||||
/>
|
||||
<RightDrawerContainer topMargin={TOP_BAR_MIN_HEIGHT + 16 + 16}>
|
||||
<RightDrawerContainer topMargin={PAGE_BAR_MIN_HEIGHT + 16 + 16}>
|
||||
{children}
|
||||
</RightDrawerContainer>
|
||||
</StyledContainer>
|
||||
|
||||
Reference in New Issue
Block a user