remove expiration modal

This commit is contained in:
Max Leiter 2022-03-30 20:02:16 -07:00
parent 752b2c0980
commit 9f810378f1
No known key found for this signature in database
GPG key ID: A3512F2F2F17EBDA
3 changed files with 0 additions and 66 deletions

View file

@ -1,61 +0,0 @@
import { Modal, Note, Spacer, Input } from "@geist-ui/core"
import { useCallback, useState } from "react"
import DatePicker from 'react-datepicker';
// import "react-datepicker/dist/react-datepicker.css";
import styles from './modal.module.css'
type Props = {
isOpen: boolean
onClose: () => void
onSubmit: (expiresAt: Date) => void
}
const ExpirationModal = ({ isOpen, onClose, onSubmit: onSubmitAfterVerify }: Props) => {
const [error, setError] = useState<string>()
const [date, setDate] = useState(new Date());
const onSubmit = () => {
onSubmitAfterVerify(date)
}
const onDateChange = (date: Date) => {
setDate(date)
}
const CustomTimeInput = ({ value, onChange }: {
date: Date,
value: string,
onChange: (date: string) => void
}) => {
return (
<Input
value={value}
onChange={(e) => onChange(e.target.value)}
htmlType="time"
/>)
}
return (<>
{/* TODO: investigate disableBackdropClick not updating state? */}
{<Modal visible={isOpen} wrapClassName={styles.wrapper} disableBackdropClick={true}>
<Modal.Title>Enter an expiration time</Modal.Title>
<Modal.Content>
<DatePicker
selected={date}
onChange={onDateChange}
customInput={<Input />}
showTimeInput={true}
// @ts-ignore
customTimeInput={<CustomTimeInput />}
timeInputLabel="Time:"
dateFormat="MM/dd/yyyy h:mm aa"
/>
</Modal.Content>
<Modal.Action passive onClick={onClose}>Cancel</Modal.Action>
<Modal.Action onClick={onSubmit}>Submit</Modal.Action>
</Modal>}
</>)
}
export default ExpirationModal

View file

@ -1,4 +0,0 @@
.wrapper {
/* For date picker */
overflow: visible !important;
}

View file

@ -212,7 +212,6 @@ const Post = () => {
</div>
</div>
<PasswordModal isOpen={passwordModalVisible} onClose={onClosePasswordModal} onSubmit={submitPassword} />
{/* <ExpirationModal isOpen={expirationModalVisibile} onClose={onCloseExpirationModal} onSubmit={submitExpiration} /> */}
</div>
)
}