mirror of
https://github.com/Stef-00012/Zipline-Android-App.git
synced 2025-05-11 18:35:58 +02:00
metrics page
This commit is contained in:
parent
6eb65dc30d
commit
cf38808be5
21 changed files with 815 additions and 110 deletions
|
@ -3,14 +3,23 @@ import Popup from "./Popup";
|
|||
import DateTimePicker from 'react-native-ui-datepicker';
|
||||
import type { DatePickeMultipleProps, DatePickerRangeProps, DatePickerSingleProps } from "react-native-ui-datepicker/lib/typescript/DateTimePicker";
|
||||
import Button from "./Button";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
type Props = (DatePickeMultipleProps | DatePickerRangeProps | DatePickerSingleProps) & {
|
||||
open: boolean;
|
||||
onClose: () => void | Promise<void>
|
||||
onClose: () => void | Promise<void>;
|
||||
children?: ReactNode
|
||||
}
|
||||
|
||||
export default function DatePicker(props: Props) {
|
||||
const defaultProps: Props = {
|
||||
const {
|
||||
open,
|
||||
onClose,
|
||||
children,
|
||||
...datePickerProps
|
||||
} = props;
|
||||
|
||||
const defaultProps = {
|
||||
monthContainerStyle: styles.monthContainerStyle,
|
||||
yearContainerStyle: styles.yearContainerStyle,
|
||||
calendarTextStyle: styles.calendarTextStyle,
|
||||
|
@ -23,13 +32,15 @@ export default function DatePicker(props: Props) {
|
|||
displayFullDays: true,
|
||||
firstDayOfWeek: 1,
|
||||
locale: "en",
|
||||
...props
|
||||
}
|
||||
...datePickerProps
|
||||
};
|
||||
|
||||
return (
|
||||
<Popup hidden={!props.open} onClose={props.onClose}>
|
||||
<Popup hidden={!open} onClose={onClose}>
|
||||
<DateTimePicker {...defaultProps}/>
|
||||
|
||||
{props.children}
|
||||
|
||||
<Button
|
||||
text="Close"
|
||||
onPress={props.onClose}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue