mirror of
https://github.com/lemeow125/EquipmentTracker-Frontend.git
synced 2025-05-16 19:39:12 +08:00
Added toast notifications
This commit is contained in:
parent
fd4c2e9ad6
commit
0cccaf25f1
5 changed files with 52 additions and 9 deletions
13
src/App.tsx
13
src/App.tsx
|
@ -4,9 +4,9 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|||
import { Provider } from "react-redux";
|
||||
import "./App.css";
|
||||
import store from "./Components/Plugins/Redux/Store/Store";
|
||||
|
||||
const queryClient = new QueryClient();
|
||||
|
||||
import { ToastContainer } from "react-toastify";
|
||||
import "react-toastify/dist/ReactToastify.css";
|
||||
const router = createHashRouter([
|
||||
{
|
||||
path: "/",
|
||||
|
@ -21,6 +21,15 @@ export default function App() {
|
|||
<QueryClientProvider client={queryClient}>
|
||||
<RouterProvider router={router} />
|
||||
</QueryClientProvider>
|
||||
<ToastContainer
|
||||
autoClose={1500}
|
||||
position="bottom-center"
|
||||
closeOnClick
|
||||
pauseOnHover
|
||||
draggable
|
||||
theme={"light"}
|
||||
limit={3}
|
||||
/>
|
||||
</Provider>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -13,10 +13,10 @@ export default function Button(props: props) {
|
|||
return (
|
||||
<div>
|
||||
<button
|
||||
onClick={props.onClick}
|
||||
onMouseDown={() => {
|
||||
if (!clicked) {
|
||||
props.onClick;
|
||||
setClicked(true);
|
||||
setClicked(!clicked);
|
||||
}
|
||||
}}
|
||||
onMouseUp={() => setClicked(false)}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import Button from "../../Components/Buttons/Button";
|
||||
import styles from "../../Components/styles";
|
||||
import citc_logo from "../../assets/citc_logo.jpg";
|
||||
import { toast } from "react-toastify";
|
||||
export default function LandingPage() {
|
||||
return (
|
||||
<div style={styles.background}>
|
||||
|
@ -45,13 +46,24 @@ export default function LandingPage() {
|
|||
TRACKER
|
||||
</p>
|
||||
<div style={{ ...styles.flex_column }}>
|
||||
<Button type={"light"} label={"Login"} onClick={() => {}} />
|
||||
<Button type={"dark"} label={"Register"} onClick={() => {}} />
|
||||
<Button
|
||||
type={"light"}
|
||||
label={"Login"}
|
||||
onClick={() => {
|
||||
toast("Successfully logged in!");
|
||||
}}
|
||||
/>
|
||||
<Button
|
||||
type={"dark"}
|
||||
label={"Register"}
|
||||
onClick={() => {
|
||||
toast("Redirecting!");
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p>heh</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue