-
Notifications
You must be signed in to change notification settings - Fork 376
Docs: Added new banner #4087
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs: Added new banner #4087
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import { Fragment, ReactNode, useEffect, useState } from 'react'; | ||
| import { useRouter } from 'next/router'; | ||
| import { Box, DeviceTypeProvider, Divider, FixedZIndex, Flex } from 'gestalt'; | ||
| import { Box, Button, DeviceTypeProvider, Divider, FixedZIndex, Flex, Icon, Text } from 'gestalt'; | ||
| import { | ||
| TOKEN_COLOR_GRAY_ROBOFLOW_700, | ||
| TOKEN_COLOR_ORANGE_FIRETINI_0, | ||
|
|
@@ -16,6 +16,7 @@ import SkipToContent from './SkipToContent'; | |
|
|
||
| export const CONTENT_MAX_WIDTH_PX = 1200; | ||
| const HEADER_HEIGHT_WITH_MARGIN = 90; | ||
| const BANNER_TEXT_MAX_WIDTH = 580; | ||
| const fullWidthPages = ['home']; | ||
| const fullBleedNoNavigationPages = ['integration-test']; | ||
|
|
||
|
|
@@ -24,6 +25,44 @@ type Props = { | |
| colorScheme?: 'light' | 'dark'; | ||
| }; | ||
|
|
||
| function Banner() { | ||
| return ( | ||
| <Box | ||
| alignItems="center" | ||
| dangerouslySetInlineStyle={{ | ||
| __style: { backgroundColor: '#EBEEFF' }, | ||
| }} | ||
| direction="row" | ||
| display="flex" | ||
| justifyContent="between" | ||
| paddingX={8} | ||
| paddingY={6} | ||
| role="banner" | ||
| > | ||
| <Flex alignItems="baseline" direction="row" gap={4}> | ||
| <Icon | ||
| accessibilityLabel="Information" | ||
| color="info" | ||
| icon="circle-information-fill" | ||
| size={24} | ||
| /> | ||
|
|
||
| <Flex direction="column" gap={1} maxWidth={BANNER_TEXT_MAX_WIDTH}> | ||
| <Text size="500" weight="bold"> | ||
| This is Gestalt’s legacy documentation | ||
| </Text> | ||
|
|
||
| <Text color="dark"> | ||
| Information might be outdated. For the latest documentation and support, visit Gestalt’s | ||
| new documentation website. | ||
| </Text> | ||
| </Flex> | ||
| </Flex> | ||
| <Button color="red" size="lg" text="Explore Gestalt 2.0" /> | ||
|
||
| </Box> | ||
| ); | ||
| } | ||
|
|
||
| export default function AppLayout({ children, colorScheme }: Props) { | ||
| const { isMobile } = useDocsConfig(); | ||
| const { isSidebarOpen, setIsSidebarOpen } = useNavigationContext(); | ||
|
|
@@ -57,6 +96,7 @@ export default function AppLayout({ children, colorScheme }: Props) { | |
|
|
||
| let pageContent = ( | ||
| <Box color="default" minHeight="100vh"> | ||
| <Banner /> | ||
| <SkipToContent /> | ||
| <Header /> | ||
| {isSidebarOpen && ( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The button looks squished when rendering the banner on a small screen:

Only for small screens, should the button move to a separate row?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rondevera
I've fixed already =)