Skip to content
Merged
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
47 changes: 44 additions & 3 deletions gs/frontend/aro/package-lock.json

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

1 change: 1 addition & 0 deletions gs/frontend/aro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"react": "^19.1.1",
"react-dom": "^19.1.1",
"react-router-dom": "^7.9.2",
"react-toastify": "^11.0.5",
"tailwindcss": "^4.1.13"
},
"devDependencies": {
Expand Down
45 changes: 45 additions & 0 deletions gs/frontend/aro/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;
3 changes: 3 additions & 0 deletions gs/frontend/aro/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Routes } from "react-router-dom";
import { ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import Nav from "./components/Nav";
import Background from "./components/Background";

Expand All @@ -21,6 +23,7 @@ function App() {
<Route path="/profile" element={<Profile />} />
<Route path="/login" element={<Login />} /> */}
</Routes>
<ToastContainer />
</>
);
}
Expand Down
14 changes: 14 additions & 0 deletions gs/frontend/mcc/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/mcc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
"@radix-ui/react-separator": "^1.1.7",
"@radix-ui/react-slot": "^1.2.3",
"@tailwindcss/vite": "^4.1.13",
"@tanstack/react-table": "^8.21.3",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^0.544.0",
"@tanstack/react-table": "^8.21.3",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"react-router-dom": "^7.8.2",
"react-toastify": "^11.0.5",
"tailwind-merge": "^3.3.1",
"tailwindcss": "^4.1.13"
},
Expand Down
3 changes: 3 additions & 0 deletions gs/frontend/mcc/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Routes, Route } from "react-router-dom";
import { ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import Nav from "./components/Nav";
import Background from "./components/Background";
import Commands from "./pages/Command/Commands";
Expand All @@ -23,6 +25,7 @@ function App() {
<Route path="/aro-requests" element={<LiveSession />} />
<Route path="/login" element={<Login />} />
</Routes>
<ToastContainer />
</>
);
}
Expand Down
45 changes: 45 additions & 0 deletions gs/frontend/mcc/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