From 8007477e37682e331ce0ccc087f16715c2585bdd Mon Sep 17 00:00:00 2001 From: Toni L Date: Wed, 31 Mar 2021 17:17:39 +0300 Subject: [PATCH] restyle signups buttons to match other buttons. added toastify notifications to signups remove. fixed typo in job ads toastify message --- src/pages/admin/jobads/index.tsx | 2 +- src/pages/admin/signups/[id]/list.tsx | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pages/admin/jobads/index.tsx b/src/pages/admin/jobads/index.tsx index a2dd6a6..cc6e7fa 100644 --- a/src/pages/admin/jobads/index.tsx +++ b/src/pages/admin/jobads/index.tsx @@ -24,7 +24,7 @@ const confirmDelete = async (jobad: JobAd) => { if (window.confirm(`Delete: ${jobad.id}: ${jobad.title_fi}/${jobad.title_en}; Are you sure?`) === true) { try { await JobAdApi.deleteJobAd(jobad.id); - toast.success("Signup removed successfully 😎"); + toast.success("Job ad removed successfully 😎"); window.location.reload(); // TODO: Fetch/update event list, so user sees the signup in the list } catch (err) { toast.error("Uh oh! Something went wrong! Try again later. 😟"); diff --git a/src/pages/admin/signups/[id]/list.tsx b/src/pages/admin/signups/[id]/list.tsx index 4af8344..754a8c0 100644 --- a/src/pages/admin/signups/[id]/list.tsx +++ b/src/pages/admin/signups/[id]/list.tsx @@ -1,6 +1,7 @@ import React, { useEffect, useState } from "react"; import { NextPage } from "next"; import { useRouter } from "next/router"; +import { toast } from "react-toastify"; import styled from "styled-components"; import { CSVLink } from "react-csv"; import AdminListCommon from "@views/admin/AdminListCommon"; @@ -11,6 +12,10 @@ import noop from "@utils/noop"; const StyledButton = styled(Button) <{ $colorOverride: "red" | "green" }>` background-color: ${(p) => p.$colorOverride}; + border-radius: 8px; + color: white; + font-size: 13px; + font-weight: bold; `; const SignupEmailPage: NextPage = () => { @@ -33,8 +38,9 @@ const SignupEmailPage: NextPage = () => { try { await SignupApi.deleteSignup(signup.id); setSignups(signups.filter((s) => s.id !== signup.id)); + toast.success("Signup removed successfully 😎"); } catch (err) { - window.alert("Delete failed!"); + toast.error("Uh oh! Something went wrong! Try again later. 😟"); } } };