diff --git a/web/src/components/Home/Sidebar/index.tsx b/web/src/components/Home/Sidebar/index.tsx new file mode 100644 index 0000000..be2de96 --- /dev/null +++ b/web/src/components/Home/Sidebar/index.tsx @@ -0,0 +1,27 @@ +import type { FC } from "react"; +import { barItems } from "../tabs"; + +export interface ISidebarProps { + activeTab: string; + onChangeTab: (tab: string) => void; +} + +const Sidebar: FC = ({ activeTab, onChangeTab }) => { + return ( +
+ {barItems.map((item) => ( +
onChangeTab(item.tab)} + className={`dark:text-gray-200 transition-colors text-md cursor-pointer p-4 rounded-lg flex flex-row items-center gap-3${ + item.tab === activeTab ? " bg-gray-200 dark:bg-gray-900" : "" + }`} + > + {item.icon} {item.title} +
+ ))} +
+ ); +}; + +export default Sidebar; diff --git a/web/src/components/Home/Tabs/Home.tsx b/web/src/components/Home/Tabs/Home.tsx new file mode 100644 index 0000000..b54d666 --- /dev/null +++ b/web/src/components/Home/Tabs/Home.tsx @@ -0,0 +1,25 @@ +import { type FC } from "react"; + +const Home: FC = () => { + return ( +
+
+ {/* */} + profile pic +
+

+ Welcome, Amir Adal +

+

+ Manage your info, private and security to make Home Guard work better + for you. +

+
+ ); +}; + +export default Home; diff --git a/web/src/components/Home/Tabs/PersonalInfo.tsx b/web/src/components/Home/Tabs/PersonalInfo.tsx new file mode 100644 index 0000000..74002c8 --- /dev/null +++ b/web/src/components/Home/Tabs/PersonalInfo.tsx @@ -0,0 +1,66 @@ +import { ChevronRight } from "lucide-react"; +import { type FC } from "react"; + +const PersonalInfo: FC = () => { + return ( + <> +

+ Your profile info in Home services +

+ +

+ Personal info and options to manage it. You can make some of this info, + like your contact details, visible to others so they can reach you + easily. You can also see a summary of your profiles. +

+ +
+

Basic info

+

+ Some info may be visible to other services and tools using Home Guard.{" "} + + Learn more + +

+ + {/* Profile Picture */} +
+
+

+ Profile picture +

+

+ Add a profile picture to personalize your account +

+
+
+
+ profile pic +
+
+
+ + {/* Name */} +
+
+

+ Name +

+

Amir Adal

+
+
+
+ +
+
+
+
+ + ); +}; + +export default PersonalInfo; diff --git a/web/src/components/Home/TopBar/index.tsx b/web/src/components/Home/TopBar/index.tsx new file mode 100644 index 0000000..95fd8c8 --- /dev/null +++ b/web/src/components/Home/TopBar/index.tsx @@ -0,0 +1,29 @@ +import { type FC } from "react"; +import { barItems } from "../tabs"; + +export interface ITopBarProps { + activeTab: string; + onChangeTab: (tab: string) => void; +} + +const TopBar: FC = ({ activeTab, onChangeTab }) => { + return ( +
+ {barItems.map((item) => ( +
onChangeTab(item.tab)} + className={`flex-shrink-0 transition-all border-b-4 px-4 py-2 min-w-[120px] sm:min-w-0 sm:flex-1 flex items-center justify-center cursor-pointer select-none whitespace-nowrap text-sm font-medium ${ + item.tab === activeTab + ? " border-b-4 border-b-blue-500 text-blue-500" + : " border-b-transparent text-gray-500" + }`} + > + {item.title} +
+ ))} +
+ ); +}; + +export default TopBar; diff --git a/web/src/components/Home/tabs.tsx b/web/src/components/Home/tabs.tsx new file mode 100644 index 0000000..344345a --- /dev/null +++ b/web/src/components/Home/tabs.tsx @@ -0,0 +1,19 @@ +import { Home, Settings2, User } from "lucide-react"; + +export const barItems = [ + { + icon: , + title: "Home", + tab: "home", + }, + { + icon: , + title: "Personal Info", + tab: "personal-info", + }, + { + icon: , + title: "Data & Personalization", + tab: "data-personalization", + }, +]; diff --git a/web/src/pages/Index/index.tsx b/web/src/pages/Index/index.tsx index 9e05b47..2ed88c8 100644 --- a/web/src/pages/Index/index.tsx +++ b/web/src/pages/Index/index.tsx @@ -1,20 +1,24 @@ -import { type FC } from "react"; +import { useState, type FC } from "react"; // import overlay from "@/assets/overlay.jpg"; // import darkOverlay from "@/assets/dark-overlay.jpg"; import { Card, CardContent } from "@/components/ui/card"; -import { ChevronDown, ChevronRight } from "lucide-react"; +import { ChevronRight } from "lucide-react"; +import Sidebar from "@/components/Home/Sidebar"; +import TopBar from "@/components/Home/TopBar"; +import Home from "@/components/Home/Tabs/Home"; +import PersonalInfo from "@/components/Home/Tabs/PersonalInfo"; const IndexPage: FC = () => { - // console.log(overlay); + const [tab, setTab] = useState("home"); + return (
- +
icon @@ -28,102 +32,19 @@ const IndexPage: FC = () => { {/* */} -
-
-
- {/* */} - profile pic + setTab(tab)} /> +
+
+ setTab(tab)} /> + {tab === "home" && } + {/* {tab === "personal-info" && } */}
-

- Amir Adal -

-
-

- qwer.009771@gmail.com -

-
- -
-
-
-
-
- Home -
- -
- Personal Info -
- -
- Data & Personalization -
-
-
-
-

- Your profile info in Home services -

- -

- Personal info and options to manage it. You can make some of - this info, like your contact details, visible to others so - they can reach you easily. You can also see a summary of your - profiles. -

- -
-

- Basic info -

-

- Some info may be visible to other services and tools using - Home Guard.{" "} - - Learn more - -

- - {/* Profile Picture */} -
-
-

- Profile picture -

-

- Add a profile picture to personalize your account -

-
-
-
- profile pic -
-
-
- - {/* Name */} -
-
-

- Name -

-

- Amir Adal -

-
-
-
- -
-
+
+ {tab === "personal-info" && }