mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-15 09:06:19 +08:00
init: the first public commit for AFFiNE
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
Calendar as ReactCalendar,
|
||||
type CalendarProps,
|
||||
} from 'react-date-range';
|
||||
import { useTheme } from '../theme';
|
||||
|
||||
export { CalendarProps };
|
||||
|
||||
export const Calendar = (props: CalendarProps) => {
|
||||
const theme = useTheme();
|
||||
|
||||
return <ReactCalendar color={theme.affine.palette.primary} {...props} />;
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
import {
|
||||
DateRange as ReactDateRange,
|
||||
type DateRangeProps,
|
||||
type Range,
|
||||
} from 'react-date-range';
|
||||
import { useTheme } from '../theme';
|
||||
|
||||
export { DateRangeProps, Range };
|
||||
|
||||
export const DateRange = (props: DateRangeProps) => {
|
||||
const theme = useTheme();
|
||||
|
||||
return (
|
||||
<ReactDateRange
|
||||
color={theme.affine.palette.primary}
|
||||
rangeColors={[theme.affine.palette.primary]}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
import 'react-date-range/dist/styles.css'; // main css file
|
||||
import 'react-date-range/dist/theme/default.css'; // theme css file
|
||||
|
||||
// export { DateRange } from 'react-date-range';
|
||||
export { DateRange } from './DateRange';
|
||||
export { Calendar } from './Calendar';
|
||||
|
||||
export type { DateRangeProps, Range } from './DateRange';
|
||||
export type { CalendarProps } from './Calendar';
|
||||
|
||||
// export const NewDateRange = DateRange;
|
||||
Reference in New Issue
Block a user