Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion docs/docs-components/AppLayout.tsx
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,
Expand All @@ -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'];

Expand All @@ -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}>
Copy link
Contributor

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:
Partial screenshot of the preview app using iPhone 12 Pro dimensions

Only for small screens, should the button move to a separate row?

Copy link
Contributor Author

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 =)

<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" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should happen when a user presses this button?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should go to the gestalt.pinterest.systems

But to be honest, I'm not a huge fan of using the button as link....

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here! Could this use the ButtonLink component instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done =)

</Box>
);
}

export default function AppLayout({ children, colorScheme }: Props) {
const { isMobile } = useDocsConfig();
const { isSidebarOpen, setIsSidebarOpen } = useNavigationContext();
Expand Down Expand Up @@ -57,6 +96,7 @@ export default function AppLayout({ children, colorScheme }: Props) {

let pageContent = (
<Box color="default" minHeight="100vh">
<Banner />
<SkipToContent />
<Header />
{isSidebarOpen && (
Expand Down