Skip to content

Commit

Permalink
[Feat] 로그인 컴포넌트 브랜치 병합
Browse files Browse the repository at this point in the history
- 로그인/로그아웃 관련 컴포넌트 구현으로 인한 브랜치 병합

Issues #11
  • Loading branch information
novice1993 committed Sep 1, 2023
2 parents 52c66e9 + e790a07 commit 364334d
Show file tree
Hide file tree
Showing 12 changed files with 972 additions and 19 deletions.
91 changes: 91 additions & 0 deletions client/package-lock.json

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

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"preview": "vite preview"
},
"dependencies": {
"axios": "^1.5.0",
"echarts": "^5.4.3",
"echarts-for-react": "^3.0.2",
"react": "^18.2.0",
Expand Down
2 changes: 2 additions & 0 deletions client/src/asset/images/GoogleLogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions client/src/asset/images/KakaoLogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions client/src/components/Headers/LoginHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import StockHolmLogo from "../../asset/images/StockHolmLogo.png";
import SampleProfile from "../../asset/images/ProfileSample.png";
import AlarmImage from "../../asset/images/alarm.png";

const LoginHeader: React.FC = () => {
const LoginHeader: React.FC<LoginHeaderProps> = ({ onLogoutClick }) => {
const [searchValue, setSearchValue] = useState<string>('');

const handleSearchChange = (event: React.ChangeEvent<HTMLInputElement>) => {
Expand All @@ -30,12 +30,18 @@ const LoginHeader: React.FC = () => {
<ProfileButton>
<ProfileImage src={SampleProfile} />
</ProfileButton>
<LogoutButton>{logoutText}</LogoutButton>
<LogoutButton onClick={onLogoutClick}>{logoutText}</LogoutButton> {/* 로그아웃 버튼 클릭 시 onLogoutClick 실행 */}
</UserActions>
</HeaderContainer>
);
};

export default LoginHeader;

interface LoginHeaderProps {
onLogoutClick: () => void; // 로그아웃 클릭 핸들러 타입 정의
}

const HeaderContainer = styled.div`
display: flex;
justify-content: space-between;
Expand Down Expand Up @@ -124,4 +130,3 @@ const LogoutButton = styled.button`



export default LoginHeader;
21 changes: 7 additions & 14 deletions client/src/components/Headers/LogoutHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
<<<<<<< HEAD:client/src/components/header.tsx
import React, { useState } from "react";
import styled from "styled-components";
import StockHolmLogo from "../asset/images/StockHolmLogo.png";
import StockHolmLogo from "../../asset/images/StockHolmLogo.png";

const Header: React.FC = () => {
const LogoutHeader: React.FC<LogoutHeaderProps> = ({ onLoginClick }) => {
const [searchValue, setSearchValue] = useState<string>("");
=======

import React, { useState } from 'react';
import styled from 'styled-components';
import StockHolmLogo from "../../asset/images/StockHolmLogo.png"

const LogoutHeader: React.FC = () => {
const [searchValue, setSearchValue] = useState<string>('');
>>>>>>> abeda5eea2cb094da744b5034865c55e4cbb769f:client/src/components/Headers/LogoutHeader.tsx

const handleSearchChange = (event: React.ChangeEvent<HTMLInputElement>) => {
setSearchValue(event.target.value);
Expand All @@ -31,7 +21,7 @@ const LogoutHeader: React.FC = () => {
<LogoImage src={StockHolmLogo} />
</LogoButton>
<SearchBar value={searchValue} onChange={handleSearchChange} />
<LoginButton>{loginText}</LoginButton>
<LoginButton onClick={onLoginClick}>{loginText}</LoginButton>
</HeaderContainer>
);
};
Expand All @@ -52,7 +42,7 @@ const LogoButton = styled.button`
border: none;
cursor: pointer;
padding: 0;
&:focus {
outline: none;
}
Expand Down Expand Up @@ -86,5 +76,8 @@ const LoginButton = styled.button`
background-color: #f2f2f2; // 호버 시 약간 어두운 흰색으로 변경
}
`;
interface LogoutHeaderProps {
onLoginClick: () => void;
}

export default LogoutHeader;
Loading

0 comments on commit 364334d

Please sign in to comment.