mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-12 15:19:58 +08:00
cc223a102c
* feat: start the implementation of the fullscreen prop in Spin * docs: change main spin demo * docs: enhance demo * test: update snapshot * fix: address pr comments * fix: use logical property on fullscreen class * fix: address pr review * feat: Added background color token * fix: remove onClick and change demo * feat: change spin to white when fullcreen also use the bgmask as background, removing the bgColor token * fix: unused import * test: update snapshot * Update components/spin/style/index.tsx Signed-off-by: lijianan <574980606@qq.com> * fix: use white color from token * fix: not needed interpolation and version * fix: address pr review * fix: tip prop was not working * test: cover tip & fullscreen case * fix: addrress pr coments --------- Signed-off-by: lijianan <574980606@qq.com> Co-authored-by: lijianan <574980606@qq.com> Co-authored-by: MadCcc <1075746765@qq.com>
24 lines
438 B
TypeScript
24 lines
438 B
TypeScript
import React, { useState } from 'react';
|
|
import { Button, Spin } from 'antd';
|
|
|
|
const App: React.FC = () => {
|
|
const [show, setShow] = useState(false);
|
|
|
|
const showLoader = () => {
|
|
setShow(true);
|
|
|
|
setTimeout(() => {
|
|
setShow(false);
|
|
}, 2000);
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<Button onClick={showLoader}>Show fullscreen for 2s</Button>
|
|
{show && <Spin fullscreen size="large" />}
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default App;
|