diff --git a/app/[locale]/account-required/page.tsx b/app/[locale]/account-required/page.tsx index 966f717b..2ed0f54d 100644 --- a/app/[locale]/account-required/page.tsx +++ b/app/[locale]/account-required/page.tsx @@ -2,10 +2,11 @@ import Button from '@/components/Buttons/Button'; import Link from 'next/link'; -import { useTranslations } from 'next-intl'; +import { useLocale, useTranslations } from 'next-intl'; export default function AccountRequired() { const t = useTranslations('AccountRequired'); + const locale = useLocale(); return (
@@ -19,10 +20,10 @@ export default function AccountRequired() { {t('should-login')}

- + - +
diff --git a/app/[locale]/admin/lockedList/page.tsx b/app/[locale]/admin/lockedList/page.tsx index 8e998c34..aab20bf7 100644 --- a/app/[locale]/admin/lockedList/page.tsx +++ b/app/[locale]/admin/lockedList/page.tsx @@ -46,10 +46,10 @@ export default function LockedList() { async function unlockAccount(uid: string) { // get account of the person reported and set accountLocked to false - updateDoc(doc(db.users, uid), { + await updateDoc(doc(db.users, uid), { accountLocked: false, }); - window.location.reload(); + setBanned((curr) => curr.filter((bannedUser) => bannedUser.userId !== uid)); } return ( @@ -67,16 +67,6 @@ export default function LockedList() {

{user.name}

- -
-
diff --git a/components/Buttons/LinkButton/LinkButtonNoNumber.tsx b/components/Buttons/LinkButton/LinkButtonNoNumber.tsx index 7e3702c8..7a6275c1 100644 --- a/components/Buttons/LinkButton/LinkButtonNoNumber.tsx +++ b/components/Buttons/LinkButton/LinkButtonNoNumber.tsx @@ -17,7 +17,8 @@ const LinkButtonNoNumber = ({ const { currentUser, authUser } = useAuth(); // User sending out the request const [linkIds, setLinkIds] = useState(currentUser.linkedUserIds); return ( - posterUID !== authUser.uid && ( + posterUID !== authUser.uid && + !currentUser.isCompany && ( + ); + } + return ( ); } diff --git a/contexts/AuthContext.tsx b/contexts/AuthContext.tsx index 07108177..60e8cdac 100644 --- a/contexts/AuthContext.tsx +++ b/contexts/AuthContext.tsx @@ -20,6 +20,8 @@ import { deleteDoc, doc, getDoc, setDoc } from 'firebase/firestore'; import md5 from 'md5'; import { useRouter } from 'next/navigation'; import { useLocale } from 'next-intl'; +import LoadingScreen from '@/components/Loading/Loading'; +import NavBar from '@/components/NavBar/NavBar'; interface AuthContextType { currentUser: User; @@ -254,9 +256,17 @@ export function AuthProvider({ children }) { [currentUser, currentAdmin, authUser] ); + // Render loading screen instead of page content while authentication loading return ( - {!loading && children} + {loading ? ( +
+ + +
+ ) : ( + children + )}
); } diff --git a/translations/de.json b/translations/de.json index b33672b2..5f38ee5f 100644 --- a/translations/de.json +++ b/translations/de.json @@ -370,6 +370,9 @@ "loading": "Wird geladen...", "invalid": "Ungültiger Benutzer.", "links": { + "view-your-links": "Mal sehen, wer Ihre Links sind.", + "view-other-links-start": "Mal sehen, wer", + "view-other-links-end": "s Links sind.", "login-first": "Sie sollten sich zuerst anmelden.", "sign-in": "Anmelden", "register": "Registrieren", diff --git a/translations/en.json b/translations/en.json index d0eb54ad..a3835f23 100644 --- a/translations/en.json +++ b/translations/en.json @@ -370,6 +370,9 @@ "loading": "Loading...", "invalid": "Invalid User.", "links": { + "view-your-links": "Let's see who your links are.", + "view-other-links-start": "Let's see who", + "view-other-links-end": "'s links are.", "login-first": "You should login first.", "sign-in": "Sign In", "register": "Register", @@ -450,7 +453,7 @@ "should-login": "You should login first.", "login": "Login", "register": "Register", - "confirm-unsaved": "Unsaved changes will be lost. Conitnue?", + "confirm-unsaved": "Unsaved changes will be lost. Continue?", "alert-success": "Successfully updated your profile!", "edit-profile": "Edit Profile", "save": "Save Changes",