Skip to content

Commit

Permalink
Merge pull request #4 from developer-jyyun/develop
Browse files Browse the repository at this point in the history
Feat: "Add header"
  • Loading branch information
NamgungJongMin authored Sep 12, 2023
2 parents 4749536 + 58a06c4 commit abb0338
Show file tree
Hide file tree
Showing 4 changed files with 182 additions and 2 deletions.
34 changes: 34 additions & 0 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React from 'react';
import '../scss/components/_header.scss';
import { Link } from 'react-router-dom';
const Header = (): JSX.Element => {
return (
<header className="header shadow">
<div className="header__logo">
<Link to="/">
<span> HIGH FIVE</span>
{/* <img src="" alt="" />*/}
</Link>
</div>

<div className="header__user">
<div className="header__user-img"></div>
<span className="header__user-name">김땡땡</span>
<button className="header__user-login-btn btn">로그인</button>
</div>
<nav className="header__drop-down shadow">
<ul>
<li>
<Link to="/">근태관리</Link>
</li>
<li>
<Link to="/">마이페이지</Link>
</li>
<li>로그아웃</li>
</ul>
</nav>
</header>
);
};

export default Header;
8 changes: 8 additions & 0 deletions src/scss/base/_normalize.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ pre {

a {
background-color: transparent;
text-decoration: none;
color: #000;
}

/**
Expand Down Expand Up @@ -354,3 +356,9 @@ template {
em {
font-style: normal;
}

ul,
ol {
padding-left: 0;
list-style: none;
}
132 changes: 132 additions & 0 deletions src/scss/components/_header.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
@use '../abstracts' as *;

.header {
padding: 1rem 4rem;
height: 60px;
background: $white;
position: sticky;
top: 0;
z-index: 9;
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
box-sizing: border-box;
margin-bottom: 1.5rem;

&__logo {
width: 120px;
height: 40px;
display: block;

// 나중에 이미지로 대체시 삭제 해 주세요
display: inline-block;
width: 120px;
height: 40px;
font-size: $font-lg;
font-weight: $font-bold700;
text-align: center;
padding: 1rem;
line-height: 40px;
// 나중에 이미지로 대체시 삭제 해 주세요
&__logo img {
width: 100%;
}
}

&__user {
display: flex;
justify-content: flex-end;
align-items: center;
gap: 14px;
position: relative;

&-img {
display: block;
width: 30px;
height: 30px;
border-radius: 50%;
border: 1px solid #ccc;
cursor: pointer;
margin: auto;
transition: 0.3s;
background-image: url('https://startbootstrap.github.io/startbootstrap-sb-admin-2/img/undraw_profile.svg');
background-size: cover;
}
&-img:hover {
transform: scale(1.2);
}
&-img img {
width: 100%;
}
}

&__drop-down {
@include flex-center-col;
width: 120px;
background: $white;
position: absolute;
top: 65px;
right: 5px;
box-sizing: border-box;
border-radius: 10px;
& ul {
width: 100%;
text-align: center;
& li {
padding: 0.5rem;
&a {
display: inline-block;
}
}
}
}
}

.btn {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background: $blue;
color: $white;
margin: 0;
padding: 0.5rem 1rem;
font-size: 1rem;
font-weight: 400;
text-align: center;
text-decoration: none;
border: none;
border-radius: 4px;
display: inline-block;
width: auto;
box-shadow:
0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06);
cursor: pointer;
transition: 0.5s;
}
.btn:active,
.btn:hover,
.btn:focus {
background: $darkBlue;
outline: 0;
}

.shadow {
box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

@media (max-width: 600px) {
.header {
padding: 1rem 2rem;
}

.header__logo {
font-size: medium;
}
}
@media (max-width: 330px) {
.header__logo {
font-size: small;
}
}
10 changes: 8 additions & 2 deletions src/views/LandingPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import React from 'react';
import Header from '../components/Header';
import '../scss/base/_index.scss';

export const LandingPage = () => {
return <div>LandingPage</div>;
export const LandingPage = (): JSX.Element => {
return (
<div>
<Header />
</div>
);
};

0 comments on commit abb0338

Please sign in to comment.