Skip to content

Commit

Permalink
final fix
Browse files Browse the repository at this point in the history
  • Loading branch information
josetano2 committed Aug 23, 2024
1 parent 881afad commit f786e30
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 17 deletions.
20 changes: 7 additions & 13 deletions src/ss_frontend/src/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,13 @@ const Navbar = () => {
</Link>
</div>
<div className="dropdown dropdown-end">
<div
tabIndex={0}
role="button"
className="btn btn-ghost btn-circle avatar"
>
<div className="w-10 rounded-full flex justify-center items-center">
<Link
to={"/profile"}
className="flex flex-col justify-center items-center cursor-pointer hover:mb-2 hover:transition-all"
>
<AiOutlineUser alt="profile" className="text-4xl pl-1" />
</Link>
</div>
<div className="w-10 rounded-full flex justify-center items-center">
<Link
to={"/profile"}
className="flex flex-col justify-center items-center cursor-pointer hover:mb-2 hover:transition-all"
>
<AiOutlineUser className="text-4xl" />
</Link>
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/ss_frontend/src/components/User.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from "react";
import profilePlaceholder from "../assets/profilePlaceholder.jpg";

const User = ({ name, username, profileUrl, description }) => {
return (
<div className="bg-white shadow-md rounded-lg p-4 flex flex-col items-center">
<img
src={profileUrl}
src={profileUrl === "" ? profilePlaceholder : profileUrl}
alt={`${name}'s profile`}
className="w-24 h-24 rounded-full object-cover mb-4"
/>
Expand Down
16 changes: 14 additions & 2 deletions src/ss_frontend/src/pages/ProfileDetailPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,25 @@ export default function ProfileDetailPage() {
<AiOutlineUser className="text-6xl"></AiOutlineUser>
)}
</div>
<div className="mt-4 mb-4 pr-8 pl-8 flex flex-col items-center">
<div className="mt-4 mb-4 pr-8 pl-8 flex flex-col items-center gap-2">
{/* {isAuthenticated} */}
{isAuthenticated ? (
<>
<div className="font-semibold text-2xl">{name}</div>
<p className="text-lg">{"@" + username}</p>
<button className="btn btn-error">Log out</button>
<div className="flex gap-5">
{data && data.ok && data.ok.username === "" && (
<button
className="btn btn-outline btn-info"
onClick={() => {
navigate(`/profile-form`);
}}
>
Register
</button>
)}
<button className="btn btn-outline btn-error">Log out</button>
</div>
</>
) : (
<Link
Expand Down
1 change: 0 additions & 1 deletion src/ss_frontend/src/pages/UsersPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export default function UsersPage() {

async function fetchUsers() {
const allUsers = await ss_backend.getAllUsers();
console.log(allUsers);
if (Array.isArray(allUsers.ok) && allUsers.ok) {
const listItems = allUsers.ok.map((user, idx) => (
<User
Expand Down

0 comments on commit f786e30

Please sign in to comment.