Skip to content

Commit b5fd58e

Browse files
committed
Added a new test page.
1 parent 29254d1 commit b5fd58e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import { useState } from "react";
5+
6+
import Header from "@cloudscape-design/components/header";
7+
import Input from "@cloudscape-design/components/input";
8+
import SpaceBetween from "@cloudscape-design/components/space-between";
9+
10+
import { Avatar } from "../../lib/components";
11+
12+
export default function AvatarImageAndWidth() {
13+
const [url, setURL] = useState(
14+
"https://static1.colliderimages.com/wordpress/wp-content/uploads/2024/08/deadpool-wolverine-hugh-jackman-mask-reveal.jpg",
15+
);
16+
const [width, setWidth] = useState("100");
17+
18+
return (
19+
<SpaceBetween direction="vertical" size="m">
20+
<Header>Input an Image URL and custom size.</Header>
21+
22+
<SpaceBetween direction="horizontal" size="m">
23+
<Input onChange={({ detail }) => setURL(detail.value)} value={url} />
24+
25+
<Input onChange={({ detail }) => setWidth(detail.value)} value={width} inputMode="numeric" type="number" />
26+
</SpaceBetween>
27+
28+
<Avatar ariaLabel="An awesome picture of Wolverine" initials="WV" imgUrl={url} width={Number(width)} />
29+
</SpaceBetween>
30+
);
31+
}

0 commit comments

Comments
 (0)