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

Design/#202 메인 화면 디자인 변경 #203

Merged
merged 24 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
60dfc57
Feat: 채널 삭제하는 함수 추가
pp449 Oct 28, 2023
1c6694d
Fix: 내용 수정버튼을 눌러서 나오는 삭제하기 버튼 제거
pp449 Oct 28, 2023
1c4a9d3
Feat: 공지 삭제하는 버튼을 내용 수정 버튼 옆에 배치
pp449 Oct 28, 2023
9aa5262
Chore: 로고 및 배경 사진 추가
navyjeongs Oct 29, 2023
e4a9d4a
Feat: Profile Context에 status 추가
navyjeongs Oct 29, 2023
11cd56e
Feat: refetchOnWindowFocus false로 변경
navyjeongs Oct 29, 2023
74a5237
Feat: 로그인 시 serverSide에서 쿠키 저장하도록 변경
navyjeongs Oct 29, 2023
19f1b20
Feat: 프로필 api status code에 따른 다른 페이지 보여주도록 설정
navyjeongs Oct 29, 2023
d8c0582
Feat: 미 로그인시 보여줄 메인 페이지 생성
navyjeongs Oct 29, 2023
ed7c9e8
Fix: 점수별로 등수 정렬
navyjeongs Oct 29, 2023
f82613f
Chore: 로고 및 배경 사진 추가
navyjeongs Oct 29, 2023
bc0477a
Feat: 메인 채널 Circle 컴포넌트 생성
navyjeongs Oct 29, 2023
f263e3e
Design: 배경 사진 추가
navyjeongs Oct 29, 2023
0087325
Design: 채널 Circle 디자인 변경
navyjeongs Oct 29, 2023
e7ea5bc
Design: Channel Bar 디자인 변경
navyjeongs Oct 29, 2023
e7642e3
Design: 헤더 디자인 변경
navyjeongs Oct 29, 2023
b4520de
Feat: 리그 Circle 내용 변경
navyjeongs Oct 29, 2023
5048f1c
Fix: boardId 타입이 맞지 않는 문제 해결
pp449 Oct 30, 2023
f965e9f
Merge pull request #199 from TheUpperPart/Feat/#198
pp449 Oct 30, 2023
dbbe53f
Merge remote-tracking branch 'origin' into Feat/#197
navyjeongs Oct 30, 2023
fc7bf68
Merge pull request #200 from TheUpperPart/Feat/#197
navyjeongs Oct 30, 2023
4ed92e6
Merge branch 'Feat/#185' of github.com:TheUpperPart/leaguehub-fronten…
navyjeongs Oct 30, 2023
81007ff
Merge pull request #201 from TheUpperPart/Feat/#185
navyjeongs Oct 30, 2023
29ac563
Merge branch 'Design/#202' of github.com:TheUpperPart/leaguehub-front…
navyjeongs Oct 30, 2023
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
Binary file added public/img/board/main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/logo/logo-circle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/logo/logo-l.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/logo/logo-m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/main/main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 20 additions & 18 deletions src/components/Bracket/BracketContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,26 @@ const BracketContents = (props: Props) => {
{match.matchPlayerInfoList.length === 0 ? (
<MatchNoGame>아직 대진표가 생성되지 않았어요 :(</MatchNoGame>
) : (
match.matchPlayerInfoList.map((user) => {
return (
<UserContainer myself={user.gameId === data.myGameId}>
<UserImgContainer>
{user.profileSrc ? (
<UserImg src={user.profileSrc} alt='profile' width={30} height={30} />
) : (
<UserNameImg>
<UserNameImgText>{user.gameId.substring(0, 2)}</UserNameImgText>
</UserNameImg>
)}
</UserImgContainer>

<UserName>{user.gameId}</UserName>
<UserScore>{user.score}</UserScore>
</UserContainer>
);
})
match.matchPlayerInfoList
.sort((a, b) => b.score - a.score)
.map((user) => {
return (
<UserContainer myself={user.gameId === data.myGameId}>
<UserImgContainer>
{user.profileSrc ? (
<UserImg src={user.profileSrc} alt='profile' width={30} height={30} />
) : (
<UserNameImg>
<UserNameImgText>{user.gameId.substring(0, 2)}</UserNameImgText>
</UserNameImg>
)}
</UserImgContainer>

<UserName>{user.gameId}</UserName>
<UserScore>{user.score}</UserScore>
</UserContainer>
);
})
)}
</MatchContent>
</MatchContainer>
Expand Down
3 changes: 0 additions & 3 deletions src/components/Content/ContentModify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ const ContentModify = ({ title, content, onUpdateContent }: ContentModifyProps)
<>
<TitleField placeholder={'제목을 입력해주세요'} defaultValue={title} ref={titleRef} />
<InputField placeholder={'텍스트를 입력해주세요'} defaultValue={content} ref={textRef} />
<ContentButton right='25' backgroundColor='#ff0044'>
삭제하기
</ContentButton>
<ContentButton
right='15'
backgroundColor='grey'
Expand Down
12 changes: 7 additions & 5 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ const Header = () => {
export default Header;

const Headers = styled.header`
width: 100%;
width: calc(100% - 5rem);
margin: 0 2.5rem;
background-color: #f1f1f1;

background-color: #141c24;
border-radius: 0 0 16px 16px;
`;

const Container = styled.div`
Expand All @@ -98,7 +100,7 @@ const LoginBtn = styled.button`
column-gap: 0.5rem;

background-color: inherit;
color: white;
color: #000000;
cursor: pointer;
`;

Expand Down Expand Up @@ -128,8 +130,8 @@ const DropList = styled.li`

display: flex;

background-color: #344051;
color: white;
background-color: #f1f1f1;
color: #000000;

height: 4rem;
border: 1px solid black;
Expand Down
74 changes: 74 additions & 0 deletions src/components/Main/NoAuthMain.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import styled from '@emotion/styled';
import Image from 'next/image';

const NoAuthMain = () => {
return (
<Main>
<Container>
<LogoContainer>
<LogoImage src='/img/logo/logo-l.png' width='584' height='101' alt='logo' />
</LogoContainer>
<Title>당신의 실력을 증명해보세요.</Title>
<ContentText>대회 개최부터 운영, 관전까지</ContentText>
<ContentText>리그허브에서 한번에..</ContentText>

<Footer>
<FooterText>지금 리그에 참여하세요.</FooterText>
<KakaoLogin
href={`https://kauth.kakao.com/oauth/authorize?client_id=${process.env.NEXT_PUBLIC_CLIENT_ID}&redirect_uri=${process.env.NEXT_PUBLIC_REDIRECT_URI}&response_type=code`}
>
<Image src='/img/auth/kakao_login.png' alt='kakao_login' width={300} height={55} />
</KakaoLogin>
</Footer>
</Container>
</Main>
);
};

const Main = styled.div`
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
width: 100%;
height: 100vh;
background: url('/img/main/main.png');
background-size: 100% 100vh;
background-repeat: no-repeat;
`;

const Container = styled.div`
color: white;
height: 50rem;
width: 60rem;
margin: 0 auto;
`;

const LogoContainer = styled.div``;

const LogoImage = styled(Image)`
margin: 0 auto;
`;

const Title = styled.h2`
text-align: center;
font-size: 3.2rem;
margin: 2rem 0;
`;

const ContentText = styled.div`
text-align: center;
font-size: 2rem;
`;
const KakaoLogin = styled.a``;

const FooterText = styled.div`
margin: 4rem 0;
`;
const Footer = styled.div`
margin: 10rem auto 0 auto;
font-size: 2rem;
text-align: center;
`;

export default NoAuthMain;
7 changes: 3 additions & 4 deletions src/components/Sidebar/BoardBar/BoardBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ const BoardBody = ({ channelLink }: Props) => {
const newBoards = [...boards];
const [removed] = newBoards.splice(source.index, 1);
newBoards.splice(destination.index, 0, removed);
console.log(newBoards);
for (let i = 0; i < newBoards.length; i++) {
newBoards[i].boardIndex = i + 1;
}
Expand Down Expand Up @@ -146,13 +145,13 @@ const BoardBody = ({ channelLink }: Props) => {
if (JSON.stringify(boards) === JSON.stringify(data.channelBoardLoadDtoList)) return;
setBoards(data.channelBoardLoadDtoList);
}, [data?.channelBoardLoadDtoList]);

useEffect(() => {
setBoards((prevBoards) => {
return prevBoards.map((board) => {
if (board.boardId === selected) {
if (board.boardId.toString() === selected)
return { ...board, boardTitle: lastVisitedBoardIdLists[channelLink].boardTitle };
}

return board;
});
});
Expand Down
166 changes: 97 additions & 69 deletions src/components/Sidebar/ChannelBar/ChannelBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Modal from '@components/Modal';
import Icon from '@components/Icon';
import useModals from '@hooks/useModals';
import useMakeGame from '@hooks/useMakeGame';
import MainChannelCircle from '../ChannelCircle/MainChannelCircle';

interface ChannelBarProps {
channels: ChannelCircleProps[];
Expand All @@ -36,90 +37,118 @@ const ChannelBar = ({ channels, updateSelectedChannel }: ChannelBarProps) => {

return (
<ChannelbarContainer>
<DragDropContext onDragEnd={dragEnd}>
<Droppable droppableId='channels-drop' key='channelsKey'>
{(provided, snapshot) => (
<DropContainer ref={provided.innerRef} {...provided.droppableProps}>
{channels &&
channels.map(
({ channelLink, title, gameCategory, customChannelIndex, imgSrc }, index) => (
<Draggable
draggableId={'channel-' + channelLink}
index={index}
key={channelLink}
>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
css={css`
margin: 0 auto;
display: flex;
align-items: center;
justify-content: center;
`}
onClick={() => updateSelectedChannel(channelLink)}
>
<ChannelCircle
channelLink={channelLink}
title={title}
gameCategory={gameCategory}
customChannelIndex={customChannelIndex}
imgSrc={imgSrc}
/>
</div>
)}
</Draggable>
),
)}
{provided.placeholder}
</DropContainer>
)}
</Droppable>
</DragDropContext>
<ChannelParticipate
onClick={() =>
openModal(Modal, {
onClose: () => {
closeModal(Modal);
resetState();
},
children: <SelectChannelType handleModal={() => closeModal(Modal)} />,
})
}
>
<CenteredIcon kind='plus' color='white' size={24} />
</ChannelParticipate>
<ScrollContainer>
<MainCircleContainer>
<MainChannelCircle />
<Line>
<svg
width='60'
height='4'
viewBox='0 0 60 4'
fill='none'
xmlns='http://www.w3.org/2000/svg'
>
<rect width='60' height='4' rx='2' fill='white' />
</svg>
</Line>
</MainCircleContainer>
<DragDropContext onDragEnd={dragEnd}>
<Droppable droppableId='channels-drop' key='channelsKey'>
{(provided, snapshot) => (
<DropContainer ref={provided.innerRef} {...provided.droppableProps}>
{channels &&
channels.map(
({ channelLink, title, gameCategory, customChannelIndex, imgSrc }, index) => (
<Draggable
draggableId={'channel-' + channelLink}
index={index}
key={channelLink}
>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
css={css`
margin: 0 auto;
display: flex;
align-items: center;
justify-content: center;
`}
onClick={() => updateSelectedChannel(channelLink)}
>
<ChannelCircle
channelLink={channelLink}
title={title}
gameCategory={gameCategory}
customChannelIndex={customChannelIndex}
imgSrc={imgSrc}
/>
</div>
)}
</Draggable>
),
)}
{provided.placeholder}
</DropContainer>
)}
</Droppable>
</DragDropContext>
<ChannelParticipate
onClick={() =>
openModal(Modal, {
onClose: () => {
closeModal(Modal);
resetState();
},
children: <SelectChannelType handleModal={() => closeModal(Modal)} />,
})
}
>
<CenteredIcon kind='plus' color='#FF4655' size={30} />
</ChannelParticipate>
</ScrollContainer>
</ChannelbarContainer>
);
};

const ChannelbarContainer = styled.div`
width: 11.2rem;

background-color: #d9d9d9;

min-height: 100vh;
max-height: 100vh;
overflow-y: auto;

::-webkit-scrollbar {
width: 0rem;
}
`;

const ScrollContainer = styled.div`
display: flex;
align-items: center;
flex-direction: column;
`;

padding: 2rem 0;
width: 10rem;

height: 100vh;
const MainCircleContainer = styled.div``;

background-color: #141c24;
float: left;
text-align: center;
row-gap: 2rem;
overflow: auto;
const Line = styled.div`
display: flex;
justify-content: center;
margin-bottom: 12px;
`;

const ChannelParticipate = styled.button`
width: 6rem;
height: 6rem;
width: 6.2rem;
height: 6.2rem;
border: 0;
border-radius: 50%;
cursor: pointer;
position: relative;
margin: 0 auto;
background: #344051;
margin: 24px 0;
background: #ffffff;
`;

const CenteredIcon = styled(Icon)`
Expand All @@ -134,7 +163,6 @@ const DropContainer = styled.div`
flex-direction: column;
align-items: center;
justify-content: center;
row-gap: 2rem;
`;

export default ChannelBar;
Loading