removed hardcoded asset api

This commit is contained in:
Anton Tranelis 2025-03-04 17:34:23 +00:00
parent 5c18ed2abd
commit 5ddac25e81

View File

@ -8,6 +8,8 @@ import { toast } from 'react-toastify'
import { useAuth } from '#components/Auth/useAuth' import { useAuth } from '#components/Auth/useAuth'
import { useItems } from '#components/Map/hooks/useItems' import { useItems } from '#components/Map/hooks/useItems'
import { useAppState } from './hooks/useAppState'
import type { Item } from '#types/Item' import type { Item } from '#types/Item'
export default function NavBar({ appName }: { appName: string }) { export default function NavBar({ appName }: { appName: string }) {
@ -24,7 +26,7 @@ export default function NavBar({ appName }: { appName: string }) {
: setUserProfile({ id: crypto.randomUUID(), name: user?.first_name ?? '', text: '' }) : setUserProfile({ id: crypto.randomUUID(), name: user?.first_name ?? '', text: '' })
}, [user, items]) }, [user, items])
// useEffect(() => {}, [userProfile]) const appState = useAppState()
const nameRef = useRef<HTMLHeadingElement>(null) const nameRef = useRef<HTMLHeadingElement>(null)
const [nameWidth, setNameWidth] = useState<number>(0) const [nameWidth, setNameWidth] = useState<number>(0)
@ -103,7 +105,7 @@ export default function NavBar({ appName }: { appName: string }) {
{userProfile.image && ( {userProfile.image && (
<div className='tw-avatar'> <div className='tw-avatar'>
<div className='tw-w-10 tw-rounded-full'> <div className='tw-w-10 tw-rounded-full'>
<img src={'https://api.utopia-lab.org/assets/' + userProfile.image} /> <img src={appState.assetsApi.url + userProfile.image} />
</div> </div>
</div> </div>
)} )}