generated from Jonghakseo/chrome-extension-boilerplate-react-vite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(content-ui): Implement accessible UI using Ant Design components
This commit adds a new functional component, `ContentTab`, which utilizes Ant Design components to create an accessible UI. The component includes tabs for different functionalities and a form for adding test cases. It utilizes Ant Design components such as `Tabs`, `Form`, `Input`, and `Button` to create a user-friendly interface. Additionally, the `App` component has been updated to render the `ContentTab` component instead of the previous placeholder content. This commit enhances the accessibility and functionality of the content UI.
- Loading branch information
Showing
5 changed files
with
1,738 additions
and
15 deletions.
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
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
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,93 @@ | ||
import React from 'react'; | ||
import { Button, Form, Input, message, Tabs } from 'antd'; | ||
import { PlusOutlined, RobotOutlined, ToolOutlined, SettingOutlined } from '@ant-design/icons'; | ||
const { TabPane } = Tabs; | ||
|
||
export default function AccessibleFunctionalUI() { | ||
const [form] = Form.useForm(); | ||
|
||
const onFinish = (values: any) => { | ||
console.log('Form values:', values); | ||
message.success('Test case added successfully!'); | ||
form.resetFields(); | ||
}; | ||
|
||
return ( | ||
<div className="p-2 bg-gray-100 max-w-md mx-auto"> | ||
<Tabs defaultActiveKey="1" type="card" className="mb-2"> | ||
<TabPane | ||
tab={ | ||
<span className="flex items-center"> | ||
<RobotOutlined className="mr-1" /> | ||
Auto Capture | ||
</span> | ||
} | ||
key="1"> | ||
<Form form={form} name="autoTestForm" onFinish={onFinish} layout="vertical" className="space-y-2"> | ||
<Form.Item | ||
name="testGoals" | ||
label={<span className="font-medium">Test Goals</span>} | ||
rules={[{ required: true, message: 'Test goals are required' }]}> | ||
<Input.TextArea | ||
placeholder="Enter test goals" | ||
className="text-sm" | ||
rows={2} | ||
autoSize={{ minRows: 2, maxRows: 4 }} | ||
/> | ||
</Form.Item> | ||
<Form.Item | ||
name="testSteps" | ||
label={<span className="font-medium">Test Steps</span>} | ||
rules={[{ required: true, message: 'Test steps are required' }]}> | ||
<Input.TextArea | ||
placeholder="Enter test steps" | ||
className="text-sm" | ||
rows={3} | ||
autoSize={{ minRows: 3, maxRows: 6 }} | ||
/> | ||
</Form.Item> | ||
<Form.Item> | ||
<Button | ||
type="primary" | ||
htmlType="submit" | ||
icon={<PlusOutlined />} | ||
className="w-full bg-blue-500 hover:bg-blue-600 focus:bg-blue-600"> | ||
Add Test Case | ||
</Button> | ||
</Form.Item> | ||
</Form> | ||
</TabPane> | ||
<TabPane | ||
tab={ | ||
<span className="flex items-center"> | ||
<ToolOutlined className="mr-1" /> | ||
Function 2 | ||
</span> | ||
} | ||
key="2"> | ||
<div className="p-2 bg-white rounded-lg shadow-sm"> | ||
<h3 className="font-medium mb-2">Function 2</h3> | ||
<p className="text-sm"> | ||
This is a placeholder for Function 2 content. Add your specific functionality here. | ||
</p> | ||
</div> | ||
</TabPane> | ||
<TabPane | ||
tab={ | ||
<span className="flex items-center"> | ||
<SettingOutlined className="mr-1" /> | ||
Function 3 | ||
</span> | ||
} | ||
key="3"> | ||
<div className="p-2 bg-white rounded-lg shadow-sm"> | ||
<h3 className="font-medium mb-2">Function 3</h3> | ||
<p className="text-sm"> | ||
This is a placeholder for Function 3 content. Add your specific functionality here. | ||
</p> | ||
</div> | ||
</TabPane> | ||
</Tabs> | ||
</div> | ||
); | ||
} |
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
Oops, something went wrong.