Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.ko
*.obj
*.elf
.DS_Store

# Linker output
*.ilk
Expand Down
49 changes: 45 additions & 4 deletions gs/frontend/aro/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion gs/frontend/aro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
},
"dependencies": {
"@tailwindcss/vite": "^4.1.13",
"react": "^19.1.1",
"react": "^19.2.0",
"react-dom": "^19.1.1",
"react-router-dom": "^7.9.2",
"react-toastify": "^11.0.5",
"tailwindcss": "^4.1.13"
},
"devDependencies": {
Expand Down
4 changes: 4 additions & 0 deletions gs/frontend/aro/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { Routes } from "react-router-dom";
import Nav from "./components/Nav";
import Background from "./components/Background";

import { ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';

/**
* @brief App component displaying the main application
* @return tsx element of App component
Expand All @@ -21,6 +24,7 @@ function App() {
<Route path="/profile" element={<Profile />} />
<Route path="/login" element={<Login />} /> */}
</Routes>
<ToastContainer />
</>
);
}
Expand Down
45 changes: 45 additions & 0 deletions gs/frontend/aro/src/services/Toast.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { toast, type ToastOptions } from "react-toastify";

const baseToastConfig: ToastOptions = {
position: "top-right",
autoClose: 4900,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
theme: "dark",
};

/**
* Displays a success toast notification.
* Uses Tailwind classes directly for styling.
*/
export const success = (message: string): void => {
toast.success(message, {
...baseToastConfig,
className:
"bg-black/75 border border-green-500 text-green-100 rounded-md shadow-md text-sm font-medium",
progressClassName: "bg-green-500",
});
};

/**
* Displays an error toast notification.
* Uses Tailwind classes directly for styling.
*/
export const error = (message: string): void => {
toast.error(message, {
...baseToastConfig,
className:
"bg-black/75 border border-red-500 text-red-100 rounded-md shadow-md text-sm font-medium",
progressClassName: "bg-red-500",
});
};

const toastService = {
success,
error,
};

export default toastService;
Loading
Loading