Skip to content

Commit

Permalink
new approach with limited width
Browse files Browse the repository at this point in the history
  • Loading branch information
timogasda committed Aug 9, 2023
1 parent 405fde2 commit 515e8df
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
36 changes: 36 additions & 0 deletions pages/header/responsiveness-2.page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable react/jsx-key */
import React, { useState } from 'react';
import clsx from 'clsx';
import Box from '~components/box';
import Input from '~components/input';
import FormField from '~components/form-field';
import ScreenshotArea from '../utils/screenshot-area';
import styles from './styles.scss';
import { Showcase } from './responsiveness.page';

export default function PageHeadersDemo() {
const [value, setValue] = useState('75');
return (
<ScreenshotArea>
<Box padding="l">
<FormField label="Maximum number of characters" stretch={false}>
<div style={{ maxWidth: 150 }}>
<Input
value={value}
type="number"
onChange={e => {
setValue(e.detail.value);
document.documentElement.style.setProperty('--header-max-width', `${e.detail.value}ch`);
}}
/>
</div>
</FormField>
<div className={clsx(styles.playground)}>
<Showcase approach="current" />
</div>
</Box>
</ScreenshotArea>
);
}
2 changes: 1 addition & 1 deletion pages/header/responsiveness.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const approachDescription: Record<Approach, string> = {
scott: '',
};

function Showcase({ approach }: { approach: Approach }) {
export function Showcase({ approach }: { approach: Approach }) {
return (
<div className={styles.showcase}>
<div>
Expand Down

0 comments on commit 515e8df

Please sign in to comment.