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

[Feat/requestlist] Pair-Programming #137

Merged
merged 30 commits into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f4e947b
Refactor: console 삭제
taehong0-0 Nov 10, 2021
c47d7c1
Feat: RequestListType 추가
taehong0-0 Nov 10, 2021
b6ac76a
Feat: RequestList Footer추가
taehong0-0 Nov 10, 2021
4ab1082
Style: RequestList Side스타일 수정, button Style수정
taehong0-0 Nov 10, 2021
f40a736
Fix: Request type수정 state수정
taehong0-0 Nov 10, 2021
6dfc713
Fix: Request Side 오류 수정 및 완성 - colse #124
taehong0-0 Nov 10, 2021
9f65e6d
Feat: 4:4 미팅추가 - close #127
taehong0-0 Nov 10, 2021
b1f3874
Feat: DropDownType onclick 추가
taehong0-0 Nov 10, 2021
a7bfd98
Fix: Type Error 수정
taehong0-0 Nov 10, 2021
a13d110
Feat: Header Menu 수정 - close #131
taehong0-0 Nov 10, 2021
69e6396
etc: 오타수정
taehong0-0 Nov 10, 2021
de8b085
Fix: Style 수정, Header 수정 - close #132
taehong0-0 Nov 10, 2021
86ab743
Feat : TeamInfo Update [#110]
taehong0-0 Nov 10, 2021
551b8e4
Feat : Create Team [#111]
taehong0-0 Nov 10, 2021
290db4d
Fix : Server Fix
taehong0-0 Nov 10, 2021
cecae45
Fix : Recoil Atom , Selector
taehong0-0 Nov 10, 2021
313c57a
Feat : React.Suspense fallback
taehong0-0 Nov 10, 2021
f1bc1b0
Feat : Post Team Data Type
taehong0-0 Nov 10, 2021
a553c85
Feat : User Info Data get
taehong0-0 Nov 10, 2021
59b6c19
Style : MainHeader
taehong0-0 Nov 10, 2021
c1775d6
Delete : TeamCreateIcon
taehong0-0 Nov 10, 2021
337d514
Feat : Recoil State Team [#101]
taehong0-0 Nov 10, 2021
a358d05
Fix : Merge Conflict
taehong0-0 Nov 10, 2021
fac0579
Fix: Server login
taehong0-0 Nov 10, 2021
0a8bc75
Feat : CowDogPage Recoil , get Data , Infinity Scroll [#135,#136,#113]
taehong0-0 Nov 10, 2021
4a56e34
Feat : Update MyInfo - close #109
taehong0-0 Nov 10, 2021
68699e2
Feat : RequestInfo, JoinChatInfo Recoil 추가 - closes #102, #104
taehong0-0 Nov 10, 2021
8dfa99c
Fix : Login Error
taehong0-0 Nov 10, 2021
c073cca
Refactor : console.log 삭제 및 수정
taehong0-0 Nov 11, 2021
62541e0
Fix : Merge Conflict
taehong0-0 Nov 11, 2021
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
29 changes: 28 additions & 1 deletion client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
import React from "react";
/* eslint-disable spaced-comment */
/* eslint-disable no-console */
import React, { useEffect } from "react";
import { Global } from "@emotion/react";
import { Redirect, Route, Switch } from "react-router";
import { useRecoilValue, useSetRecoilState } from "recoil";
import reset from "./util/reset";
import MainPage from "./Page/MainPage";
import Page from "./Page/Page";
import Footer from "./Molecules/Footer";
import ChatRoom from "./Page/ChatRoom";
import { fetchGet } from "./Recoil/Selector";
// import { joinChatRoomState, requestState, userState } from "./Recoil/Atom";
import { userState } from "./Recoil/Atom";

function App() {
const url = `${process.env.REACT_APP_GET_USER_INFO_API_URL}`;

const userInfo = useRecoilValue(fetchGet({ url, query: "" }));
// const requestInfo = useRecoilValue(fetchGet({ url: "api/core/request", query: `?uid=${userInfo.uid}` }));
// const joinChatInfo = useRecoilValue(fetchGet({ url: "/api/core/joinChatInfo", query: `?uid=${userInfo.uid}` }));

const setUserInfo = useSetRecoilState(userState);
// const setRequestInfo = useSetRecoilState(requestState);
// const setJoinChatInfo = useSetRecoilState(joinChatRoomState);

const getInitData = async () => {
setUserInfo(userInfo);
// setRequestInfo(requestInfo);
// setJoinChatInfo(joinChatInfo);
};

useEffect(() => {
if (userInfo.uid === "") return;
getInitData();
}, [userInfo]);

return (
<>
<Global styles={reset} />
Expand Down
4 changes: 0 additions & 4 deletions client/src/Atom/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ export const Button = styled.div`
cursor: pointer;
background-color: #fff;

& + & {
border-top: none;
}

&:hover {
background-color: #ffcfcf;
color: #ffffff;
Expand Down
31 changes: 0 additions & 31 deletions client/src/Atom/TeamCreateIcon.tsx

This file was deleted.

11 changes: 5 additions & 6 deletions client/src/Molecules/DropDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ const ChatDropDownStyle = css`
`;
const MeetingDropDownStyle = css`
position: absolute;
margin-left: 150px;
margin-bottom: 150px;
margin-left: 250px;
margin-top: 80px;
${BasicDropDownStyle}
`;

const DropDownStyle = (props: { type: string; className: string }) => css`
Expand All @@ -83,15 +84,13 @@ const DropDownContainer = styled.div`
`;

export default function DropDown(props: DropDownType) {
const { type, className } = props;
const { type, className, onClick } = props;

const list = MENU_LIST[type];

return (
<DropDownContainer type={type} className={className}>
{list.map((menu) => (
<LinkButton url={menu.link} type="LargeDropDown" content={menu.name} />
))}
{list.map((menu) => (menu.name === "미팅 하러가기" ? <LinkButton url={menu.link} type="LargeDropDown" content={menu.name} onClick={onClick} /> : <LinkButton url={menu.link} type="LargeDropDown" content={menu.name} />))}
</DropDownContainer>
);
}
1 change: 1 addition & 0 deletions client/src/Molecules/MainBodyLeftButtonContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function MainBodyLeftButtonContainer() {
{ link: "/sub/CowDogPage?person=1", name: "1:1 소개팅" },
{ link: "/sub/CowDogPage?person=2", name: "2:2 미팅" },
{ link: "/sub/CowDogPage?person=3", name: "3:3 미팅" },
{ link: "/sub/CowDogPage?person=4", name: "4:4 미팅" },
{ link: "/sub/teamSetting", name: "팀 설정" },
];

Expand Down
4 changes: 2 additions & 2 deletions client/src/Molecules/MainHeaderCenter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import MainHeaderLogo from "../Atom/MainHeaderLogo";
const mainHeaderCenterStyle = css`
position: relative;
width: 210px;
justify-content: center;
top: 50%;
margin: 0 auto;
top: 30%;
`;

function MainHeaderCenter() {
Expand Down
35 changes: 25 additions & 10 deletions client/src/Molecules/MainHeaderRightSide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,24 @@

import { css } from "@emotion/react";
import React, { useRef, useState } from "react";
import { useRecoilValue } from "recoil";
import UserIcon from "../Atom/UserIcon";
import useDropDownEvent from "../Hook/useDropDownEvent";
import { userState } from "../Recoil/Atom";
import DropDown from "./DropDown";
import LinkButton from "./LinkButton";

const MainHeaderRightContainer = css`
margin-top: 50px;
margin-right: 80px;
display: flex;
justify-content: flex-end;
align-items: center;
`;
function MainHeaderRightSide() {
const userInfo = useRecoilValue(userState);
const { id } = userInfo;

const [userOpen, setUser] = useState(false);
const ToggleUserModal = () => {
setUser((isOpen) => !isOpen);
Expand All @@ -16,16 +29,18 @@ function MainHeaderRightSide() {

useDropDownEvent(userRef, () => setUser(false));
return (
<div
css={css`
margin-top: 50px;
margin-right: 80px;
`}
ref={userRef}
>
<UserIcon onClick={() => ToggleUserModal()} />
<DropDown type="User" className={userOpen ? "show" : "hide"} />
</div>
<>
<div css={MainHeaderRightContainer}>
{id === "" ? (
<LinkButton url="/sub/login" type="Small" content="로그인" />
) : (
<div ref={userRef}>
<UserIcon onClick={() => ToggleUserModal()} />
<DropDown type="User" className={userOpen ? "show" : "hide"} />
</div>
)}
</div>
</>
);
}

Expand Down
31 changes: 25 additions & 6 deletions client/src/Organism/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
import { css } from "@emotion/react";
import { useRef, useState } from "react";
import { Link } from "react-router-dom";
import { useRecoilValue } from "recoil";
import MainHeaderLogo from "../Atom/MainHeaderLogo";
import Menu from "../Atom/Menu";
import UserIcon from "../Atom/UserIcon";
import useDropDownEvent from "../Hook/useDropDownEvent";
import DropDown from "../Molecules/DropDown";
import LinkButton from "../Molecules/LinkButton";
import { userState } from "../Recoil/Atom";

const HeaderStyle = css`
display: flex;
Expand All @@ -26,15 +29,26 @@ const HeaderStyle = css`
export default function Header() {
const [menuOpen, setMenuOpen] = useState(false);
const [userOpen, setUserOpen] = useState(false);
const [meetingOpen, setMeetingOpen] = useState(false);

const userInfo = useRecoilValue(userState);
const { id } = userInfo;

const menuRef = useRef<HTMLDivElement>(null);
const userRef = useRef<HTMLDivElement>(null);

useDropDownEvent(menuRef, () => setMenuOpen(false));
useDropDownEvent(menuRef, () => {
setMenuOpen(false);
setMeetingOpen(false);
});
useDropDownEvent(userRef, () => setUserOpen(false));

const ToggleMenuModal = () => {
setMenuOpen((isOpen) => !isOpen);
setMeetingOpen(false);
};
const ToggleMeetingModal = () => {
setMeetingOpen((isOpen) => !isOpen);
};
const ToggleUserModal = () => {
setUserOpen((isOpen) => !isOpen);
Expand All @@ -44,15 +58,20 @@ export default function Header() {
<div css={HeaderStyle} id="header">
<div ref={menuRef}>
<Menu onClick={() => ToggleMenuModal()} />
<DropDown type="Menu" className={menuOpen ? "show" : "hide"} />
<DropDown type="Menu" className={menuOpen ? "show" : "hide"} onClick={() => ToggleMeetingModal()} />
<DropDown type="Meeting" className={meetingOpen ? "show" : "hide"} />
</div>
<Link to="/main">
<MainHeaderLogo />
</Link>
<div ref={userRef}>
<UserIcon onClick={() => ToggleUserModal()} />
<DropDown type="User" className={userOpen ? "show" : "hide"} />
</div>
{id === "" ? (
<LinkButton url="/sub/login" type="Small" content="로그인" />
) : (
<div ref={userRef}>
<UserIcon onClick={() => ToggleUserModal()} />
<DropDown type="User" className={userOpen ? "show" : "hide"} />
</div>
)}
</div>
);
}
7 changes: 3 additions & 4 deletions client/src/Organism/MainHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { css } from "@emotion/react";
import MainHeaderCenter from "../Molecules/MainHeaderCenter";
import MainHeaderRightSide from "../Molecules/MainHeaderRightSide";

// display: flex;
// justify-content: space-between;
const mainHeaderStyle = css`
display: flex;
justify-content: space-between;
width: 100vw;
height: 30vh;
.hide {
Expand All @@ -19,9 +19,8 @@ const mainHeaderStyle = css`
function MainHeader() {
return (
<div css={mainHeaderStyle}>
<div />
<MainHeaderCenter />
<MainHeaderRightSide />
<MainHeaderCenter />
</div>
);
}
Expand Down
47 changes: 38 additions & 9 deletions client/src/Organism/MyInfoContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
/** @jsxImportSource @emotion/react */
import { css } from "@emotion/react";
import { useRef } from "react";
import { useRecoilState } from "recoil";
import { Button } from "../Atom/Button";
import { Input } from "../Atom/Input";
// import TeamInfoImageContainer from "./TeamInfoImageContainer";
import { userState } from "../Recoil/Atom";
import { changeMyInfo } from "../util";

const MyInfoContainerStyle = css`
width: 350px;
Expand All @@ -27,27 +30,53 @@ const MyInfoContainerStyle = css`
}
`;
export default function MyInfoContainer() {
const [myInfo, setMyInfo] = useRecoilState(userState);

const { id, location, age, info } = myInfo;
const idInputRef = useRef<HTMLInputElement>(null);
const ageInputRef = useRef<HTMLInputElement>(null);
const locationInputRef = useRef<HTMLInputElement>(null);
const infoInputRef = useRef<HTMLInputElement>(null);

// 복붙

const handleChangeMyInfo = async () => {
if (!idInputRef.current || !ageInputRef.current || !locationInputRef.current || !infoInputRef.current) return;

const data = await changeMyInfo({ id: idInputRef.current.value, location: locationInputRef.current.value, age: Number(ageInputRef.current.value), info: infoInputRef.current.value });

if (data) {
setMyInfo({
...myInfo,
id: idInputRef.current.value,
location: locationInputRef.current.value,
age: Number(ageInputRef.current.value),
info: infoInputRef.current.value,
});
} else {
console.log("myInfo 수정 실패");
}
};
return (
<>
<div css={MyInfoContainerStyle}>
<div className="myinfo-header">
<span>내 프로필</span>
<Button type="medium">edit</Button>
<Button type="medium" onClick={handleChangeMyInfo}>
edit
</Button>
</div>
<div className="myinfo">
<span>이름</span>
<Input placeholder="ID" autoComplete="off" />
<Input placeholder={id} autoComplete="off" ref={idInputRef} />
<span>나이</span>
<Input placeholder="age" autoComplete="off" />
<Input placeholder={String(age)} autoComplete="off" ref={ageInputRef} />
<span>주소</span>
<Input placeholder="address" autoComplete="off" />
<span>이메일</span>
<Input placeholder="e-mail" autoComplete="off" />
<Input placeholder={location} autoComplete="off" ref={locationInputRef} />
<span>소개</span>
<Input placeholder="소개" autoComplete="off" />
<Input placeholder={info} autoComplete="off" ref={infoInputRef} />
</div>
</div>
{/* <TeamInfoImageContainer image={teamImage} /> */}
</>
);
}
Loading