-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters