11import { Fragment , ReactNode , useEffect , useState } from 'react' ;
22import { useRouter } from 'next/router' ;
3- import { Box , DeviceTypeProvider , Divider , FixedZIndex , Flex , Sticky } from 'gestalt' ;
3+ import {
4+ Box ,
5+ ButtonLink ,
6+ DeviceTypeProvider ,
7+ Divider ,
8+ FixedZIndex ,
9+ Flex ,
10+ Icon ,
11+ Sticky ,
12+ Text ,
13+ } from 'gestalt' ;
414import {
515 TOKEN_COLOR_GRAY_ROBOFLOW_700 ,
616 TOKEN_COLOR_ORANGE_FIRETINI_0 ,
@@ -12,9 +22,11 @@ import Footer from './Footer';
1222import Header from './Header' ;
1323import { useNavigationContext } from './navigationContext' ;
1424import SkipToContent from './SkipToContent' ;
25+ import useBannerResize , { SM_BREAKPOINT } from './useBannerResize' ;
1526
1627export const CONTENT_MAX_WIDTH_PX = 1200 ;
1728const HEADER_HEIGHT_WITH_MARGIN = 90 ;
29+
1830const fullWidthPages = [ 'home' ] ;
1931const fullBleedNoNavigationPages = [ 'integration-test' ] ;
2032
@@ -23,6 +35,60 @@ type Props = {
2335 colorScheme ?: 'light' | 'dark' ;
2436} ;
2537
38+ function Banner ( ) {
39+ const { maxWidth : bannerTextMaxWidth , breakpoint } = useBannerResize ( ) ;
40+
41+ const isSMBreakpoint = breakpoint === SM_BREAKPOINT ;
42+
43+ return (
44+ < Box
45+ alignItems = "end"
46+ dangerouslySetInlineStyle = { {
47+ __style : { backgroundColor : '#EBEEFF' } ,
48+ } }
49+ direction = "column"
50+ display = "flex"
51+ justifyContent = "between"
52+ paddingX = { 4 }
53+ paddingY = { 4 }
54+ role = "banner"
55+ smAlignItems = "center"
56+ smDirection = "row"
57+ smPaddingX = { 8 }
58+ smPaddingY = { 6 }
59+ >
60+ < Flex alignItems = "start" direction = "row" gap = { isSMBreakpoint ? 1 : 4 } >
61+ < Icon
62+ accessibilityLabel = "Information"
63+ color = "info"
64+ icon = "circle-information-fill"
65+ size = { isSMBreakpoint ? 16 : 24 }
66+ />
67+
68+ < Flex direction = "column" gap = { 1 } maxWidth = { bannerTextMaxWidth } >
69+ < Text size = { isSMBreakpoint ? '300' : '400' } weight = "bold" >
70+ This is Gestalt’s legacy documentation
71+ </ Text >
72+
73+ < Text size = { isSMBreakpoint ? '200' : '300' } >
74+ Information might be outdated. For the latest documentation and support, visit Gestalt’s
75+ new documentation website.
76+ </ Text >
77+ </ Flex >
78+ </ Flex >
79+
80+ < Box marginTop = { 4 } smMarginTop = { 0 } >
81+ < ButtonLink
82+ color = "red"
83+ href = "https://gestalt.pinterest.systems"
84+ size = { isSMBreakpoint ? 'sm' : 'lg' }
85+ text = "Explore Gestalt 2.0"
86+ />
87+ </ Box >
88+ </ Box >
89+ ) ;
90+ }
91+
2692export default function AppLayout ( { children, colorScheme } : Props ) {
2793 const { isMobile } = useDocsConfig ( ) ;
2894 const { isSidebarOpen, setIsSidebarOpen } = useNavigationContext ( ) ;
@@ -62,6 +128,7 @@ export default function AppLayout({ children, colorScheme }: Props) {
62128 } }
63129 minHeight = "100vh"
64130 >
131+ < Banner />
65132 < Sticky top = { 0 } >
66133 < SkipToContent />
67134 < Header />
0 commit comments