add oauth

This commit is contained in:
Philipp Traber
2024-10-18 18:28:53 +02:00
parent 43d197e05b
commit 34b1d33ffb
26 changed files with 468 additions and 91 deletions
+14 -1
View File
@@ -1,4 +1,6 @@
export function hashToColor(hash: string|null): string {
import toast from "react-hot-toast";
export function hashToColor(hash: string | null): string {
if (!hash) {
return "black";
}
@@ -7,4 +9,15 @@ export function hashToColor(hash: string|null): string {
const b = parseInt(hash.slice(4, 6), 16);
const color = `rgb(${r}, ${g}, ${b})`;
return color;
}
export function handleToast(state: { message: string, error?: any }) {
if (state.message) {
console.log(state);
if (state.error) {
toast.error(state.message);
} else {
toast.success(state.message);
}
}
}