Skip to content

Commit 0554c00

Browse files
committed
Fix grid
1 parent 21e6d00 commit 0554c00

File tree

1 file changed

+14
-27
lines changed

1 file changed

+14
-27
lines changed

app/index.tsx

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ScrollView, RefreshControl, FlatList } from 'react-native';
44
import * as Application from 'expo-application';
55
import { Link, Stack, useRouter } from 'expo-router';
66
import { getHeaderTitle } from '@react-navigation/elements';
7-
import { Appbar, AnimatedFAB, Menu, List } from 'react-native-paper';
7+
import { Appbar, AnimatedFAB, Menu, List, Card as RCard, Text as RText } from 'react-native-paper';
88
import {
99
View,
1010
Button,
@@ -24,8 +24,7 @@ import {
2424
Unspaced,
2525
YGroup,
2626
ListItem,
27-
H6,
28-
Switch
27+
H6
2928
} from 'tamagui'
3029
import { LayoutGrid, List as IconList, CircleEllipsis, FileSearch, X, Settings, Delete, ChevronRight, AArrowDown, AArrowUp } from '@tamagui/lucide-icons';
3130
import { SimpleGrid } from 'react-native-super-grid';
@@ -187,8 +186,8 @@ export default function HomePage() {
187186
gap="$4"
188187
>
189188
<ScrollView>
190-
<Dialog.Title>Settings</Dialog.Title>
191-
<Dialog.Description>
189+
<Dialog.Title paddingBottom="$3">Settings</Dialog.Title>
190+
<Dialog.Description paddingBottom="$3">
192191
Adjust your preferences. Click anywhere outside when you're done.
193192
</Dialog.Description>
194193

@@ -197,7 +196,7 @@ export default function HomePage() {
197196
<ListItem onPress={() => { removeData() }} hoverTheme pressTheme icon={Delete} iconAfter={ChevronRight} title="Clear Data" subTitle={`This will clear all the documents from the 'app data'.`} />
198197
</YGroup.Item>
199198
</YGroup>
200-
<H6>View Options</H6>
199+
<H6 paddingTop="$3" paddingBottom="$2">View Options</H6>
201200
<YGroup alignSelf="center" bordered width="100%" size="$4">
202201
<YGroup.Item>
203202
<ListItem
@@ -252,7 +251,7 @@ export default function HomePage() {
252251
</YGroup.Item>
253252
{/* <ListItem onPress={() => { removeData() }} hoverTheme pressTheme iconAfter={<Switch size="$3" defaultChecked onCheckedChange={handleCheck(isChecked)} value={isChecked}><Switch.Thumb animation="quicker" /></Switch>} title="Show All Filename Extensions" /> */}
254253
</YGroup>
255-
<Separator />
254+
<Separator paddingBottom="$5" />
256255
<XStack alignSelf='center' paddingTop="$5">
257256
<Image style={{ borderRadius: 15 }} source={require('../assets/images/adaptive-icon.png')} width={128} height={128} scale />
258257
<YStack alignSelf='center'>
@@ -348,16 +347,10 @@ export default function HomePage() {
348347
data={sortJsonArray(filteredCards, 'title', 'asc')}
349348
listKey='card'
350349
renderItem={({ item }) => (
351-
<Link href={{ pathname: '/pdf/[id]', params: { id: item.id as number, title: item.title as string, path: item.path as string } }}>
352-
<Card size="$2" key={item.id} width={100} height={150} padding="$1">
353-
<Card.Header borderRadius="$2" maxHeight="75%">
354-
<Image style={{ borderRadius: 10 }} source={item.thumbnail as string} placeholder={blurhash} cachePolicy="memory" contentFit='contain' width="100%" height="100%" scale />
355-
</Card.Header>
356-
<Card.Footer paddingHorizontal="$2">
357-
<SizableText size="$1">{item.title}</SizableText>
358-
</Card.Footer>
359-
</Card>
360-
</Link>
350+
<RCard onPress={() => { router.push({ pathname: '/pdf/[id]', params: { id: item.id as number, title: item.title as string, path: item.path as string } }) }}>
351+
<RCard.Cover source={{ uri: item.thumbnail }} />
352+
<RCard.Title title={item.title} />
353+
</RCard>
361354
)}
362355
/>
363356
</ScrollView>
@@ -369,16 +362,10 @@ export default function HomePage() {
369362
data={sortJsonArray(filteredCards, 'title', 'des')}
370363
listKey='card'
371364
renderItem={({ item }) => (
372-
<Link href={{ pathname: '/pdf/[id]', params: { id: item.id as number, title: item.title as string, path: item.path as string } }}>
373-
<Card size="$2" key={item.id} width={100} height={150} padding="$1">
374-
<Card.Header borderRadius="$2" maxHeight="75%">
375-
<Image style={{ borderRadius: 10 }} source={item.thumbnail as string} placeholder={blurhash} cachePolicy="memory" contentFit='contain' width="100%" height="100%" scale />
376-
</Card.Header>
377-
<Card.Footer paddingHorizontal="$2">
378-
<SizableText size="$1">{item.title}</SizableText>
379-
</Card.Footer>
380-
</Card>
381-
</Link>
365+
<RCard onPress={() => { router.push({ pathname: '/pdf/[id]', params: { id: item.id as number, title: item.title as string, path: item.path as string } }) }}>
366+
<RCard.Cover source={{ uri: item.thumbnail }} />
367+
<RCard.Title titleVariant="labelLarge" title={item.title} />
368+
</RCard>
382369
)}
383370
/>
384371
</ScrollView>

0 commit comments

Comments
 (0)