Skip to content

Commit 25b9d42

Browse files
committed
fix: fix issues related to web support
1 parent 10d816c commit 25b9d42

File tree

4 files changed

+22
-19
lines changed

4 files changed

+22
-19
lines changed

src/app/(app)/_layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ export default function TabLayout() {
6767
const CreateNewPostLink = () => {
6868
return (
6969
<Link href="/feed/add-post" asChild>
70-
<Pressable className="px-3">
71-
<Text className="text-primary-300">Create</Text>
70+
<Pressable>
71+
<Text className="px-3 text-primary-300">Create</Text>
7272
</Pressable>
7373
</Link>
7474
);

src/components/card.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,22 @@ const images = [
1717
export const Card = ({ title, body, id }: Props) => {
1818
return (
1919
<Link href={`/feed/${id}`} asChild>
20-
<Pressable className="m-2 overflow-hidden rounded-xl border border-neutral-300 bg-white dark:bg-neutral-900">
21-
<Image
22-
className="h-56 w-full overflow-hidden rounded-t-xl"
23-
contentFit="cover"
24-
source={{
25-
uri: images[Math.floor(Math.random() * images.length)],
26-
}}
27-
/>
20+
<Pressable>
21+
<View className="m-2 overflow-hidden rounded-xl border border-neutral-300 bg-white dark:bg-neutral-900">
22+
<Image
23+
className="h-56 w-full overflow-hidden rounded-t-xl"
24+
contentFit="cover"
25+
source={{
26+
uri: images[Math.floor(Math.random() * images.length)],
27+
}}
28+
/>
2829

29-
<View className="p-2">
30-
<Text className="py-3 text-2xl ">{title}</Text>
31-
<Text numberOfLines={3} className="leading-snug text-gray-600">
32-
{body}
33-
</Text>
30+
<View className="p-2">
31+
<Text className="py-3 text-2xl ">{title}</Text>
32+
<Text numberOfLines={3} className="leading-snug text-gray-600">
33+
{body}
34+
</Text>
35+
</View>
3436
</View>
3537
</Pressable>
3638
</Link>

src/ui/input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export function ControlledInput<T extends FieldValues>(
132132
ref={field.ref}
133133
autoCapitalize="none"
134134
onChangeText={field.onChange}
135-
value={field.value as string}
135+
value={(field.value as string) || ''}
136136
{...inputProps}
137137
error={fieldState.error?.message}
138138
/>

src/ui/select.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* eslint-disable max-lines-per-function */
2-
import type { BottomSheetModal } from '@gorhom/bottom-sheet';
3-
import { BottomSheetFlatList } from '@gorhom/bottom-sheet';
2+
import { type BottomSheetModal } from '@gorhom/bottom-sheet';
43
import { useColorScheme } from 'nativewind';
54
import * as React from 'react';
65
import type { FieldValues } from 'react-hook-form';
@@ -15,6 +14,7 @@ import colors from '@/ui/colors';
1514
import { CaretDown } from '@/ui/icons';
1615

1716
import type { InputControllerType } from './input';
17+
import { List } from './list';
1818
import { useModal } from './modal';
1919
import { Modal } from './modal';
2020
import { Text } from './text';
@@ -94,11 +94,12 @@ export const Options = React.forwardRef<BottomSheetModal, OptionsProps>(
9494
backgroundColor: isDark ? colors.charcoal[800] : colors.white,
9595
}}
9696
>
97-
<BottomSheetFlatList
97+
<List
9898
data={options}
9999
keyExtractor={keyExtractor}
100100
renderItem={renderSelectItem}
101101
testID={testID ? `${testID}-modal` : undefined}
102+
estimatedItemSize={52}
102103
/>
103104
</Modal>
104105
);

0 commit comments

Comments
 (0)