FE Auth vendor changes (#270)

This commit is contained in:
Kerem Yilmaz
2024-05-07 11:31:05 -07:00
committed by GitHub
parent 0862232db4
commit 5ce37dfaaf
16 changed files with 99 additions and 32 deletions

View File

@@ -3,10 +3,9 @@ import { ExitIcon, PersonIcon } from "@radix-ui/react-icons";
type Props = {
name: string;
onLogout?: () => void;
};
function Profile({ name, onLogout }: Props) {
function Profile({ name }: Props) {
return (
<div className="flex items-center border-2 p-2 rounded-lg">
<div className="flex gap-2 items-center">
@@ -14,13 +13,7 @@ function Profile({ name, onLogout }: Props) {
<p className="w-40 overflow-hidden text-ellipsis">{name}</p>
</div>
<div>
<Button
variant="outline"
size="icon"
onClick={() => {
onLogout?.();
}}
>
<Button variant="outline" size="icon">
<ExitIcon className="h-4 w-4" />
</Button>
</div>

View File

@@ -7,11 +7,7 @@ import { Profile } from "./Profile";
import { useContext } from "react";
import { UserContext } from "@/store/UserContext";
type Props = {
onLogout?: () => void;
};
function RootLayout({ onLogout }: Props) {
function RootLayout() {
const user = useContext(UserContext);
return (
@@ -30,7 +26,7 @@ function RootLayout({ onLogout }: Props) {
<SideNav />
{user ? (
<div className="absolute bottom-2 left-0 w-72 px-6 shrink-0">
<Profile name={user.name} onLogout={onLogout} />
<Profile name={user.name} />
</div>
) : null}
</aside>

View File

@@ -8,12 +8,12 @@ import { NavLink } from "react-router-dom";
function SideNav() {
return (
<nav className="flex flex-col gap-4">
<nav>
<NavLink
to="create"
className={({ isActive }) => {
return cn(
"flex items-center px-6 py-2 hover:bg-primary-foreground rounded-2xl",
"flex items-center px-6 py-4 hover:bg-primary-foreground rounded-2xl",
{
"bg-primary-foreground": isActive,
},
@@ -27,7 +27,7 @@ function SideNav() {
to="tasks"
className={({ isActive }) => {
return cn(
"flex items-center px-6 py-2 hover:bg-primary-foreground rounded-2xl",
"flex items-center px-6 py-4 hover:bg-primary-foreground rounded-2xl",
{
"bg-primary-foreground": isActive,
},
@@ -41,7 +41,7 @@ function SideNav() {
to="settings"
className={({ isActive }) => {
return cn(
"flex items-center px-6 py-2 hover:bg-primary-foreground rounded-2xl",
"flex items-center px-6 py-4 hover:bg-primary-foreground rounded-2xl",
{
"bg-primary-foreground": isActive,
},