Fix images not setting properly

This commit is contained in:
jude 2024-02-28 16:58:44 +00:00
parent b0e37b56c0
commit cfb498794f
3 changed files with 14 additions and 3 deletions

View File

@ -16,7 +16,7 @@ export const Author = ({ name, icon, setReminder }: Props) => {
class="is-rounded embed_author_url"
url={icon}
alt="Image for embed author"
setImage={(url) => {
setImage={(url: string) => {
setReminder((reminder) => ({
...reminder,
embed_author_url: url,

View File

@ -65,7 +65,12 @@ export const Embed = () => {
class="embed_thumbnail_url"
url={reminder.embed_thumbnail_url}
alt="Square thumbnail embedded image"
setImage={() => {}}
setImage={(url: string) =>
setReminder((reminder: Reminder) => ({
...reminder,
embed_thumbnail_url: url || null,
}))
}
/>
</p>
</div>
@ -76,7 +81,12 @@ export const Embed = () => {
class="embed_image_url"
url={reminder.embed_image_url}
alt="Large embedded image"
setImage={() => {}}
setImage={(url: string) =>
setReminder((reminder: Reminder) => ({
...reminder,
embed_image_url: url || null,
}))
}
/>
</p>

View File

@ -33,6 +33,7 @@ const ImagePickerModal = ({ setModalOpen, setImage }) => {
title={"Enter Image URL"}
onSubmit={() => {
setImage(value);
setModalOpen(false);
}}
onSubmitText={"Save"}
>