source: frontend/src/pages/Dashboard/components/DashboardTopbar.jsx@ a8381b1

Last change on this file since a8381b1 was a8381b1, checked in by Andrej <asumanovski@…>, 2 months ago

Control center page developed

  • Property mode set to 100644
File size: 2.1 KB
RevLine 
[8c01a1f]1import React from "react";
2import { Link } from "react-router-dom";
3
4import { MdLogout } from "react-icons/md";
5
6import logo from "../../../assets/logo.png";
7
8const DashboardTopbar = ({ username, onLogout }) => {
9 return (
10 <>
11 {/* Desktop */}
[a8381b1]12 <div className="sticky top-0 z-30 hidden min-h-16 w-full items-center border-b border-white/10 bg-base-100/70 px-6 backdrop-blur-xl lg:flex lg:px-8">
[8c01a1f]13 <div className="mx-auto grid size-full grid-cols-1 items-center justify-end justify-items-end gap-4 lg:grid-cols-[1fr_max-content] lg:justify-between lg:justify-items-stretch">
14 <div className="flex items-center gap-3"></div>
15
16 <div className="flex items-center gap-3">
17 <span className="text-sm opacity-80">{username || "—"}</span>
18 <button
19 type="button"
[a8381b1]20 className="btn btn-ghost btn-sm hover:bg-white/10 transition"
[8c01a1f]21 onClick={onLogout}
22 aria-label="Log out"
23 title="Log out"
24 >
25 <MdLogout className="size-5" />
26 </button>
27 </div>
28 </div>
29 </div>
30
31 {/* Mobile */}
[a8381b1]32 <div className="fixed left-0 right-0 top-0 z-30 flex min-h-16 w-full items-center justify-between border-b border-white/10 bg-base-100/70 px-4 backdrop-blur-xl sm:px-6 lg:hidden">
[8c01a1f]33 <div className="flex items-center gap-4">
34 <Link
35 to="/dashboard"
36 className="flex items-center gap-3"
37 aria-label="Trekr dashboard"
38 >
39 <img src={logo} alt="Trekr" className="h-10 w-auto rounded-2xl" />
40 </Link>
41 </div>
42 <div className="flex items-center gap-3">
43 <span className="text-sm opacity-80">{username || "—"}</span>
44 <button
45 type="button"
[a8381b1]46 className="btn btn-ghost btn-sm hover:bg-white/10 transition"
[8c01a1f]47 onClick={onLogout}
48 aria-label="Log out"
49 title="Log out"
50 >
51 <MdLogout className="size-5" />
52 </button>
53 </div>
54 </div>
55 </>
56 );
57};
58
59export default DashboardTopbar;
Note: See TracBrowser for help on using the repository browser.