improve account style
This commit is contained in:
@@ -8,12 +8,12 @@ import { ActivityIndicator } from "react-native";
|
||||
import { useEffect, useState } from "react";
|
||||
import { getUserById } from "@/api/client";
|
||||
import { HStack } from "@gluestack-ui/themed";
|
||||
import { useAuthStore } from "@/store/authStore";
|
||||
|
||||
export default function Account() {
|
||||
const [user, setUser] = useState(null);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const currentUserId = 2; // Tymczasowo, do czasu zaimplementowania logowania bo nie moge pobrac usera
|
||||
|
||||
const currentUserId = useAuthStore((state) => state.user_id);
|
||||
useEffect(() => {
|
||||
const fetchUser = async () => {
|
||||
setIsLoading(true);
|
||||
@@ -37,9 +37,10 @@ export default function Account() {
|
||||
return <Text>Nie udało się pobrać danych użytkownika.</Text>;
|
||||
}
|
||||
|
||||
console.log(user);
|
||||
return (
|
||||
<VStack className="bg-gray-50 flex-1">
|
||||
<Box className="bg-white pb-6 shadow-sm">
|
||||
<VStack className=" flex-1 m-2">
|
||||
<Box className="bg-white p-5 rounded-lg ">
|
||||
<Box className="items-center pt-6 mb-4">
|
||||
<Image
|
||||
source={{
|
||||
@@ -57,12 +58,12 @@ export default function Account() {
|
||||
</Text>
|
||||
</Box>
|
||||
|
||||
<Box className="bg-white mt-4 p-5 border-t border-b border-gray-200">
|
||||
<Box className="bg-white mt-4 p-5 rounded-lg">
|
||||
<Text className="font-bold text-lg mb-3">Moje dane</Text>
|
||||
|
||||
<HStack className="mb-3">
|
||||
<Text className="text-gray-600 w-24">E-mail</Text>
|
||||
<Text className="flex-1">{user.email || "brak danych"}</Text>
|
||||
<Text className="text-gray-600 w-24">E-mail: </Text>
|
||||
<Text className=" text-gray-600 ">{user.email}</Text>
|
||||
</HStack>
|
||||
|
||||
<Pressable
|
||||
@@ -73,7 +74,7 @@ export default function Account() {
|
||||
</Pressable>
|
||||
</Box>
|
||||
|
||||
<Box className="bg-white mt-4 p-5">
|
||||
<Box className="bg-white mt-4 p-5 rounded-lg">
|
||||
<Text className="font-bold text-lg mb-3">Moje konto</Text>
|
||||
|
||||
<Link href="/dashboard/userNotices" asChild>
|
||||
|
||||
@@ -35,7 +35,7 @@ export default function UserNotices() {
|
||||
}
|
||||
|
||||
return (
|
||||
<VStack className="p-4">
|
||||
<VStack className="p-2">
|
||||
{/* <Text className="text-2xl font-bold mb-4">Moje ogłoszenia</Text> */}
|
||||
{userNotices.length > 0 ? (
|
||||
<FlatList
|
||||
|
||||
@@ -368,6 +368,9 @@ export default function Notices() {
|
||||
<FlatList
|
||||
data={filteredNotices}
|
||||
numColumns={2}
|
||||
// numColumns={2}
|
||||
// columnContainerClassName="m-2"
|
||||
columnWrapperClassName="m-2"
|
||||
columnWrapperStyle={{ gap: 8, marginHorizontal: 8 }}
|
||||
contentContainerStyle={{ paddingBottom: 16 }}
|
||||
renderItem={({ item }) => <NoticeCard notice={item} />}
|
||||
|
||||
Reference in New Issue
Block a user