Skip to content

Commit

Permalink
feat: add azkar progress indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
obeim committed Feb 17, 2024
1 parent 15326b5 commit a75066e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"react-native": "0.72.6",
"react-native-gesture-handler": "~2.12.0",
"react-native-mmkv": "^2.11.0",
"react-native-progress": "^5.0.1",
"react-native-root-toast": "^3.5.1",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "~3.22.0",
Expand Down
14 changes: 13 additions & 1 deletion screens/azkar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { Alert, ScrollView, Text, View } from "react-native";
import { Alert, Dimensions, ScrollView, Text, View } from "react-native";
import { Header } from "../jozz/Header";
import { useLocalSearchParams } from "expo-router";
import { useQuery } from "react-query";
import { getAzkarByCate } from "@/db/repos/AzkarRepo";
import { ZekrCard } from "./components/ZekrCard";
import { useEffect, useState } from "react";
import CompletedModal from "./components/CompletedModal";
import { Bar } from "react-native-progress";
import { useColorScheme } from "nativewind";

export const Azkar = () => {
const local = useLocalSearchParams();
const { colorScheme } = useColorScheme();
const [completedCount, setCompletedCount] = useState<number>(0);
const [completeModal, setCompleteModal] = useState(false);

Expand All @@ -31,6 +34,15 @@ export const Azkar = () => {
close={() => setCompleteModal(false)}
/>
<Header title={`${local.category}`} />
{data && (
<Bar
progress={completedCount / data?.length}
width={Dimensions.get("screen").width}
color={colorScheme === "dark" ? "#FAF0E6" : "#544981"}
borderWidth={0}
height={1}
/>
)}
<ScrollView className=" w-full bg-white dark:bg-blackCoral h-[93%] px-5 overflow-hidden">
{isLoading && (
<Text className="text-center font-HelveticaRoman mt-5 text-primary dark:text-primaryDark">
Expand Down

0 comments on commit a75066e

Please sign in to comment.