remove expiration modal
This commit is contained in:
parent
752b2c0980
commit
9f810378f1
3 changed files with 0 additions and 66 deletions
|
@ -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
|
|
|
@ -1,4 +0,0 @@
|
||||||
.wrapper {
|
|
||||||
/* For date picker */
|
|
||||||
overflow: visible !important;
|
|
||||||
}
|
|
|
@ -212,7 +212,6 @@ const Post = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<PasswordModal isOpen={passwordModalVisible} onClose={onClosePasswordModal} onSubmit={submitPassword} />
|
<PasswordModal isOpen={passwordModalVisible} onClose={onClosePasswordModal} onSubmit={submitPassword} />
|
||||||
{/* <ExpirationModal isOpen={expirationModalVisibile} onClose={onCloseExpirationModal} onSubmit={submitExpiration} /> */}
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue