diff --git a/src/components/Home.tsx b/src/components/Home.tsx index 3b52e69..5a240e4 100644 --- a/src/components/Home.tsx +++ b/src/components/Home.tsx @@ -1,27 +1,49 @@ // import React from 'react' -import { useState } from 'react' +import { useEffect, useState } from 'react' // import './App.css' import { egyptGovernorates } from '../governments'; import NightDetails from './PrayerTimes'; export default function Home() { - const [city, setCity] = useState('cairo'); + const [city, setCity] = useState( window.localStorage.getItem('city') || 'cairo' ); + const [twelveHour, setTwelveHour] = useState(JSON.parse(window.localStorage.getItem('twelveHour') || 'true')); + useEffect(() => { + + }) return (
- +
+ + + {/* changing 12 hour mode */} + +
- +
diff --git a/src/components/ManualCalc.tsx b/src/components/ManualCalc.tsx index 4f5e750..07e3bd7 100644 --- a/src/components/ManualCalc.tsx +++ b/src/components/ManualCalc.tsx @@ -38,6 +38,24 @@ export default function ManualCalc() {

أدخل مواعيد الصلوات

+
+ {/* fajr Time input */} + +
+
+ +
+ setFajrTime(e.target.value)} + /> +
+
{/* maghrip Time input */} @@ -58,29 +76,11 @@ export default function ManualCalc() { />
-
- {/* fajr Time input */} - -
-
- -
- setFajrTime(e.target.value)} - /> -
-
+ { (fajrTime && maghripTime) && - - + } diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index db072ea..bea8b87 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -6,7 +6,7 @@ export default function Navbar() { return (