From 093c386f6e8787d213e864ce4a77dfe5929598dd Mon Sep 17 00:00:00 2001 From: Dorothy Wong Date: Fri, 2 Aug 2024 11:05:55 +0100 Subject: [PATCH] remove getDates.ts, add index number for getting randomPicture in PreviewImage.tsx --- src/images/PreviewImage.tsx | 2 +- src/utils/getDates.ts | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) delete mode 100644 src/utils/getDates.ts diff --git a/src/images/PreviewImage.tsx b/src/images/PreviewImage.tsx index 229cba2..f24b9e9 100644 --- a/src/images/PreviewImage.tsx +++ b/src/images/PreviewImage.tsx @@ -10,7 +10,7 @@ export function PreviewImage() { const handleRandomButtonClick = async () => { try { const randomPicture = await fetchRandomAPI("https://api.nasa.gov/planetary/apod?api_key="); - setMyPreviewImage(randomPicture); + setMyPreviewImage(randomPicture[0]); console.log(myPreviewImage); } diff --git a/src/utils/getDates.ts b/src/utils/getDates.ts deleted file mode 100644 index 0b9aef0..0000000 --- a/src/utils/getDates.ts +++ /dev/null @@ -1,11 +0,0 @@ -export function getBirthday() { - -} - -export function getTodaysDate() { - -} - -export function getRandomDate() { - -} \ No newline at end of file