blob: 4fe70de83133d7745411ff4fe4ffdcb2ebbfce4b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
import { Bars3Icon, ChevronLeftIcon, HeartIcon, HomeIcon } from "@heroicons/react/24/outline";
import Head from "next/head";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
import Link from "../elements/Link";
const AppBar = ({ title }) => {
const router = useRouter();
const handleBackButtonClick = (event) => {
event.currentTarget.disabled = true;
router.back();
}
return (
<>
<Head>
<title>{ title } - Indoteknik</title>
</Head>
<div className="sticky-header flex justify-between !p-0 !pr-4 idt-transition">
{/* --- Start Title */}
<div className="flex items-center">
<button type="button" onClick={handleBackButtonClick} className="text-gray_r-12 px-4 py-5">
<ChevronLeftIcon className="w-6 stroke-2"/>
</button>
<h1 className="text-h-md">{ title }</h1>
</div>
{/* --- End Title */}
{/* --- Start Icons */}
<div className="flex gap-x-4 items-center">
<Link href="/my/wishlist">
<HeartIcon className="w-6 stroke-2 text-gray_r-12"/>
</Link>
<Link href="/">
<HomeIcon className="w-6 stroke-2 text-gray_r-12"/>
</Link>
<Link href="/my/menu">
<Bars3Icon className="w-6 stroke-2 text-gray_r-12"/>
</Link>
</div>
{/* --- End Icons */}
</div>
</>
);
};
export default AppBar;
|