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(() => {
|
useEffect(() => {
|
||||||
let params = new URLSearchParams(location.search);
|
const params = new URLSearchParams(location.search);
|
||||||
let embedded = params.get("embedded");
|
const embedded = params.get("embedded");
|
||||||
embedded!="true" && setShowNav(true)
|
embedded!="true" && setShowNav(true)
|
||||||
}, [location]);
|
}, [location]);
|
||||||
|
|
||||||
|
|||||||
@ -53,12 +53,12 @@ export function SideBar({ routes, bottomRoutes }: { routes: route[], bottomRoute
|
|||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let params = new URLSearchParams(location.search);
|
const params = new URLSearchParams(location.search);
|
||||||
let embedded = params.get("embedded");
|
const embedded = params.get("embedded");
|
||||||
embedded != "true" && setEmbedded(false)
|
embedded != "true" && setEmbedded(false)
|
||||||
}, [location]);
|
}, [location]);
|
||||||
|
|
||||||
let params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<nav
|
<nav
|
||||||
|
|||||||
@ -21,10 +21,10 @@ type AuthContextProps = {
|
|||||||
user: UserItem | null;
|
user: UserItem | null;
|
||||||
login: (credentials: AuthCredentials) => Promise<UserItem | undefined>,
|
login: (credentials: AuthCredentials) => Promise<UserItem | undefined>,
|
||||||
register: (credentials: AuthCredentials, userName: string) => Promise<UserItem | undefined>,
|
register: (credentials: AuthCredentials, userName: string) => Promise<UserItem | undefined>,
|
||||||
loading: Boolean,
|
loading: boolean,
|
||||||
logout: () => Promise<any>,
|
logout: () => Promise<any>,
|
||||||
updateUser: (user: UserItem) => any,
|
updateUser: (user: UserItem) => any,
|
||||||
token: String | null,
|
token: string | null,
|
||||||
requestPasswordReset: (email:string, reset_url: string) => Promise<any>,
|
requestPasswordReset: (email:string, reset_url: string) => Promise<any>,
|
||||||
passwordReset: (token:string, new_password: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) => {
|
export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
|
||||||
const [user, setUser] = useState<UserItem | null>(null);
|
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 [loading, setLoading] = useState<boolean>(false);
|
||||||
const isAuthenticated = !!user;
|
const isAuthenticated = !!user;
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
|
|||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
throw error;
|
throw error;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const register = async (credentials: AuthCredentials, userName): Promise<UserItem | undefined> => {
|
const register = async (credentials: AuthCredentials, userName): Promise<UserItem | undefined> => {
|
||||||
@ -93,7 +93,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
|
|||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
throw error;
|
throw error;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
|
|||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
throw error;
|
throw error;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateUser = async (user: UserItem) => {
|
const updateUser = async (user: UserItem) => {
|
||||||
@ -120,7 +120,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
|
|||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
throw error;
|
throw error;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const requestPasswordReset = async (email: string, reset_url?: string): Promise<any> => {
|
const requestPasswordReset = async (email: string, reset_url?: string): Promise<any> => {
|
||||||
@ -131,7 +131,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
|
|||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
throw error;
|
throw error;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ export const AuthProvider = ({ userApi, children }: AuthProviderProps) => {
|
|||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
throw error;
|
throw error;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -27,13 +27,13 @@ export function TextAreaInput({ labelTitle, dataField, labelStyle, containerStyl
|
|||||||
|
|
||||||
const tags = useTags();
|
const tags = useTags();
|
||||||
|
|
||||||
let values: KeyValue[] = [];
|
const values: KeyValue[] = [];
|
||||||
|
|
||||||
tags.forEach(tag => {
|
tags.forEach(tag => {
|
||||||
values.push({ key: tag.name, value: tag.name, color: tag.color });
|
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',
|
containerClass: 'tw-z-3000 tw-bg-base-100 tw-p-2 tw-rounded-lg tw-shadow',
|
||||||
selectClass: 'tw-font-bold',
|
selectClass: 'tw-font-bold',
|
||||||
trigger: "#",
|
trigger: "#",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user