From e515564f5b6c933d6dbe701b410922b44d42216c Mon Sep 17 00:00:00 2001 From: Brandon Norsworthy Date: Mon, 23 Sep 2024 00:25:51 -0500 Subject: [PATCH] make site more legit --- index.html | 5 ++-- public/assets/text/news.md | 1 + public/robots.txt | 4 +++ public/sitemap.xml | 17 +++++++++++ src/pages/admin/AdminSuggestionsPage.tsx | 36 ++++++++++++++++-------- 5 files changed, 49 insertions(+), 14 deletions(-) create mode 100644 public/robots.txt create mode 100644 public/sitemap.xml diff --git a/index.html b/index.html index 013f3ca..1fa4396 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,8 @@ - + + @@ -16,7 +17,7 @@ - + Rust Quests diff --git a/public/assets/text/news.md b/public/assets/text/news.md index 20d561d..db7e1e8 100644 --- a/public/assets/text/news.md +++ b/public/assets/text/news.md @@ -11,6 +11,7 @@ ## Future Updates - Light/Dark mode toggle +- Select the tier/stage you are in for the wipe to get challenges relevant to your progression. (e.g. early game, mid game, late game) - Bingo card generator with a code to share with friends to compete or collaborate __^^ let us know if this is a feature you'd like to see! ^^__ diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..1933386 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Disallow: + +Sitemap: https://rustquests.com/sitemap.xml diff --git a/public/sitemap.xml b/public/sitemap.xml new file mode 100644 index 0000000..8569360 --- /dev/null +++ b/public/sitemap.xml @@ -0,0 +1,17 @@ + + + + + https://rustquests.com/ + + + https://rustquests.com/login + + + https://rustquests.com/unauthorized + + + https://rustquests.com/leaderboard + + + diff --git a/src/pages/admin/AdminSuggestionsPage.tsx b/src/pages/admin/AdminSuggestionsPage.tsx index 2e7fb60..d4d1948 100644 --- a/src/pages/admin/AdminSuggestionsPage.tsx +++ b/src/pages/admin/AdminSuggestionsPage.tsx @@ -85,18 +85,6 @@ const AdminSuggestionsPage = () => { closeModal(); }; - const handleDeleteSuggestion = async () => { - const onConfirm = () => toast.info('not implemented yet'); - setConfirmDialog({ - title: "Are you sure?", - description: "If you delete this suggestion, you will lose all changes.", - onConfirm: () => { - onConfirm(); - setConfirmDialog(null); - } - }); - }; - const handleCreateQuest = async (newQuest: convertSuggestionIntoQuestBodyRequest) => { const handleConvertSuggestionToQuest = async () => { try { @@ -125,6 +113,30 @@ const AdminSuggestionsPage = () => { } }); }; + + const handleDeleteSuggestion = async () => { + const onConfirm = () => { + try { + if (!selectedSuggestion) return; + if (!accessToken) return; + + suggestionService.deleteSuggestion(accessToken, selectedSuggestion.id); + closeModal(); + fetchSuggestions(); + + toast.success("Suggestion deleted successfully"); + } catch (error) { + toast.error("Failed to delete suggestion", error); + } finally { + setConfirmDialog(null); + } + }; + setConfirmDialog({ + title: "Are you sure?", + description: "If you delete this suggestion, you will lose all changes.", + onConfirm: onConfirm, + }); + }; return (