1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
| import { Breadcrumb, Button, CheckboxOptionType, Col, Image, Layout, Menu, Radio, Rate, Row, Spin } from 'antd' import { ItemType } from 'antd/lib/menu/hooks/useItems' import { useEffect, useState } from 'react'
function App() { const [loading, setLoading] = useState<boolean>(true) const menu: ItemType[] = Array(5) .fill(null) .map((_, index) => ({ key: index + 1, label: `Nav ${index + 1}` })) const options: CheckboxOptionType[] = [ { label: 'XXS', value: 'xxs' }, { label: 'XS', value: 'xs' }, { label: 'S', value: 's' }, { label: 'M', value: 'm' }, { label: 'L', value: 'l' }, { label: 'XL', value: 'xl' }, { label: 'XXL', value: 'xxl' } ]
useEffect(() => { setTimeout(() => { setLoading(false) }, 1000) }, [])
return ( <Layout className='demo-layout-wrapper'> <Layout.Header className='demo-layout-header'> <div className='demo-layout-header-left'> <div className='demo-layout-header-logo'></div> </div> <div className='demo-layout-header-right'> <Menu mode='horizontal' items={menu} /> </div> </Layout.Header> <Layout.Content className='demo-layout-content'> <Breadcrumb> <Breadcrumb.Item>Home</Breadcrumb.Item> <Breadcrumb.Item> <a href='#'>Product</a> </Breadcrumb.Item> <Breadcrumb.Item>Product Detail</Breadcrumb.Item> </Breadcrumb> <div className='demo-layout-content-main'> <Spin size='large' spinning={loading}> <h2 className='demo-layout-content-main-title'>Product Tiitle</h2> <div className='demo-layout-content-main-detail'> <Row gutter={[50, 50]}> <Col span={24} lg={8}> <Image width={'100%'} src='https://photo.queenshop.com.tw/01039398/01039398-h.jpg' /> </Col> <Col span={24} lg={16}> <div className='demo-layout-content-main-detail-rate'> <Rate allowHalf disabled defaultValue={4} /> </div> <p className='demo-layout-content-main-detail-description'> Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quia provident ullam obcaecati alias vel vitae excepturi similique dolorum itaque corrupti, deserunt eligendi temporibus voluptates commodi! Sed quam aliquam in accusantium? </p> <h3 className='demo-layout-content-main-detail-prize'> Prize: <span>13.00$</span> </h3> <Radio.Group options={options} /> <div className='demo-layout-content-main-detail-button'> <Button>Buy it now</Button> </div> </Col> </Row> </div> </Spin> </div> </Layout.Content> <Layout.Footer className='demo-layout-footer'> <p>Copyright © 2022. Dont know what is</p> </Layout.Footer> </Layout> ) }
export default App
|