Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avatar #51

Merged
merged 3 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backend/database/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ CREATE TABLE
`naissance` DATE NOT NULL,
`civility` BOOLEAN NOT NULL,
`password` varchar(50) not null,
`IsAdmin` bool not null
`IsAdmin` bool not null,
`avatar` varchar(255) not null
);

DROP TABLE IF EXISTS `film`;
Expand Down
97 changes: 97 additions & 0 deletions frontend/src/assets/icons/FemaleAvatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions frontend/src/components/NavBar.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { NavLink } from "react-router-dom";
import { useUser } from "../contexts/UserContext";

function NavBar() {
const { user } = useUser();
return (
<div className="navbar">
<div className="nav-icon-container">
Expand All @@ -22,6 +24,24 @@ function NavBar() {
</NavLink>
</div>
<div className="nav-icon-container">
<NavLink to="/Connection" className="profile-icon" />
{user ? (
<img
className="icon"
src={
user.civility === 0
? "/src/assets/icons/avatar1.svg"
: "/src/assets/icons/FemaleAvatar.svg"
}
alt="avatar"
/>
) : (
<img
className="icon"
src="/src/assets/icons/profile_icon.svg"
alt="connexion"
/>
)}
<NavLink to="/AregarderPlusTard" className="profile-icon">
<img
className="icon"
Expand Down
24 changes: 19 additions & 5 deletions frontend/src/components/NavBarDesktop.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { NavLink } from "react-router-dom";
import { useUser } from "../contexts/UserContext";

function NavBarDesktop() {
const { user } = useUser();
return (
<div className="navbar-desktop">
<img className="logo" src="/src/assets/icons/logo.svg" alt="logo" />
Expand All @@ -14,11 +16,23 @@ function NavBarDesktop() {
</NavLink>
</div>
<NavLink className="link" to="/Connection">
<img
className="icon"
src="/src/assets/icons/avatardesktop.svg"
alt="connexion"
/>
{user ? (
<img
className="icon"
src={
user.civility === 0
? "/src/assets/icons/avatar1.svg"
: "/src/assets/icons/FemaleAvatar.svg"
}
alt="avatar"
/>
) : (
<img
className="icon"
src="/src/assets/icons/profile_icon.svg"
alt="connexion"
/>
)}
</NavLink>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import "./sass/index.scss";
import { SerieProvider } from "./contexts/SerieContext";
import UserProfil from "./pages/UserProfil";


const router = createBrowserRouter([
{
path: "/",
Expand Down
Empty file removed frontend/src/pages/SettingUser.jsx
Empty file.