add link to user section home
This commit is contained in:
@@ -1,23 +1,35 @@
|
|||||||
import { VStack } from '@/components/ui/vstack';
|
import { VStack } from "@/components/ui/vstack";
|
||||||
import { Avatar, AvatarImage, AvatarFallbackText } from "@/components/ui/avatar";
|
import {
|
||||||
|
Avatar,
|
||||||
|
AvatarImage,
|
||||||
|
AvatarFallbackText,
|
||||||
|
} from "@/components/ui/avatar";
|
||||||
import { Heading } from "@/components/ui/heading";
|
import { Heading } from "@/components/ui/heading";
|
||||||
import { Box } from '@/components/ui/box';
|
import { Box } from "@/components/ui/box";
|
||||||
|
import { Link } from "expo-router";
|
||||||
|
|
||||||
export default function UserBlock({ user }) {
|
export default function UserBlock({ user }) {
|
||||||
|
return (
|
||||||
return (
|
<Link href={`/user/${user.id}`}>
|
||||||
<Box className="rounded-md bg-white p-4 items-center justify-center mb-6" >
|
<Box className="rounded-md bg-white p-4 items-center justify-center mb-6">
|
||||||
<VStack space="md" className='items-center'>
|
<VStack space="md" className="items-center">
|
||||||
<Avatar>
|
<Avatar>
|
||||||
<AvatarFallbackText>{user.firstName} {user.lastName}</AvatarFallbackText>
|
<AvatarFallbackText>
|
||||||
<AvatarImage
|
{user.firstName} {user.lastName}
|
||||||
source={{
|
</AvatarFallbackText>
|
||||||
uri: user.image,
|
<AvatarImage
|
||||||
}}
|
source={{
|
||||||
/>
|
uri:
|
||||||
</Avatar>
|
user.image ||
|
||||||
<Heading size="sm">{user.firstName} {user.lastName}</Heading>
|
"https://th.bing.com/th/id/OIP.3coo_N8sieled8QNroQmkgHaHa?rs=1&pid=ImgDetMain",
|
||||||
</VStack>
|
}}
|
||||||
|
/>
|
||||||
|
</Avatar>
|
||||||
|
<Heading size="sm">
|
||||||
|
{user.firstName} {user.lastName}
|
||||||
|
</Heading>
|
||||||
|
</VStack>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
</Link>
|
||||||
}
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ export function UserSection({ notices, title }) {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (token) {
|
if (token) {
|
||||||
axios
|
axios
|
||||||
.get("https://hopp.zikor.pl/api/v1/clients/get/all", { headers })
|
.get("https://hopp.zikor.pl/api/v1/clients/get/all", {
|
||||||
|
headers: headers,
|
||||||
|
})
|
||||||
.then((res) => setUsers(res.data))
|
.then((res) => setUsers(res.data))
|
||||||
.catch(() => setUsers([]));
|
.catch(() => setUsers([]));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user