improve account style

This commit is contained in:
Patryk
2025-06-08 11:23:09 +02:00
parent e2e5543e0d
commit dbf07cea0a
3 changed files with 13 additions and 9 deletions

View File

@@ -8,12 +8,12 @@ import { ActivityIndicator } from "react-native";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { getUserById } from "@/api/client"; import { getUserById } from "@/api/client";
import { HStack } from "@gluestack-ui/themed"; import { HStack } from "@gluestack-ui/themed";
import { useAuthStore } from "@/store/authStore";
export default function Account() { export default function Account() {
const [user, setUser] = useState(null); const [user, setUser] = useState(null);
const [isLoading, setIsLoading] = useState(true); 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(() => { useEffect(() => {
const fetchUser = async () => { const fetchUser = async () => {
setIsLoading(true); setIsLoading(true);
@@ -37,9 +37,10 @@ export default function Account() {
return <Text>Nie udało się pobrać danych użytkownika.</Text>; return <Text>Nie udało się pobrać danych użytkownika.</Text>;
} }
console.log(user);
return ( return (
<VStack className="bg-gray-50 flex-1"> <VStack className=" flex-1 m-2">
<Box className="bg-white pb-6 shadow-sm"> <Box className="bg-white p-5 rounded-lg ">
<Box className="items-center pt-6 mb-4"> <Box className="items-center pt-6 mb-4">
<Image <Image
source={{ source={{
@@ -57,12 +58,12 @@ export default function Account() {
</Text> </Text>
</Box> </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> <Text className="font-bold text-lg mb-3">Moje dane</Text>
<HStack className="mb-3"> <HStack className="mb-3">
<Text className="text-gray-600 w-24">E-mail</Text> <Text className="text-gray-600 w-24">E-mail: </Text>
<Text className="flex-1">{user.email || "brak danych"}</Text> <Text className=" text-gray-600 ">{user.email}</Text>
</HStack> </HStack>
<Pressable <Pressable
@@ -73,7 +74,7 @@ export default function Account() {
</Pressable> </Pressable>
</Box> </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> <Text className="font-bold text-lg mb-3">Moje konto</Text>
<Link href="/dashboard/userNotices" asChild> <Link href="/dashboard/userNotices" asChild>

View File

@@ -35,7 +35,7 @@ export default function UserNotices() {
} }
return ( return (
<VStack className="p-4"> <VStack className="p-2">
{/* <Text className="text-2xl font-bold mb-4">Moje ogłoszenia</Text> */} {/* <Text className="text-2xl font-bold mb-4">Moje ogłoszenia</Text> */}
{userNotices.length > 0 ? ( {userNotices.length > 0 ? (
<FlatList <FlatList

View File

@@ -368,6 +368,9 @@ export default function Notices() {
<FlatList <FlatList
data={filteredNotices} data={filteredNotices}
numColumns={2} numColumns={2}
// numColumns={2}
// columnContainerClassName="m-2"
columnWrapperClassName="m-2"
columnWrapperStyle={{ gap: 8, marginHorizontal: 8 }} columnWrapperStyle={{ gap: 8, marginHorizontal: 8 }}
contentContainerStyle={{ paddingBottom: 16 }} contentContainerStyle={{ paddingBottom: 16 }}
renderItem={({ item }) => <NoticeCard notice={item} />} renderItem={({ item }) => <NoticeCard notice={item} />}