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: GNB3 공지, 회비 페이지 레이아웃 구현 #35

Merged
merged 5 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
12 changes: 6 additions & 6 deletions src/components/MainLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ import React from 'react';
import MainNavigationBar from './MainNavigationBar';
import styled from 'styled-components';

const Content = styled.div`
flex: 1;
overflow: auto;
`;

const LayoutContainer = styled.div`
display: flex;
flex-direction: column;
Expand All @@ -15,6 +10,11 @@ const LayoutContainer = styled.div`
background-color: white;
`;

const Content = styled.div`
flex: 1;
overflow: auto;
`;

const MainLayout = ({ children, showMainNav }) => {
return (
<LayoutContainer>
Expand All @@ -26,4 +26,4 @@ const MainLayout = ({ children, showMainNav }) => {
);
};

export default MainLayout;
export default MainLayout;
6 changes: 2 additions & 4 deletions src/pages/group/BasicInfo.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import React from 'react';

function BasicInfo() {
const BasicInfo = () => {
return (
<div>
<h1>기본 정보</h1>
<h1>기본정보</h1>
</div>
);
}
Expand Down
4 changes: 1 addition & 3 deletions src/pages/group/Fee.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import React from 'react';

function Fee() {
const Fee = () => {
return (
<div>
<h1>회비</h1>
Expand Down
33 changes: 18 additions & 15 deletions src/pages/group/Group.jsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
import styled from 'styled-components';
import { Outlet } from 'react-router-dom';
import GroupHeader from '../../components/group/GroupHeader';
import GroupTabBar from '../../components/group/GroupTabBar';

const GroupContainer = styled.div`
padding-top: 92px; // 헤더와 탭바의 높이를 고려한 여백
`;
import GroupHeader from './group_components/GroupHeader';
import GroupTabBar from './group_components/GroupTabBar';

const FixedContainer = styled.div`
position: fixed;
position: sticky;
top: 0;
width: 100%; // 너비를 100%로 설정
max-width: 649px; // 최대 너비 제한
// box-sizing: border-box;
// overflow: hidden; // 넘치는 내용 숨김
left: 0;
width: 100%;
background-color: white;
z-index: 1000;
`;

const ContentContainer = styled.div`
padding: 0 20px;
overflow: hidden;
display: flex;
flex-direction: column;
`;

function GroupLayout() {
const Group = () => {
return (
<>
<FixedContainer>
<GroupHeader />
<GroupTabBar />
</FixedContainer>
<GroupContainer>
<ContentContainer>
<Outlet />
</GroupContainer>
</ContentContainer>
</>
);
}

export default GroupLayout;
export default Group;
106 changes: 43 additions & 63 deletions src/pages/group/Notice.jsx
Original file line number Diff line number Diff line change
@@ -1,69 +1,49 @@
import React from 'react';
import styled from 'styled-components';
import NoticeItem from './group_components/NoticeItem';

function Notice() {
return (
<div>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
<h1>공지</h1>
const Container = styled.div`
background-color: white;
width: 100%;
margin: 0 auto;
position: relative;
`;

// TODO: 플로팅버튼 위치 조정해줘야 함
const FloatingButton = styled.button`
position: fixed;
bottom: 84px;
right: 20px;
width: 70px;
height: 70px;
border-radius: 50%;
background-color: white;
color: black;
font-size: 32px;
border: none;
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
z-index: 1000;
`;

</div>
const Notice = () => {
return (
<Container>
<NoticeItem title="6월 정기 모임 관련 공지1" date="2024.05.30" isNew={true} /> {/* TODO: API 연결 필요 */}
<NoticeItem title="6월 정기 모임 관련 공지2" date="2024.05.30" isNew={true} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이런거 요소가 많거나 길어지면

const noticeItemProps = {
  title: "6월 정기 모임 관련 공지",
  date: "2024.05.30",
  isNew: true
};

<NoticeItem {...noticeItemProps} />

이런식으로 모아서 주는 방법도 있어

<NoticeItem title="6월 정기 모임 관련 공지3" date="2024.05.30" isNew={false} />
<NoticeItem title="6월 정기 모임 관련 공지" date="2024.05.30" isNew={false} />
<NoticeItem title="6월 정기 모임 관련 공지" date="2024.05.30" isNew={false} />
<NoticeItem title="6월 정기 모임 관련 공지" date="2024.05.30" isNew={false} />
<NoticeItem title="6월 정기 모임 관련 공지" date="2024.05.30" isNew={false} />
<NoticeItem title="6월 정기 모임 관련 공지" date="2024.05.30" isNew={false} />
<NoticeItem title="6월 정기 모임 관련 공지" date="2024.05.30" isNew={false} />
<NoticeItem title="6월 정기 모임 관련 공지" date="2024.05.30" isNew={false} />
<NoticeItem title="6월 정기 모임 관련 공지" date="2024.05.30" isNew={false} />
<FloatingButton>+</FloatingButton>
</Container>
);
}

Expand Down
4 changes: 1 addition & 3 deletions src/pages/group/Schedule.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import React from 'react';

function Schedule() {
const Schedule = () => {
return (
<div>
<h1>일정</h1>
Expand Down
47 changes: 47 additions & 0 deletions src/pages/group/group_components/NoticeItem.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import styled from 'styled-components';

const Container = styled.div`
border-bottom: 1px solid rgba(221, 221, 221, 0.5); /* 50% 투명도 */
padding: 16px 0;
`;

const NoticeTitle = styled.div`
font-size: 16px;
font-weight: bold;
color: ${({ theme }) => theme.colors.neutral[700]};
display: flex;
align-items: center;
`;

const NoticeDate = styled.div`
font-size: 12px;
margin-top: 10px;
color: ${({ theme }) => theme.colors.neutral[400]};
`;

const NewTag = styled.div`
background-color: ${({ theme }) => theme.colors.main[500]};
color: #fff;
width: 12px;
height: 12px;
padding: 2px 2px;
font-size: 10px;
margin-left: 8px;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
`;

const NoticeItem = ({ title, date, isNew }) => {
return (
<Container>
<NoticeTitle>
{title} {isNew && <NewTag>N</NewTag>}
</NoticeTitle>
<NoticeDate>{date}</NoticeDate>
</Container>
);
}

export default NoticeItem;