mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-26 06:46:40 +00:00
I18n additionals (#125)
* New translation keys * Updates in src/components * Updates in src/providers * remove lable in selector, not needed --------- Co-authored-by: Lokowitz <marvinlokowitz@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import UserContext from "@app/contexts/userContext";
|
||||
import { GetUserResponse } from "@server/routers/user";
|
||||
import { useState } from "react";
|
||||
import { useTranslations } from "next-intl";
|
||||
|
||||
interface UserProviderProps {
|
||||
children: React.ReactNode;
|
||||
@@ -12,9 +13,11 @@ interface UserProviderProps {
|
||||
export function UserProvider({ children, user: u }: UserProviderProps) {
|
||||
const [user, setUser] = useState<GetUserResponse>(u);
|
||||
|
||||
const t = useTranslations();
|
||||
|
||||
const updateUser = (updatedUser: Partial<GetUserResponse>) => {
|
||||
if (!user) {
|
||||
throw new Error("No user to update");
|
||||
throw new Error(t('userErrorNoUpdate'));
|
||||
}
|
||||
setUser((prev) => {
|
||||
if (!prev) {
|
||||
|
||||
Reference in New Issue
Block a user