add simple home section
This commit is contained in:
31
ArtisanConnect/components/NoticeSection.jsx
Normal file
31
ArtisanConnect/components/NoticeSection.jsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import { View} from 'react-native';
|
||||
import { Heading } from '@/components/ui/heading';
|
||||
import { FlatList } from 'react-native';
|
||||
import {NoticeCard} from "@/components/NoticeCard";
|
||||
import { Box } from '@/components/ui/box';
|
||||
import { HStack } from "@/components/ui/hstack"
|
||||
import { VStack } from '@/components/ui/vstack';
|
||||
import { Button, ButtonText } from "@/components/ui/button"
|
||||
|
||||
export function NoticeSection({ notices, title }) {
|
||||
const rows = [];
|
||||
for (let i = 0; i < notices.length; i += 2) {
|
||||
rows.push(
|
||||
<HStack key={i} space="md">
|
||||
<NoticeCard notice={notices[i]} />
|
||||
{notices[i + 1] && <NoticeCard notice={notices[i + 1]} />}
|
||||
</HStack>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<View className="mb-6">
|
||||
<Heading className="text-2xl font-bold mb-4 mt-4">{title}</Heading>
|
||||
<VStack space="md">
|
||||
{rows}
|
||||
</VStack>
|
||||
<Button className="mt-6" size="md" variant="solid" action="primary">
|
||||
<ButtonText>Zobacz więcej</ButtonText>
|
||||
</Button>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user