restyle signups buttons to match other buttons. added toastify notifications to signups remove. fixed typo in job ads toastify message
This commit is contained in:
@@ -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. 😟");
|
||||
|
||||
@@ -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. 😟");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user