-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
100 changed files
with
3,278 additions
and
2,472 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "*" | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,9 +30,8 @@ import { Text } from "~/components/ui/text"; | |
import { getHabits, setHabits } from "~/lib/storage"; | ||
import { cn } from "~/lib/utils"; | ||
|
||
|
||
const HabitCategories = [ | ||
{ value: "[email protected]", label: "Health And Wellness", }, | ||
{ value: "[email protected]", label: "Health And Wellness" }, | ||
{ value: "[email protected]", label: "Personal Development" }, | ||
{ value: "[email protected]", label: "Social And Relationships" }, | ||
{ value: "[email protected]", label: "Productivity" }, | ||
|
@@ -42,11 +41,11 @@ const HabitCategories = [ | |
{ value: "[email protected]", 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({ | ||
|
@@ -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(), | ||
|
@@ -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 ( | ||
|
@@ -111,7 +110,7 @@ export default function FormScreen() { | |
automaticallyAdjustContentInsets={false} | ||
contentInset={{ top: 12 }} | ||
> | ||
<Stack.Screen | ||
<Stack.Screen | ||
options={{ | ||
title: "New Habit", | ||
}} | ||
|
@@ -145,7 +144,7 @@ export default function FormScreen() { | |
)} | ||
/> | ||
|
||
<FormField | ||
<FormField | ||
control={form.control} | ||
name="category" | ||
render={({ field }) => ( | ||
|
@@ -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" | ||
/> | ||
|
@@ -229,7 +228,6 @@ export default function FormScreen() { | |
}} | ||
/> | ||
|
||
|
||
<FormField | ||
control={form.control} | ||
name="enableNotifications" | ||
|
@@ -241,7 +239,7 @@ export default function FormScreen() { | |
/> | ||
)} | ||
/> | ||
|
||
<Button onPress={form.handleSubmit(onSubmit)}> | ||
<Text>Submit</Text> | ||
</Button> | ||
|
@@ -260,4 +258,3 @@ export default function FormScreen() { | |
</ScrollView> | ||
); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
], | ||
}; | ||
}; |
Oops, something went wrong.