Skip to content

Commit

Permalink
chore: update configu
Browse files Browse the repository at this point in the history
  • Loading branch information
younes200 committed May 16, 2024
1 parent d65d470 commit 7efcfdd
Show file tree
Hide file tree
Showing 100 changed files with 3,278 additions and 2,472 deletions.
50 changes: 24 additions & 26 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
{
"editor.tabSize": 2,
"editor.insertSpaces": true,
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"editor.codeActionsOnSave": {
"source.fixAll": "always"
},
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": "node_modules/typescript/lib",
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"css.customData": [
".vscode/css_custom_data.json"
],
"files.associations": {
"*.css": "tailwindcss"
}
"editor.tabSize": 2,
"editor.insertSpaces": true,
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"editor.codeActionsOnSave": {
"source.fixAll": "always"
},
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": "node_modules/typescript/lib",
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"css.customData": [".vscode/css_custom_data.json"],
"files.associations": {
"*.css": "tailwindcss"
}
}
56 changes: 56 additions & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import type { ConfigContext, ExpoConfig } from "@expo/config";

export default ({ config }: ConfigContext): ExpoConfig => ({
...config,
name: "Launchtrack Starter",
slug: "launchtrack-starter",
version: "1.0.0",
orientation: "portrait",
icon: "./assets/images/icon.png",
scheme: "ltstarter",
userInterfaceStyle: "dark",
runtimeVersion: {
policy: "appVersion"
},
splash: {
image: "./assets/images/splash.png",
resizeMode: "contain",
backgroundColor: "#ffffff"
},
assetBundlePatterns: [
"**/*"
],
ios: {
supportsTablet: true,
bundleIdentifier: "dev.launchtrack.base"
},
android: {
adaptiveIcon: {
foregroundImage: "./assets/images/adaptive-icon.png",
backgroundColor: "#ffffff"
},
package: "dev.launchtrack.starterbase"
},
web: {
bundler: "metro",
output: "single",
favicon: "./assets/images/favicon.png"
},
plugins: [
[
"expo-router",
{
origin: process.env.NODE_ENV === "production" ? "https://launchtrack.github.io/expo-starter/": null
}
]
],
experiments: {
typedRoutes: true
},
extra: {
eas: {
projectId: ""
}
},
owner: "*"
});
53 changes: 0 additions & 53 deletions app.json

This file was deleted.

10 changes: 5 additions & 5 deletions app/+not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Link, Stack } from 'expo-router';
import { View } from 'react-native';
import { Text } from '~/components/ui/text';
import { Link, Stack } from "expo-router";
import { View } from "react-native";
import { Text } from "~/components/ui/text";

export default function NotFoundScreen() {
return (
<>
<Stack.Screen options={{ title: 'Oops!' }} />
<Stack.Screen options={{ title: "Oops!" }} />
<View>
<Text>This screen doesn't exist.</Text>

<Link href='/'>
<Link href="/">
<Text>Go to home screen!</Text>
</Link>
</View>
Expand Down
4 changes: 1 addition & 3 deletions app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ export default function RootLayout() {
<GestureHandlerRootView style={{ flex: 1 }}>
<BottomSheetModalProvider>
<Stack>
<Stack.Screen
name="index"
/>
<Stack.Screen name="index" />
</Stack>
</BottomSheetModalProvider>
</GestureHandlerRootView>
Expand Down
43 changes: 20 additions & 23 deletions app/habits/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ import { Text } from "~/components/ui/text";
import { getHabits, setHabits } from "~/lib/storage";
import { cn } from "~/lib/utils";


const HabitCategories = [
{ value: "tom@cruise.com", label: "Health And Wellness", },
{ value: "tom@cruise.com", label: "Health And Wellness" },
{ value: "napoleon@dynamite.com", label: "Personal Development" },
{ value: "kunfu@panda.com", label: "Social And Relationships" },
{ value: "bruce@lee.com", label: "Productivity" },
Expand All @@ -42,11 +41,11 @@ const HabitCategories = [
{ value: "lara@croft.com", label: "Leisure" },
];

const HabitDurations = [
{value: 5, label: "5 minutes"},
{value: 10, label: "10 minutes"},
{value: 15, label: "15 minutes"},
{value: 30, label: "30 minutes"}
const HabitDurations = [
{ value: 5, label: "5 minutes" },
{ value: 10, label: "10 minutes" },
{ value: 15, label: "15 minutes" },
{ value: 30, label: "30 minutes" },
];

const formSchema = z.object({
Expand All @@ -60,7 +59,7 @@ const formSchema = z.object({
{ value: z.string(), label: z.string() },
{
invalid_type_error: "Please select a favorite email.",
}
},
),
duration: z.number().int().positive(),
enableNotifications: z.boolean(),
Expand Down Expand Up @@ -91,16 +90,16 @@ export default function FormScreen() {
};

async function onSubmit(values: z.infer<typeof formSchema>) {


const oldHabits = await getHabits();
setHabits([...oldHabits, {
...values,
id: Math.random().toString(36).substring(7),
category: values.category.value,
}]);
router.replace('/');

setHabits([
...oldHabits,
{
...values,
id: Math.random().toString(36).substring(7),
category: values.category.value,
},
]);
router.replace("/");
}

return (
Expand All @@ -111,7 +110,7 @@ export default function FormScreen() {
automaticallyAdjustContentInsets={false}
contentInset={{ top: 12 }}
>
<Stack.Screen
<Stack.Screen
options={{
title: "New Habit",
}}
Expand Down Expand Up @@ -145,7 +144,7 @@ export default function FormScreen() {
)}
/>

<FormField
<FormField
control={form.control}
name="category"
render={({ field }) => (
Expand All @@ -162,7 +161,7 @@ export default function FormScreen() {
<SelectValue
className={cn(
"text-sm native:text-lg",
field.value ? "text-foreground" : "text-muted-foreground"
field.value ? "text-foreground" : "text-muted-foreground",
)}
placeholder="Select a habit category"
/>
Expand Down Expand Up @@ -229,7 +228,6 @@ export default function FormScreen() {
}}
/>


<FormField
control={form.control}
name="enableNotifications"
Expand All @@ -241,7 +239,7 @@ export default function FormScreen() {
/>
)}
/>

<Button onPress={form.handleSubmit(onSubmit)}>
<Text>Submit</Text>
</Button>
Expand All @@ -260,4 +258,3 @@ export default function FormScreen() {
</ScrollView>
);
}

22 changes: 12 additions & 10 deletions app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,20 @@ const HabitCard: React.FC<HabitProps> = ({ habit, onDelete }) => {
return (
<Card className="w-full max-w-sm rounded-2xl">
<CardHeader>
<CardTitle className="pb-2">{habit.name}<Badge variant="outline"> <Text>Morning</Text></Badge></CardTitle>
<CardTitle className="pb-2">
{habit.name}
<Badge variant="outline">
{" "}
<Text>Morning</Text>
</Badge>
</CardTitle>
<View className="flex-row">
<CardDescription className="text-base font-semibold">
{habit.description}
</CardDescription>
</View>
</CardHeader>
<CardContent>

</CardContent>
<CardContent></CardContent>
<CardFooter className="flex-col gap-3">
<Progress value={10} className="h-2" indicatorClassName="bg-sky-600" />
<View />
Expand Down Expand Up @@ -78,23 +82,21 @@ export default function Screen() {
<Stack.Screen
options={{
title: "Habits",
headerRight: () => (
<ThemeToggle />
),
headerRight: () => <ThemeToggle />,
}}
/>
<FlashList
ref={ref}
className='native:overflow-hidden rounded-t-lg'
className="native:overflow-hidden rounded-t-lg"
estimatedItemSize={49}
showsVerticalScrollIndicator={false}
ItemSeparatorComponent={() => <View className='p-2' />}
ItemSeparatorComponent={() => <View className="p-2" />}
data={habits}
renderItem={({ item }) => (
<HabitCard habit={item} onDelete={() => handleDeleteHabit(item.id)} />
)}
keyExtractor={(item) => item.id}
ListFooterComponent={<View className='py-4' />}
ListFooterComponent={<View className="py-4" />}
/>
<Button onPress={() => router.push("/habits/new")}>
<Text>Add</Text>
Expand Down
7 changes: 5 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module.exports = function (api) {
module.exports = (api) => {
api.cache(true);
return {
presets: [['babel-preset-expo', { jsxImportSource: 'nativewind' }], 'nativewind/babel'],
presets: [
["babel-preset-expo", { jsxImportSource: "nativewind" }],
"nativewind/babel",
],
};
};
Loading

0 comments on commit 7efcfdd

Please sign in to comment.