Update prettier
This commit is contained in:
@@ -14,8 +14,8 @@ function PostCard(props: {
|
||||
onDelete: () => void;
|
||||
}) {
|
||||
return (
|
||||
<View className="bg-muted flex flex-row rounded-lg p-4">
|
||||
<View className="grow">
|
||||
<View className='bg-muted flex flex-row rounded-lg p-4'>
|
||||
<View className='grow'>
|
||||
<Link
|
||||
asChild
|
||||
href={{
|
||||
@@ -23,16 +23,16 @@ function PostCard(props: {
|
||||
params: { id: props.post.id },
|
||||
}}
|
||||
>
|
||||
<Pressable className="">
|
||||
<Text className="text-primary text-xl font-semibold">
|
||||
<Pressable className=''>
|
||||
<Text className='text-primary text-xl font-semibold'>
|
||||
{props.post.title}
|
||||
</Text>
|
||||
<Text className="text-foreground mt-2">{props.post.content}</Text>
|
||||
<Text className='text-foreground mt-2'>{props.post.content}</Text>
|
||||
</Pressable>
|
||||
</Link>
|
||||
</View>
|
||||
<Pressable onPress={props.onDelete}>
|
||||
<Text className="text-primary font-bold uppercase">Delete</Text>
|
||||
<Text className='text-primary font-bold uppercase'>Delete</Text>
|
||||
</Pressable>
|
||||
</View>
|
||||
);
|
||||
@@ -55,31 +55,31 @@ function CreatePost() {
|
||||
);
|
||||
|
||||
return (
|
||||
<View className="mt-4 flex gap-2">
|
||||
<View className='mt-4 flex gap-2'>
|
||||
<TextInput
|
||||
className="border-input bg-background text-foreground items-center rounded-md border px-3 text-lg leading-tight"
|
||||
className='border-input bg-background text-foreground items-center rounded-md border px-3 text-lg leading-tight'
|
||||
value={title}
|
||||
onChangeText={setTitle}
|
||||
placeholder="Title"
|
||||
placeholder='Title'
|
||||
/>
|
||||
{error?.data?.zodError?.fieldErrors.title && (
|
||||
<Text className="text-destructive mb-2">
|
||||
<Text className='text-destructive mb-2'>
|
||||
{error.data.zodError.fieldErrors.title}
|
||||
</Text>
|
||||
)}
|
||||
<TextInput
|
||||
className="border-input bg-background text-foreground items-center rounded-md border px-3 text-lg leading-tight"
|
||||
className='border-input bg-background text-foreground items-center rounded-md border px-3 text-lg leading-tight'
|
||||
value={content}
|
||||
onChangeText={setContent}
|
||||
placeholder="Content"
|
||||
placeholder='Content'
|
||||
/>
|
||||
{error?.data?.zodError?.fieldErrors.content && (
|
||||
<Text className="text-destructive mb-2">
|
||||
<Text className='text-destructive mb-2'>
|
||||
{error.data.zodError.fieldErrors.content}
|
||||
</Text>
|
||||
)}
|
||||
<Pressable
|
||||
className="bg-primary flex items-center rounded-sm p-2"
|
||||
className='bg-primary flex items-center rounded-sm p-2'
|
||||
onPress={() => {
|
||||
mutate({
|
||||
title,
|
||||
@@ -87,10 +87,10 @@ function CreatePost() {
|
||||
});
|
||||
}}
|
||||
>
|
||||
<Text className="text-foreground">Create</Text>
|
||||
<Text className='text-foreground'>Create</Text>
|
||||
</Pressable>
|
||||
{error?.data?.code === 'UNAUTHORIZED' && (
|
||||
<Text className="text-destructive mt-2">
|
||||
<Text className='text-destructive mt-2'>
|
||||
You need to be logged in to create a post
|
||||
</Text>
|
||||
)}
|
||||
@@ -103,7 +103,7 @@ function MobileAuth() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Text className="text-foreground pb-2 text-center text-xl font-semibold">
|
||||
<Text className='text-foreground pb-2 text-center text-xl font-semibold'>
|
||||
{session?.user.name ? `Hello, ${session.user.name}` : 'Not logged in'}
|
||||
</Text>
|
||||
<Pressable
|
||||
@@ -115,7 +115,7 @@ function MobileAuth() {
|
||||
callbackURL: '/',
|
||||
})
|
||||
}
|
||||
className="bg-primary flex items-center rounded-sm p-2"
|
||||
className='bg-primary flex items-center rounded-sm p-2'
|
||||
>
|
||||
<Text>{session ? 'Sign Out' : 'Sign In With Discord'}</Text>
|
||||
</Pressable>
|
||||
@@ -136,18 +136,18 @@ export default function Index() {
|
||||
);
|
||||
|
||||
return (
|
||||
<SafeAreaView className="bg-background">
|
||||
<SafeAreaView className='bg-background'>
|
||||
{/* Changes page title visible on the header */}
|
||||
<Stack.Screen options={{ title: 'Home Page' }} />
|
||||
<View className="bg-background h-full w-full p-4">
|
||||
<Text className="text-foreground pb-2 text-center text-5xl font-bold">
|
||||
Create <Text className="text-primary">T3</Text> Turbo
|
||||
<View className='bg-background h-full w-full p-4'>
|
||||
<Text className='text-foreground pb-2 text-center text-5xl font-bold'>
|
||||
Create <Text className='text-primary'>T3</Text> Turbo
|
||||
</Text>
|
||||
|
||||
<MobileAuth />
|
||||
|
||||
<View className="py-2">
|
||||
<Text className="text-primary font-semibold italic">
|
||||
<View className='py-2'>
|
||||
<Text className='text-primary font-semibold italic'>
|
||||
Press on a post
|
||||
</Text>
|
||||
</View>
|
||||
@@ -156,7 +156,7 @@ export default function Index() {
|
||||
data={postQuery.data ?? []}
|
||||
estimatedItemSize={20}
|
||||
keyExtractor={(item) => item.id}
|
||||
ItemSeparatorComponent={() => <View className="h-2" />}
|
||||
ItemSeparatorComponent={() => <View className='h-2' />}
|
||||
renderItem={(p) => (
|
||||
<PostCard
|
||||
post={p.item}
|
||||
|
||||
@@ -11,13 +11,13 @@ export default function Post() {
|
||||
if (!data) return null;
|
||||
|
||||
return (
|
||||
<SafeAreaView className="bg-background">
|
||||
<SafeAreaView className='bg-background'>
|
||||
<Stack.Screen options={{ title: data.title }} />
|
||||
<View className="h-full w-full p-4">
|
||||
<Text className="text-primary py-2 text-3xl font-bold">
|
||||
<View className='h-full w-full p-4'>
|
||||
<Text className='text-primary py-2 text-3xl font-bold'>
|
||||
{data.title}
|
||||
</Text>
|
||||
<Text className="text-foreground py-4">{data.content}</Text>
|
||||
<Text className='text-foreground py-4'>{data.content}</Text>
|
||||
</View>
|
||||
</SafeAreaView>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user