add props and link to home section
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { View} from 'react-native';
|
||||
import { View, FlatList} from 'react-native';
|
||||
import { useEffect, useState } from 'react'
|
||||
import { Heading } from '@/components/ui/heading';
|
||||
import { Text } from '@/components/ui/text';
|
||||
// import { useNoticesStore } from '@/store/noticesStore';
|
||||
import { Link } from 'expo-router';
|
||||
import { Pressable } from '@/components/ui/pressable';
|
||||
import { FlatList } from 'react-native';
|
||||
import axios from 'axios';
|
||||
|
||||
export function CategorySection({notices, title}) {
|
||||
@@ -38,11 +37,13 @@ return (
|
||||
renderItem={({ item }) => {
|
||||
const categoryObj = categoryMap.find((cat) => cat.value === item);
|
||||
return (
|
||||
<Link href={`/notices?category=${item}`} asChild>
|
||||
<Pressable className="bg-gray-200 p-4 rounded-lg mr-2">
|
||||
<Text>
|
||||
{categoryObj ? categoryObj.label : item} ({getCount(item)})
|
||||
</Text>
|
||||
</Pressable>
|
||||
</Link>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user