ant-design/components/upload/demo/debug-disabled.tsx
EmilyyyLiu 47eb1b661e
feat(Space): unify orientation attribute usage (#53669)
* feat[Space]:Unified use of orientation attribute

* feat: use useOrientation and change doc, add test

* feat: add warning

* test: update snapshots

* Update components/space/Compact.tsx

Co-authored-by: thinkasany <480968828@qq.com>
Signed-off-by: EmilyyyLiu <100924403+EmilyyyLiu@users.noreply.github.com>

* test: reset snapshots,delete direction default value

* feat: change demo direnction->orentation

* feat: demos direction ->orientation

* feat: add vertical, and change demos , doc

* feat: change demo space -> flex

* feat: change demo space -> flex

* feat: space -> flex

* Update components/space/index.tsx

Signed-off-by: thinkasany <480968828@qq.com>

* Update components/space/Compact.tsx

Signed-off-by: thinkasany <480968828@qq.com>

* add warning toHaveBeenCalledWith

---------

Signed-off-by: EmilyyyLiu <100924403+EmilyyyLiu@users.noreply.github.com>
Signed-off-by: thinkasany <480968828@qq.com>
Co-authored-by: 刘欢 <lh01217311@antgroup.com>
Co-authored-by: thinkasany <480968828@qq.com>
2025-05-23 15:20:33 +08:00

73 lines
1.9 KiB
TypeScript

import React from 'react';
import { InboxOutlined, PlusOutlined, UploadOutlined } from '@ant-design/icons';
import { Button, Space, Upload } from 'antd';
import type { UploadFile } from 'antd';
const { Dragger } = Upload;
const fileList: UploadFile[] = [
{
uid: '-1',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-2',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-xxx',
percent: 50,
name: 'image.png',
status: 'uploading',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
},
{
uid: '-5',
name: 'image.png',
status: 'error',
},
];
const App: React.FC = () => {
const uploadButton = (
<button
style={{ color: 'inherit', cursor: 'inherit', border: 0, background: 'none' }}
type="button"
>
<PlusOutlined />
<div style={{ marginTop: 8 }}>Upload</div>
</button>
);
return (
<Space vertical>
<Upload disabled>Click Text to Upload</Upload>
<Upload disabled>
<Button icon={<UploadOutlined />}>Click to Upload</Button>
</Upload>
<Upload name="avatar" listType="picture-card" fileList={fileList} disabled>
{uploadButton}
</Upload>
<Upload name="avatar" listType="picture-circle" fileList={fileList} disabled>
{uploadButton}
</Upload>
<Dragger disabled>
<p className="ant-upload-drag-icon">
<InboxOutlined />
</p>
<p className="ant-upload-text">Click or drag file to this area to upload</p>
<p className="ant-upload-hint">
Support for a single or bulk upload. Strictly prohibited from uploading company data or
other banned files.
</p>
</Dragger>
</Space>
);
};
export default App;