Skip to content

Commit

Permalink
[#37] fix: Navbar dropdown buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
rosieyeon committed Feb 3, 2022
1 parent c2c1d25 commit 4fe2da6
Show file tree
Hide file tree
Showing 11 changed files with 128 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/components/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function Login() {
const currentToken = localStorage.getItem("accessToken");
if (currentToken !== null) {
navigate({
pathname: "/home",
pathname: "/home/tab=todays",
state: { email: email },
});
window.location.reload();
Expand Down
8 changes: 3 additions & 5 deletions src/components/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,15 +295,15 @@ function Navbar() {
</div>
<div className="navbar-dropdown-list">
<button
className="dropdown-menu"
// className="dropdown-menu"
onClick={() => {
navigate("profile");
}}
>
내 프로필
</button>
<button
className="dropdown-menu"
// className="dropdown-menu"
onClick={() => {
navigate("settings");
}}
Expand All @@ -312,9 +312,7 @@ function Navbar() {
</button>
</div>
<div className="navbar-dropdown-list">
<button className="dropdown-menu" onClick={onClickLogout}>
로그아웃
</button>
<button onClick={onClickLogout}>로그아웃</button>
</div>
</div>
</div>
Expand Down
41 changes: 36 additions & 5 deletions src/pages/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { useEffect, useState } from "react";
import { Outlet } from "react-router-dom";
import NavbarHome from "../components/navbarHome";
import isLogin from "../utils/isLogin";
import "../statics/css/home.css";

export default function Home() {
const TOKEN = localStorage.getItem("accessToken");
Expand Down Expand Up @@ -39,11 +40,41 @@ export default function Home() {
return (
<div>
<NavbarHome sticky="top" />
<div className="home-userprofile">
<div className="home-userprofile-userimg"></div>
<div className="home-userprofile-nickname"></div>
<div className="home-userprofile-email"></div>
<div className="home-userprofile-msg"></div>
<div className="home-profile">
<div className="home-profile-userimg">
{profileImg === null && (
<svg
className="home-profile-img"
// width="40"
// height="40"
viewBox="0 0 40 40"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g clipPath="url(#clip0_233_15455)">
<path
d="M0 20C0 8.95431 8.95431 0 20 0C31.0457 0 40 8.95431 40 20C40 31.0457 31.0457 40 20 40C8.95431 40 0 31.0457 0 20Z"
fill="#f4f4f4"
/>
<path
d="M40 34.9906V40.0023H0V35.009C2.32658 31.8997 5.34651 29.3762 8.81965 27.6391C12.2928 25.9019 16.1233 24.9991 20.0067 25.0023C28.18 25.0023 35.44 28.9256 40 34.9906ZM26.67 15.0006C26.67 16.7688 25.9676 18.4645 24.7174 19.7147C23.4671 20.9649 21.7714 21.6673 20.0033 21.6673C18.2352 21.6673 16.5395 20.9649 15.2893 19.7147C14.039 18.4645 13.3367 16.7688 13.3367 15.0006C13.3367 13.2325 14.039 11.5368 15.2893 10.2866C16.5395 9.03636 18.2352 8.33398 20.0033 8.33398C21.7714 8.33398 23.4671 9.03636 24.7174 10.2866C25.9676 11.5368 26.67 13.2325 26.67 15.0006Z"
fill="#c0c0c0"
/>
</g>
<defs>
<clipPath id="clip0_233_15455">
<path
d="M0 20C0 8.95431 8.95431 0 20 0C31.0457 0 40 8.95431 40 20C40 31.0457 31.0457 40 20 40C8.95431 40 0 31.0457 0 20Z"
fill="white"
/>
</clipPath>
</defs>
</svg>
)}
</div>
<div className="home-profile-nickname">{nickname}</div>
<div className="home-profile-email"></div>
<div className="home-profile-msg"></div>
</div>
<Outlet />
</div>
Expand Down
14 changes: 14 additions & 0 deletions src/statics/css/Schedule.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/statics/css/Schedule.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions src/statics/css/home.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/statics/css/home.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/statics/css/navbar.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/statics/css/navbar.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions src/statics/scss/home.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@import "main.scss";

.home-profile {
font-family: $font-family;
display: flex;
flex-direction: column;
position: fixed;
top: 108px;
left: 8%;
.home-profile-userimg {
svg {
&.home-profile-img {
height: 256px;
}
}
}
.home-profile-nickname {
}
}
6 changes: 4 additions & 2 deletions src/statics/scss/navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}
.navbar-dropdown {
font-family: $font-family;
position: absolute;
position: fixed;
top: 46px;
right: 20px;
width: 180px;
Expand All @@ -53,7 +53,8 @@
border-radius: 4px;
color: #4b4b4b;
z-index: 1;
.dropdown-menu {
// button {
& button {
cursor: pointer;
border: none;
background-color: var(--bgColor);
Expand All @@ -65,6 +66,7 @@
&:hover {
background-color: var(--borderColor);
}
// }
}
.navbar-dropdown-list {
display: flex;
Expand Down

0 comments on commit 4fe2da6

Please sign in to comment.