-
-
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
1 parent
4bd331e
commit a82de0f
Showing
12 changed files
with
257 additions
and
110 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
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,63 @@ | ||
import { View } from "react-native"; | ||
|
||
import type { MacrosData } from "~/data/macros"; | ||
import { Text } from "~/components/ui/text"; | ||
import { mockMacrosData } from "~/data/macros"; | ||
import { useColorScheme } from "~/lib/use-color-scheme"; | ||
import { cn, getBloodSugarColors } from "~/lib/utils"; | ||
|
||
const MacroItem = ({ label, value }: MacrosData) => ( | ||
<View className="flex-row"> | ||
<Text className="text-sm font-semibold">{value}</Text> | ||
<Text className="text-sm text-gray-500">{label}</Text> | ||
</View> | ||
); | ||
|
||
export default function BloodSugarWidget() { | ||
const { colorScheme } = useColorScheme(); | ||
const isDark = colorScheme === "dark"; | ||
|
||
const bloodSugar = 194; | ||
const bloodSugarColors = getBloodSugarColors(bloodSugar, isDark); | ||
|
||
return ( | ||
<View className="flex-col items-center gap-4 pb-4"> | ||
{/* Blood Sugar */} | ||
<View | ||
className={cn("h-32 w-32 items-center justify-center rounded-full")} | ||
style={{ backgroundColor: bloodSugarColors.background }} | ||
> | ||
<Text className="mb-1 text-xs" style={{ color: bloodSugarColors.text }}> | ||
9:40 AM | ||
</Text> | ||
<View className="flex-row items-baseline"> | ||
<Text | ||
className="text-3xl font-bold" | ||
style={{ color: bloodSugarColors.text }} | ||
> | ||
{bloodSugar} | ||
</Text> | ||
<Text | ||
className="ml-1 text-sm" | ||
style={{ color: bloodSugarColors.text }} | ||
> | ||
↑ | ||
</Text> | ||
</View> | ||
<Text className="mt-1 text-xs" style={{ color: bloodSugarColors.text }}> | ||
mg/dL | ||
</Text> | ||
</View> | ||
|
||
{/* Macros */} | ||
<View className="flex-row items-center justify-center gap-4"> | ||
<Text className="text-sm font-medium">Daily Macros:</Text> | ||
<View className="flex-row gap-2"> | ||
{mockMacrosData.map((macro, index) => ( | ||
<MacroItem key={index} {...macro} /> | ||
))} | ||
</View> | ||
</View> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from "react"; | ||
import { View } from "react-native"; | ||
|
||
import { Text } from "~/components/ui/text"; | ||
|
||
const INTRO_DATA = [ | ||
{ | ||
key: "1", | ||
title: "App showcase ✨", | ||
description: | ||
"Lorem Ipsum is simply dummy text of the printing and typesetting industry.", | ||
}, | ||
{ | ||
key: "2", | ||
title: "Introduction screen 🎉", | ||
description: | ||
"Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. ", | ||
}, | ||
{ | ||
key: "3", | ||
title: "And can be anything 🎈", | ||
description: | ||
"Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. ", | ||
}, | ||
]; | ||
|
||
const TempWidget = () => { | ||
return ( | ||
<View> | ||
{INTRO_DATA.map((item) => ( | ||
<View key={item.key} className="p-4"> | ||
<Text className="mb-2 text-xl font-bold">{item.title}</Text> | ||
<Text className="text-base">{item.description}</Text> | ||
</View> | ||
))} | ||
</View> | ||
); | ||
}; | ||
|
||
export { TempWidget }; |
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
Oops, something went wrong.