File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ import { ChartSizeCommentCorrelation } from "./components/chart-size-comment-cor
3333import { TableTeamOverview } from "./components/table-team-overview" ;
3434import { TableReviewDistribution } from "./components/table-review-distribution" ;
3535import { useCodeReviewEfficiencyPage } from "./useCodeReviewEfficiencyPage" ;
36+ import { useLargerPageContainer } from "../../../providers/page.provider" ;
3637
3738export const CodeReviewEfficiencyPage = ( ) => {
3839 const {
@@ -46,9 +47,10 @@ export const CodeReviewEfficiencyPage = () => {
4647 reviewers,
4748 handleColumnClick,
4849 } = useCodeReviewEfficiencyPage ( ) ;
50+ useLargerPageContainer ( "lg" ) ;
4951
5052 return (
51- < PageContainer size = "lg" >
53+ < PageContainer >
5254 < Breadcrumbs items = { [ { label : "Metrics & Insights" } ] } />
5355
5456 < Group gap = { 5 } >
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import { ChartSizeCycleCorrelation } from "./components/chart-size-cycle-correla
2828import { ChartThroughput } from "./components/chart-throughput" ;
2929import { TableTeamOverview } from "./components/table-team-overview" ;
3030import { usePrFlowPage } from "./usePrFlowPage" ;
31+ import { useLargerPageContainer } from "../../../providers/page.provider" ;
3132
3233export const PrFlowPage = ( ) => {
3334 const {
@@ -39,8 +40,10 @@ export const PrFlowPage = () => {
3940 handleThroughputClick,
4041 } = usePrFlowPage ( ) ;
4142
43+ useLargerPageContainer ( "lg" ) ;
44+
4245 return (
43- < PageContainer size = "lg" >
46+ < PageContainer >
4447 < Breadcrumbs items = { [ { label : "Metrics & Insights" } ] } />
4548
4649 < Group gap = { 5 } >
Original file line number Diff line number Diff line change @@ -24,15 +24,16 @@ export const AppPage = ({ children }: AppProps) => {
2424 if ( shouldShowPaywall && ! isSandbox ) {
2525 showPaywallNotification ( ) ;
2626 goToPaywall ( ) ;
27-
28- return < > </ > ;
2927 }
3028
3129 return (
3230 < >
3331 { isSandbox && < SandboxBanner /> }
3432 { workspace && < AppSpotlight workspaceId = { workspace . id } /> }
35- < AppShell key = { workspace ?. id } topOffset = { isSandbox ? SANDBOX_BANNER_HEIGHT : 0 } >
33+ < AppShell
34+ key = { workspace ?. id }
35+ topOffset = { isSandbox ? SANDBOX_BANNER_HEIGHT : 0 }
36+ >
3637 { children ? children : < Outlet /> }
3738 </ AppShell >
3839 </ >
Original file line number Diff line number Diff line change 55 useMantineTheme ,
66 Burger ,
77} from "@mantine/core" ;
8- import { usePageStore } from "../../providers/page.provider" ;
8+ import { containerSizes , usePageStore } from "../../providers/page.provider" ;
99
1010interface HeaderProps {
1111 onToggleMenu : ( ) => void ;
@@ -19,7 +19,7 @@ export const Header = ({
1919 isMobile,
2020} : HeaderProps ) : React . ReactElement => {
2121 const theme = useMantineTheme ( ) ;
22- const { fullWidth } = usePageStore ( ) ;
22+ const { fullWidth, containerSize } = usePageStore ( ) ;
2323
2424 return (
2525 < AppShell . Header px = { 0 } bg = { theme . colors . dark [ 8 ] } >
@@ -44,6 +44,7 @@ export const Header = ({
4444 fluid = { fullWidth }
4545 w = { isMobile ? undefined : "100%" }
4646 m = { isMobile ? 0 : undefined }
47+ maw = { isMobile ? undefined : containerSizes [ containerSize ] }
4748 >
4849 < Group
4950 justify = "space-between"
Original file line number Diff line number Diff line change 11import { Container } from "@mantine/core" ;
22import type { ReactNode } from "react" ;
3- import { usePageStore } from "../../providers/page.provider" ;
3+ import { containerSizes , usePageStore } from "../../providers/page.provider" ;
44import { useScreenSize } from "../../providers/screen.provider" ;
5+
56interface PageContainerProps {
67 children ?: ReactNode ;
78 pt ?: number ;
89 pb ?: number ;
9- size ?: "md" | "lg" | "xl" ;
1010}
1111
12- const containerSizes = {
13- md : undefined ,
14- lg : 1200 ,
15- xl : 1600 ,
16- } ;
17-
1812export const PageContainer = ( {
1913 children,
2014 pt = 40 ,
2115 pb = 40 ,
22- size = "md" ,
2316} : PageContainerProps ) => {
2417 const { fullWidth } = usePageStore ( ) ;
2518 const { isSmallScreen } = useScreenSize ( ) ;
19+ const { containerSize } = usePageStore ( ) ;
2620
2721 return (
2822 < Container
2923 fluid = { fullWidth }
3024 pt = { pt }
3125 pb = { pb }
3226 px = { fullWidth && ! isSmallScreen ? "xl" : undefined }
33- maw = { containerSizes [ size ] }
27+ maw = { containerSizes [ containerSize ] }
3428 >
3529 { children }
3630 </ Container >
Original file line number Diff line number Diff line change @@ -4,14 +4,27 @@ import { useEffect } from "react";
44
55interface PageStore {
66 fullWidth : boolean ;
7+ containerSize : ContainerSize ;
78 setFullWidth : ( value : boolean ) => void ;
9+ setContainerSize : ( value : ContainerSize ) => void ;
810}
911
12+ export const containerSizes = {
13+ md : undefined ,
14+ lg : 1200 ,
15+ xl : 1600 ,
16+ } ;
17+
18+ export type ContainerSize = keyof typeof containerSizes ;
19+
1020export const usePageStore = create < PageStore > ( ) (
1121 devtools (
1222 ( set ) => ( {
23+ containerSize : "md" as ContainerSize ,
1324 fullWidth : false ,
1425 setFullWidth : ( value : boolean ) => set ( ( ) => ( { fullWidth : value } ) ) ,
26+ setContainerSize : ( value : ContainerSize ) =>
27+ set ( ( state ) => ( { ...state , containerSize : value } ) ) ,
1528 } ) ,
1629 { name : "page-store" } ,
1730 ) ,
@@ -28,3 +41,15 @@ export const useFullWidthPage = () => {
2841 } ;
2942 } , [ setFullWidth ] ) ;
3043} ;
44+
45+ export const useLargerPageContainer = ( size : ContainerSize ) => {
46+ const { setContainerSize } = usePageStore ( ) ;
47+
48+ useEffect ( ( ) => {
49+ setContainerSize ( size ) ;
50+
51+ return ( ) => {
52+ setContainerSize ( "md" ) ;
53+ } ;
54+ } , [ size , setContainerSize ] ) ;
55+ } ;
You can’t perform that action at this time.
0 commit comments