-
Notifications
You must be signed in to change notification settings - Fork 0
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
MattAgn
committed
Dec 2, 2024
1 parent
9662742
commit cd58580
Showing
31 changed files
with
3,696 additions
and
356 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const { defineConfig } = require("eslint-define-config"); | ||
|
||
module.exports = defineConfig({ | ||
extends: [ | ||
// see source: https://github.com/bamlab/react-native-project-config/blob/main/packages/eslint-plugin/lib/configs/recommended.js | ||
"plugin:@bam.tech/recommended", | ||
], | ||
}); |
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ node_modules/ | |
dist/ | ||
web-build/ | ||
expo-env.d.ts | ||
.cache | ||
|
||
# Native | ||
*.orig.* | ||
|
Empty file.
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,22 @@ | ||
{ | ||
"files.trimFinalNewlines": true, | ||
"files.insertFinalNewline": true, | ||
"eslint.format.enable": true, | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"[json]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[javascript]": { | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
}, | ||
"[javascriptreact]": { | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
} | ||
} |
Empty file.
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,109 +1,39 @@ | ||
import { StyleSheet, Image, Platform } from 'react-native'; | ||
import { StyleSheet } from "react-native"; | ||
|
||
import { Collapsible } from '@/components/Collapsible'; | ||
import { ExternalLink } from '@/components/ExternalLink'; | ||
import ParallaxScrollView from '@/components/ParallaxScrollView'; | ||
import { ThemedText } from '@/components/ThemedText'; | ||
import { ThemedView } from '@/components/ThemedView'; | ||
import { IconSymbol } from '@/components/ui/IconSymbol'; | ||
import ParallaxScrollView from "@/components/ParallaxScrollView"; | ||
import { ThemedText } from "@/components/ThemedText"; | ||
import { ThemedView } from "@/components/ThemedView"; | ||
import { IconSymbol } from "@/components/ui/IconSymbol"; | ||
|
||
export default function TabTwoScreen() { | ||
return ( | ||
<ParallaxScrollView | ||
headerBackgroundColor={{ light: '#D0D0D0', dark: '#353636' }} | ||
headerBackgroundColor={{ light: "#D0D0D0", dark: "#353636" }} | ||
headerImage={ | ||
<IconSymbol | ||
size={310} | ||
color="#808080" | ||
name="chevron.left.forwardslash.chevron.right" | ||
style={styles.headerImage} | ||
/> | ||
}> | ||
} | ||
> | ||
<ThemedView style={styles.titleContainer}> | ||
<ThemedText type="title">Explore</ThemedText> | ||
</ThemedView> | ||
<ThemedText>This app includes example code to help you get started.</ThemedText> | ||
<Collapsible title="File-based routing"> | ||
<ThemedText> | ||
This app has two screens:{' '} | ||
<ThemedText type="defaultSemiBold">app/(tabs)/index.tsx</ThemedText> and{' '} | ||
<ThemedText type="defaultSemiBold">app/(tabs)/explore.tsx</ThemedText> | ||
</ThemedText> | ||
<ThemedText> | ||
The layout file in <ThemedText type="defaultSemiBold">app/(tabs)/_layout.tsx</ThemedText>{' '} | ||
sets up the tab navigator. | ||
</ThemedText> | ||
<ExternalLink href="https://docs.expo.dev/router/introduction"> | ||
<ThemedText type="link">Learn more</ThemedText> | ||
</ExternalLink> | ||
</Collapsible> | ||
<Collapsible title="Android, iOS, and web support"> | ||
<ThemedText> | ||
You can open this project on Android, iOS, and the web. To open the web version, press{' '} | ||
<ThemedText type="defaultSemiBold">w</ThemedText> in the terminal running this project. | ||
</ThemedText> | ||
</Collapsible> | ||
<Collapsible title="Images"> | ||
<ThemedText> | ||
For static images, you can use the <ThemedText type="defaultSemiBold">@2x</ThemedText> and{' '} | ||
<ThemedText type="defaultSemiBold">@3x</ThemedText> suffixes to provide files for | ||
different screen densities | ||
</ThemedText> | ||
<Image source={require('@/assets/images/react-logo.png')} style={{ alignSelf: 'center' }} /> | ||
<ExternalLink href="https://reactnative.dev/docs/images"> | ||
<ThemedText type="link">Learn more</ThemedText> | ||
</ExternalLink> | ||
</Collapsible> | ||
<Collapsible title="Custom fonts"> | ||
<ThemedText> | ||
Open <ThemedText type="defaultSemiBold">app/_layout.tsx</ThemedText> to see how to load{' '} | ||
<ThemedText style={{ fontFamily: 'SpaceMono' }}> | ||
custom fonts such as this one. | ||
</ThemedText> | ||
</ThemedText> | ||
<ExternalLink href="https://docs.expo.dev/versions/latest/sdk/font"> | ||
<ThemedText type="link">Learn more</ThemedText> | ||
</ExternalLink> | ||
</Collapsible> | ||
<Collapsible title="Light and dark mode components"> | ||
<ThemedText> | ||
This template has light and dark mode support. The{' '} | ||
<ThemedText type="defaultSemiBold">useColorScheme()</ThemedText> hook lets you inspect | ||
what the user's current color scheme is, and so you can adjust UI colors accordingly. | ||
</ThemedText> | ||
<ExternalLink href="https://docs.expo.dev/develop/user-interface/color-themes/"> | ||
<ThemedText type="link">Learn more</ThemedText> | ||
</ExternalLink> | ||
</Collapsible> | ||
<Collapsible title="Animations"> | ||
<ThemedText> | ||
This template includes an example of an animated component. The{' '} | ||
<ThemedText type="defaultSemiBold">components/HelloWave.tsx</ThemedText> component uses | ||
the powerful <ThemedText type="defaultSemiBold">react-native-reanimated</ThemedText>{' '} | ||
library to create a waving hand animation. | ||
</ThemedText> | ||
{Platform.select({ | ||
ios: ( | ||
<ThemedText> | ||
The <ThemedText type="defaultSemiBold">components/ParallaxScrollView.tsx</ThemedText>{' '} | ||
component provides a parallax effect for the header image. | ||
</ThemedText> | ||
), | ||
})} | ||
</Collapsible> | ||
</ParallaxScrollView> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
headerImage: { | ||
color: '#808080', | ||
color: "#808080", | ||
bottom: -90, | ||
left: -35, | ||
position: 'absolute', | ||
position: "absolute", | ||
}, | ||
titleContainer: { | ||
flexDirection: 'row', | ||
flexDirection: "row", | ||
gap: 8, | ||
}, | ||
}); |
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,39 +1,52 @@ | ||
import { PlusCircle } from "@tamagui/lucide-icons"; | ||
import { router } from "expo-router"; | ||
import { FlatList } from "react-native"; | ||
import { | ||
SafeAreaView, | ||
useSafeAreaInsets, | ||
} from "react-native-safe-area-context"; | ||
import { Button, Card, Spacer, styled, Text, View } from "tamagui"; | ||
|
||
import { Colors } from '@/constants/Colors'; | ||
import { DiaryEntry } from '@/domain/DiaryEntry'; | ||
import { fakeDiaryEntries } from '@/utils/fakeDiaryEntries'; | ||
import { FlatList } from 'react-native'; | ||
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context'; | ||
import { Button, Card, Spacer, Text, View } from 'tamagui'; | ||
import { PlusCircle } from '@tamagui/lucide-icons'; | ||
import { router } from 'expo-router'; | ||
import { Colors } from "@/constants/Colors"; | ||
import type { DiaryEntry } from "@/domain/DiaryEntry"; | ||
import { fakeDiaryEntries } from "@/utils/fakeDiaryEntries"; | ||
|
||
export default function HomeScreen() { | ||
const { bottom } = useSafeAreaInsets() | ||
const { bottom } = useSafeAreaInsets(); | ||
|
||
const renderItem = ({ item }: { item: DiaryEntry }) => { | ||
return ( | ||
<Card p="$3" marginTop="$4"> | ||
<Card.Header flexDirection="row" justifyContent="space-between"> | ||
<Text>{item.title}</Text> | ||
<Text fontSize={10} >{item.createdAt.toLocaleDateString()}</Text> | ||
<Text fontSize={10}>{item.createdAt.toLocaleDateString()}</Text> | ||
</Card.Header> | ||
<Text numberOfLines={3}>{item.content}</Text> | ||
<Card.Footer> | ||
</Card.Footer> | ||
<Card.Footer></Card.Footer> | ||
</Card> | ||
); | ||
}; | ||
|
||
return ( | ||
<SafeAreaView style={{ flex: 1, padding: 30, backgroundColor: Colors["light"].background, marginBottom: bottom }}> | ||
<View flex={1} > | ||
<StyledSafeAreaView marginBottom={bottom}> | ||
<View flex={1}> | ||
<Text>Mon journal</Text> | ||
<FlatList data={fakeDiaryEntries} renderItem={renderItem} /> | ||
<Spacer scaleY={1} /> | ||
<Button icon={PlusCircle} color={Colors["light"].tint} onPress={() => router.push('/new-diary-entry')}>Nouvelle entrée</Button> | ||
<Button | ||
icon={PlusCircle} | ||
color={Colors["light"].tint} | ||
onPress={() => router.push("/new-diary-entry")} | ||
> | ||
Nouvelle entrée | ||
</Button> | ||
</View> | ||
</SafeAreaView> | ||
</StyledSafeAreaView> | ||
); | ||
} | ||
|
||
const StyledSafeAreaView = styled(SafeAreaView, { | ||
flex: 1, | ||
padding: 30, | ||
backgroundColor: Colors["light"].background, | ||
}); |
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
Oops, something went wrong.