(undefined)
- const [photoUrl, setPhotoUrl] = useState('')
- const [avatarLoading, setAvatarLoading] = useState(false)
const [question, setQuestion] = useState(
'Will I find a partner in the next 3 months?'
)
@@ -40,30 +36,7 @@ export default function CreateDateDocPage() {
const birthdayTime = birthday ? dayjs(birthday).valueOf() : undefined
const isValid =
- user &&
- birthday &&
- photoUrl &&
- editor &&
- editor.isEmpty === false &&
- question
-
- const fileHandler = async (event: any) => {
- if (!user) return
-
- const file = event.target.files[0]
-
- setAvatarLoading(true)
-
- await uploadImage(user.username, file)
- .then(async (url) => {
- setPhotoUrl(url)
- setAvatarLoading(false)
- })
- .catch(() => {
- setAvatarLoading(false)
- setPhotoUrl('')
- })
- }
+ user && birthday && editor && editor.isEmpty === false && question
async function saveDateDoc() {
if (!user || !editor || !birthdayTime) return
@@ -76,7 +49,6 @@ export default function CreateDateDocPage() {
content: editor.getJSON(),
bounty: 0,
birthday: birthdayTime,
- photoUrl,
type: 'date-doc',
question,
}
@@ -122,33 +94,6 @@ export default function CreateDateDocPage() {
/>
-
- Photo
-
- {avatarLoading ? (
-
- ) : (
- <>
- {photoUrl && (
-
- )}
-
- >
- )}
-
-
-
Tell us about you! What are you looking for?