Skip to content

Commit

Permalink
Created profile view
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscoronab committed Dec 2, 2024
1 parent 60f4da6 commit 210dc19
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 0 deletions.
Binary file added frontend/public/avatar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions frontend/src/app/(page)/profile/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"use client";

import React, { ReactNode } from "react";

interface ProfileLayoutProps {
children: ReactNode;
}

const ProfileLayout: React.FC<ProfileLayoutProps> = ({ children }) => {
return (
<>
<div
className="min-h-screen bg-cover bg-top bg-no-repeat"
style={{ backgroundImage: "url('/bg-5.jpg')" }}
>
<div className="bg-black bg-opacity-40 min-h-screen">
{children}
</div>
</div>
</>
);
};

export default ProfileLayout;
67 changes: 67 additions & 0 deletions frontend/src/app/(page)/profile/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
"use client";

import { useState } from "react";
import Link from "next/link";
import { usePathname } from "next/navigation";
import Image from "next/image";
import { Button, buttonVariants } from "@/components/ui/button";
import { Eye } from "lucide-react";
import { EyeOff } from "lucide-react";

const Profile = () => {
const pathname = usePathname();
const [clicked, setClicked] = useState(false);
const handleClick = () => {
setClicked(!clicked);
};
return (
<div className="flex flex-col justify-evenly w-full min-h-screen md:w-5/6 mx-auto py-4 p-2">
<section className="flex items-center text-white">
<div className="w-32 sm:w-36 lg:w-48 xl:w-64 text-center">
<Image
src="/avatar.jpg"
alt="avatar"
width={834}
height={227}
className="object-contain w-full h-auto rounded-full border-4 border-primary"
/>
<h3 className="text-base lg:text-xl m-2 font-bold">
Christian
</h3>
</div>
<div className="w-32 sm:w-36 lg:w-48 xl:w-64 text-left mx-10">
<h3 className="text-base lg:text-xl m-2">
<span className="font-bold">Email:</span> [email protected]
</h3>
<div className="flex items-center">
<h3 className="text-base lg:text-xl m-2">
<span className="font-bold">Contraseña:</span> { clicked ? "1234" : "*****" }
</h3>
<div onClick={handleClick}>
{ clicked ? <EyeOff /> : <Eye /> }
</div>
</div>
</div>
</section>
<section className="flex items-center justify-between">
<Link
key="settings"
href="/settings"
className={`text-lg transition-colors ${pathname === "/settings" ? "text-primary"
: "text-white hover:text-primary"}`}>
<Button>Editar perfil</Button>
</Link>
<Link
key="library"
href="/library"
className={`text-lg transition-colors ${pathname === "/library" ? "text-primary"
: "text-white hover:text-primary"}`}>
<Button>Biblioteca</Button>
</Link>
<Button>Cerrar sesión</Button>
</section>
</div>
);
};

export default Profile;
24 changes: 24 additions & 0 deletions frontend/src/app/(page)/settings/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"use client";

import React, { ReactNode } from "react";

interface SettingsLayoutProps {
children: ReactNode;
}

const SettingsLayout: React.FC<SettingsLayoutProps> = ({ children }) => {
return (
<>
<div
className="min-h-screen bg-cover bg-top bg-no-repeat"
style={{ backgroundImage: "url('/bg-5.jpg')" }}
>
<div className="bg-black bg-opacity-40 min-h-screen">
{children}
</div>
</div>
</>
);
};

export default SettingsLayout;
16 changes: 16 additions & 0 deletions frontend/src/app/(page)/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// "use client";

// import { useState } from "react";
// import Link from "next/link";
// import { usePathname } from "next/navigation";
// import { Button, buttonVariants } from "@/components/ui/button";

const Settings = () => {
return (
<div className="w-full md:w-5/6 mx-auto py-4 p-2">
<h1>Configuración</h1>
</div>
);
};

export default Settings;

0 comments on commit 210dc19

Please sign in to comment.