-
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
783d357
commit 4bd111e
Showing
11 changed files
with
208 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,26 @@ | ||
import Image from "next/image"; | ||
import Logo from "../../public/Logo.png"; | ||
import Link from "next/link"; | ||
import { useRouter } from "next/router"; | ||
import { useState } from "react"; | ||
|
||
export default function Navbar() { | ||
const router = useRouter(); | ||
const [activePage, setActivePage] = useState(router.pathname); | ||
return ( | ||
<div className="bg-[#F9EFE7] text-black flex justify-between px-[80px] font-quicksand font-semibold"> | ||
<Image src={Logo} className="py-[24px]" /> | ||
|
||
<div className="flex gap-[48px] items-center"> | ||
<Link href="/" className={activePage === "/" ? "text-[#3A8412]" : "text-neutral-500"}>Beranda</Link> | ||
<Link href="/dashboard" className={activePage === "/dashboard" ? "text-[#3A8412]" : "text-neutral-500"}>Dashboard</Link> | ||
<Link href="/verifikasi" className={activePage === "/verifikasi" ? "text-[#3A8412]" : "text-neutral-500"}>Verifikasi</Link> | ||
</div> | ||
|
||
<div className="flex items-center gap-2"> | ||
Nama Pengguna | ||
<div className="bg-green-500 rounded-full w-[32px] aspect-square"></div> | ||
</div> | ||
</div> | ||
); | ||
} |
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,37 @@ | ||
import axios from "axios" | ||
import { useEffect, useState } from "react" | ||
|
||
function WeatherComponent({time, cuaca, temp}) { | ||
return( | ||
<div className="flex flex-col justify-center bg-white w-fit text-black font-quicksand"> | ||
<h1>{time}</h1> | ||
<h1 className="text-[20px] font-semibold">{cuaca}</h1> | ||
<h1 className="text-center">{temp}°C</h1> | ||
</div> | ||
) | ||
} | ||
|
||
export default function Page() { | ||
const [data, setData] = useState([]) | ||
useEffect(() => { | ||
axios.get("https://ibnux.github.io/BMKG-importer/cuaca/501397.json") | ||
.then((res) => { | ||
console.log(res.data) | ||
setData(res.data) | ||
}) | ||
.catch((err) => { | ||
console.log(err) | ||
}) | ||
}, []) | ||
return( | ||
<main className="text-white grid grid-cols-4 gap-4"> | ||
{ | ||
data.map((weather) => { | ||
return( | ||
<WeatherComponent time={weather.jamCuaca} cuaca={weather.cuaca} temp={weather.tempC} /> | ||
) | ||
}) | ||
} | ||
</main> | ||
) | ||
} |
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,10 @@ | ||
import Navbar from "@/components/Navbar"; | ||
|
||
export default function Dashboard() { | ||
return( | ||
<main> | ||
<Navbar /> | ||
Dashboard page | ||
</main> | ||
) | ||
} |
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,12 +1,13 @@ | ||
import Image from 'next/image' | ||
import { Inter } from 'next/font/google' | ||
import Navbar from '@/components/Navbar' | ||
|
||
const inter = Inter({ subsets: ['latin'] }) | ||
|
||
export default function Home() { | ||
return ( | ||
<main> | ||
landing page | ||
<Navbar /> | ||
</main> | ||
) | ||
} |
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,9 @@ | ||
import Navbar from "@/components/Navbar"; | ||
|
||
export default function VerifikasiPage() { | ||
return( | ||
<main> | ||
<Navbar /> | ||
</main> | ||
) | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.