ant-design/components/calendar/demo/component-token.tsx
叶枫 502dac12aa
docs: format code (#48309)
* docs: fix code

* feat: lint

* feat: prettier

* feat: test

* feat: review

* feat: format html

* feat: format html
2024-04-08 14:04:08 +08:00

30 lines
751 B
TypeScript

import React from 'react';
import { Calendar, ConfigProvider } from 'antd';
import type { CalendarProps } from 'antd';
import type { Dayjs } from 'dayjs';
/** Test usage. Do not use in your production. */
export default () => {
const onPanelChange = (value: Dayjs, mode: CalendarProps<Dayjs>['mode']) => {
console.log(value.format('YYYY-MM-DD'), mode);
};
return (
<ConfigProvider
theme={{
components: {
Calendar: {
fullBg: 'red',
fullPanelBg: 'green',
itemActiveBg: 'black',
},
},
}}
>
<Calendar onPanelChange={onPanelChange} />
<br />
<Calendar onPanelChange={onPanelChange} fullscreen={false} />
</ConfigProvider>
);
};