diff --git a/pages/bluedialog/bluedialog.page.tsx b/pages/bluedialog/bluedialog.page.tsx index c9bdf87884..9c4f2f5363 100644 --- a/pages/bluedialog/bluedialog.page.tsx +++ b/pages/bluedialog/bluedialog.page.tsx @@ -1,127 +1,21 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -import React, { useEffect, useRef } from 'react'; +import React from 'react'; -import { - Box, - Button, - DatePicker, - ExpandableSection, - Form, - FormField, - Header, - Input, - Select, - SpaceBetween, - Textarea, -} from '~components'; +import { Box } from '~components'; -import styles from './styles.scss'; - -export default function Bluedialogbox() { - const dialogRef = useRef(null); - const triggerRef = useRef(null); - // Inputs (these following can be clubbed into one state object) - const [dateValue, setDateValue] = React.useState(''); - const [amountValue, setAmountValue] = React.useState('0'); - const [descriptionValue, setDescriptionValue] = React.useState(''); - const [selectedService, setSelectedService] = React.useState({ label: 'Cloudwatch', value: 'Cloudwatch' }); - - useEffect(() => { - // Store the element that had focus before dialog opened - triggerRef.current = document.activeElement as HTMLElement; - - // Focus the dialog container when it opens - if (dialogRef.current) { - dialogRef.current.focus(); - } - // Cleanup: Return focus to the trigger element when dialog closes - return () => { - if (triggerRef.current) { - triggerRef.current.focus(); - } - }; - }, []); - function submitData() { - console.log({ dateValue, amountValue, descriptionValue, selectedService }); // submit the form with these values to determine next action - } - function skipDialog() { - console.log('skip dialog'); // can be used by the parent component to dismiss/ hide this dialog box - } +import Bluedialog from './dialog'; +export default function BluedialogPage() { + const submitData = (data: any) => { + console.log(data); // submit the form with these values to determine next action + }; + const skipDialog = () => { + console.log('skip dialog'); + }; return ( -
-
-
Dialog header
-
- } - > -
- - - setDateValue(detail.value)} - value={dateValue} - openCalendarAriaLabel={selectedDate => - 'Choose certificate expiry date' + (selectedDate ? `, selected date is ${selectedDate}` : '') - } - placeholder="YYYY/MM/DD" - ariaLabel="Select date of increase" - /> - - - setAmountValue(detail.value)} - ariaLabel="Enter increase amount in USD" - /> - - - - Provide more details to enhance troubleshooting - - } - aria-expanded={true} - > - - -