-
-
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.
adding rn-primitives for ui and calendar component
- Loading branch information
1 parent
cc766a9
commit 4a15da4
Showing
42 changed files
with
875 additions
and
1,952 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
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,58 @@ | ||
import { TouchableOpacity, View } from "react-native"; | ||
import { Tabs } from "expo-router"; | ||
import colors from "tailwindcss/colors"; | ||
|
||
import { CircleUserRound } from "~/lib/icons/circle-user-round"; | ||
import { House } from "~/lib/icons/house"; | ||
import { Plus } from "~/lib/icons/plus"; | ||
|
||
const TabsLayout = () => { | ||
return ( | ||
<Tabs> | ||
<Tabs.Screen | ||
name="index" | ||
options={{ | ||
headerShown: false, | ||
title: "Home", | ||
tabBarButton: (props) => <TouchableOpacity {...props} />, | ||
tabBarIcon: ({ size, color }) => <House size={size} color={color} />, | ||
}} | ||
/> | ||
<Tabs.Screen | ||
name="log" | ||
options={{ | ||
title: "Log", | ||
tabBarLabel: "", | ||
tabBarButton: (props) => <TouchableOpacity {...props} />, | ||
tabBarIcon: ({ size }) => ( | ||
<View | ||
style={{ | ||
width: size + 10, | ||
height: size + 10, | ||
borderRadius: 9999, | ||
backgroundColor: colors.blue[600], | ||
justifyContent: "center", | ||
alignItems: "center", | ||
top: 10, | ||
}} | ||
> | ||
<Plus size={size} color="white" /> | ||
</View> | ||
), | ||
}} | ||
/> | ||
<Tabs.Screen | ||
name="account" | ||
options={{ | ||
title: "Account", | ||
tabBarButton: (props) => <TouchableOpacity {...props} />, | ||
tabBarIcon: ({ size, color }) => ( | ||
<CircleUserRound size={size} color={color} /> | ||
), | ||
}} | ||
/> | ||
</Tabs> | ||
); | ||
}; | ||
|
||
export default TabsLayout; |
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,42 @@ | ||
import { View } from "react-native"; | ||
import { | ||
useSessionContext, | ||
useSupabaseClient, | ||
useUser, | ||
} from "@supabase/auth-helpers-react"; | ||
|
||
import { ThemeToggle } from "~/components/theme-toggle"; | ||
import { Button } from "~/components/ui/button"; | ||
import { Text } from "~/components/ui/text"; | ||
|
||
export default function AccountScreen() { | ||
const user = useUser(); | ||
|
||
const SignOut = () => { | ||
const { isLoading } = useSessionContext(); | ||
const supabase = useSupabaseClient(); | ||
|
||
if (isLoading) { | ||
return null; | ||
} | ||
return ( | ||
<View className="flex-row items-center justify-between gap-2 p-4"> | ||
<Button | ||
onPress={async () => { | ||
await supabase.auth.signOut(); | ||
}} | ||
> | ||
<Text>Sign Out</Text> | ||
</Button> | ||
<ThemeToggle /> | ||
</View> | ||
); | ||
}; | ||
|
||
return ( | ||
<View> | ||
<Text>Account Screen</Text> | ||
{user?.id && <SignOut />} | ||
</View> | ||
); | ||
} |
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,13 @@ | ||
import { SafeAreaView } from "react-native-safe-area-context"; | ||
|
||
import { Button } from "~/components/ui/button"; | ||
import { Text } from "~/components/ui/text"; | ||
|
||
export default function HomeScreen() { | ||
return ( | ||
<SafeAreaView> | ||
<Text>Home Screen</Text> | ||
<Button /> | ||
</SafeAreaView> | ||
); | ||
} |
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,11 @@ | ||
import { View } from "react-native"; | ||
|
||
import { Text } from "~/components/ui/text"; | ||
|
||
export default function LogScreen() { | ||
return ( | ||
<View> | ||
<Text>Log Screen</Text> | ||
</View> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { useState } from "react"; | ||
import { Text, View } from "react-native"; | ||
import { Calendar, toDateId } from "@marceloterreiro/flash-calendar"; | ||
|
||
const today = toDateId(new Date()); | ||
|
||
export function BasicCalendar() { | ||
const [selectedDate, setSelectedDate] = useState(today); | ||
return ( | ||
<View> | ||
<Text>Selected date: {selectedDate}</Text> | ||
<Calendar | ||
calendarActiveDateRanges={[ | ||
{ | ||
startId: selectedDate, | ||
endId: selectedDate, | ||
}, | ||
]} | ||
calendarMonthId={today} | ||
onCalendarDayPress={setSelectedDate} | ||
/> | ||
</View> | ||
); | ||
} |
Oops, something went wrong.