diff --git a/package-lock.json b/package-lock.json index 4f864225..e39bde35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,13 @@ { "name": "utopia-ui", - "version": "3.0.0-alpha.186", + + "version": "3.0.0-alpha.194", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "utopia-ui", - "version": "3.0.0-alpha.186", + "version": "3.0.0-alpha.194", "license": "MIT", "dependencies": { "@heroicons/react": "^2.0.17", diff --git a/package.json b/package.json index 69ad13f6..241d7c26 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "utopia-ui", - "version": "3.0.0-alpha.186", + "version": "3.0.0-alpha.194", "description": "Reuseable React Components to build mapping apps for real life communities and networks", "repository": "https://github.com/utopia-os/utopia-ui", "homepage:": "https://utopia-os.org/", diff --git a/src/Components/AppShell/AppShell.tsx b/src/Components/AppShell/AppShell.tsx index 6be2a031..ee6e7c20 100644 --- a/src/Components/AppShell/AppShell.tsx +++ b/src/Components/AppShell/AppShell.tsx @@ -16,7 +16,7 @@ import { LeafletRefsProvider } from '../Map/hooks/useLeafletRefs' import { SelectPositionProvider } from '../Map/hooks/useSelectPosition' import { ClusterRefProvider } from '../Map/hooks/useClusterRef' -export function AppShell({ appName, children, assetsApi }: { appName: string, children: React.ReactNode, assetsApi: AssetsApi }) { +export function AppShell({ appName, children, assetsApi, userType }: { appName: string, children: React.ReactNode, assetsApi: AssetsApi, userType: string }) { // Create a client const queryClient = new QueryClient() @@ -47,7 +47,7 @@ export function AppShell({ appName, children, assetsApi }: { appName: string, ch pauseOnHover theme="light" />
- +
{children}
diff --git a/src/Components/AppShell/NavBar.tsx b/src/Components/AppShell/NavBar.tsx index ab62cd8f..055d9099 100644 --- a/src/Components/AppShell/NavBar.tsx +++ b/src/Components/AppShell/NavBar.tsx @@ -7,7 +7,7 @@ import { useItems } from "../Map/hooks/useItems"; import { Item } from "../../types"; -export default function NavBar({ appName}: { appName: string }) { +export default function NavBar({ appName, userType}: { appName: string, userType: string }) { const { isAuthenticated, user, logout } = useAuth(); @@ -16,7 +16,7 @@ export default function NavBar({ appName}: { appName: string }) { const items = useItems(); useEffect(() => { - const profile = user && items.find(i => (i.user_created?.id === user.id) && i.layer?.itemType.name === "user"); + const profile = user && items.find(i => (i.user_created?.id === user.id) && i.layer?.itemType.name === userType); profile ? setUserProfile(profile) : setUserProfile({id: crypto.randomUUID(), name: user?.first_name, text: ""}); }, [user, items]) @@ -86,12 +86,14 @@ export default function NavBar({ appName}: { appName: string }) { {isAuthenticated ?
- { userProfile?.image?
+ + { userProfile?.image &&
-
: <>} +
}
{userProfile.name||user?.first_name}
+