mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
fixable errors
This commit is contained in:
parent
d2fb6c72ec
commit
d115a1331b
@ -39,8 +39,8 @@ export default function NavBar({ appName, userType}: { appName: string, userType
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
let params = new URLSearchParams(location.search);
|
||||
let embedded = params.get("embedded");
|
||||
const params = new URLSearchParams(location.search);
|
||||
const embedded = params.get("embedded");
|
||||
embedded!="true" && setShowNav(true)
|
||||
}, [location]);
|
||||
|
||||
|
||||
@ -53,12 +53,12 @@ export function SideBar({ routes, bottomRoutes }: { routes: route[], bottomRoute
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
let params = new URLSearchParams(location.search);
|
||||
let embedded = params.get("embedded");
|
||||
const params = new URLSearchParams(location.search);
|
||||
const embedded = params.get("embedded");
|
||||
embedded != "true" && setEmbedded(false)
|
||||
}, [location]);
|
||||
|
||||
let params = new URLSearchParams(window.location.search);
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
|
||||
return (
|
||||
<nav
|
||||
|
||||
@ -21,10 +21,10 @@ type AuthContextProps = {
|
||||
user: UserItem | null;
|
||||
login: (credentials: AuthCredentials) => Promise<UserItem | undefined>,
|
||||
register: (credentials: AuthCredentials, userName: string) => Promise<UserItem | undefined>,
|
||||
loading: Boolean,
|
||||
loading: boolean,
|
||||
logout: () => Promise<any>,
|
||||
updateUser: (user: UserItem) => any,
|
||||
token: String | null,
|
||||
token: string | null,
|
||||
requestPasswordReset: (email:string, reset_url: string) => Promise<any>,
|
||||
passwordReset: (token:string, new_password:string) => Promise<any>
|
||||
}
|
||||
@ -44,7 +44,7 @@ const AuthContext = createContext<AuthContextProps>({
|
||||
|
||||
export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
|
||||
const [user, setUser] = useState<UserItem | null>(null);
|
||||
const [token, setToken] = useState<String | null>(null);
|
||||
const [token, setToken] = useState<string | null>(null);
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
const isAuthenticated = !!user;
|
||||
|
||||
@ -82,7 +82,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
|
||||
} catch (error: any) {
|
||||
setLoading(false);
|
||||
throw error;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
const register = async (credentials: AuthCredentials, userName): Promise<UserItem | undefined> => {
|
||||
@ -93,7 +93,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
|
||||
} catch (error: any) {
|
||||
setLoading(false);
|
||||
throw error;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -104,7 +104,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
|
||||
} catch (error: any) {
|
||||
setLoading(false);
|
||||
throw error;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
const updateUser = async (user: UserItem) => {
|
||||
@ -120,7 +120,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
|
||||
} catch (error: any) {
|
||||
setLoading(false);
|
||||
throw error;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
const requestPasswordReset = async (email: string, reset_url?: string): Promise<any> => {
|
||||
@ -131,7 +131,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
|
||||
} catch (error: any) {
|
||||
setLoading(false);
|
||||
throw error;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -143,7 +143,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
|
||||
} catch (error: any) {
|
||||
setLoading(false);
|
||||
throw error;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -27,13 +27,13 @@ export function TextAreaInput({ labelTitle, dataField, labelStyle, containerStyl
|
||||
|
||||
const tags = useTags();
|
||||
|
||||
let values: KeyValue[] = [];
|
||||
const values: KeyValue[] = [];
|
||||
|
||||
tags.forEach(tag => {
|
||||
values.push({ key: tag.name, value: tag.name, color: tag.color });
|
||||
});
|
||||
|
||||
var tribute = new Tribute({
|
||||
const tribute = new Tribute({
|
||||
containerClass: 'tw-z-3000 tw-bg-base-100 tw-p-2 tw-rounded-lg tw-shadow',
|
||||
selectClass: 'tw-font-bold',
|
||||
trigger: "#",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user