Skip to content

Commit

Permalink
Merge branch 'feat/#62'
Browse files Browse the repository at this point in the history
  • Loading branch information
eomseona committed Aug 18, 2024
2 parents c8547f8 + ebb2181 commit c03ef4a
Show file tree
Hide file tree
Showing 48 changed files with 591 additions and 408 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function App() {
path="group/join/:inviteCode/profile"
element={<Joingroup3 />}
/>
<Route path="vote:id" element={<VoteMainPage />} />
<Route path="vote" element={<VoteMainPage />} />
<Route path="vote/list" element={<VoteMainPage />} />
<Route path="vote/create" element={<VoteMainPage />} />
<Route path="vote/excute" element={<VoteMainPage />} />
Expand Down
5 changes: 2 additions & 3 deletions src/apis/postAgenda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@ export async function createAgenda({
shareGroupId,
title,
photos,
}: IPostAgenda): Promise<void> {
}: IPostAgenda): Promise<number | undefined> {
try {
const response = await authInstance().post('/agendas', {
shareGroupId,
title,
photoIdList: photos,
});
if (response.status === 200) {
console.log('Agenda created successfully');
return response.data.agendaId;
} else {
throw new Error('Failed to create agenda');
}
} catch (error) {
console.error('Error creating agenda:', error);
Expand Down
2 changes: 1 addition & 1 deletion src/assets/icon/common/button/check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 5 additions & 17 deletions src/assets/icon/share_group/filled_cloud_button.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions src/components/AddGroup/AddGroupLoading/AddGrouploading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,22 @@ const AddGrouploading = () => {

if (response.data.status === 200) {
// 상태 업데이트
console.log('api응답 성공 ', response.data);
const newGroup = {
shareGroupId: response.data.data.shareGroupId,
name: response.data.data.name,
image: response.data.data.image,
memberCount: response.data.data.memberCount,
createdAt: response.data.data.createdAt,
inviteUrl: response.data.data.inviteUrl,
inviteCode: response.data.data.inviteCode,
};

setShareGroupList((prevList) => [...(prevList || []), newGroup]);

navigate('/group/add/groupshare', {
state: { inviteUrl: newGroup.inviteUrl, place },
state: {
shareGroupId: newGroup.shareGroupId,
inviteCode: newGroup.inviteCode,
name: newGroup.name,
},
});
} else {
throw new Error(response.data.message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const AddGroupMembername = () => {
const handleNextClick = () => {
// 배열이 비어 있는지 확인
if (names.length > 0) {
console.log(`이름: ${names.join(', ')}`);
navigate('/group/add/grouptype');
} else {
alert('이름을 입력해주세요');
Expand Down
12 changes: 6 additions & 6 deletions src/components/AddGroup/AddGroupMembername/Styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export const MemberNameLayout = styled.div`

export const headingLayout = styled.div`
position: relative;
margin-bottom: 80px;
margin-top: 40px;
margin-bottom: 40px;
width: 330px;
text-align: center;
justify-content: center;
Expand All @@ -22,12 +23,11 @@ export const Fly = styled(I.Fly)`
vertical-align: middle; /* 수직 정렬을 맞춤 */
width: 24px; /* 필요에 따라 크기 조정 */
height: 24px; /* 필요에 따라 크기 조정 */
margin: 10 auto;
margin-bottom: 19px;
margin-bottom: 5px;
`;

export const Text = styled.p`
font-size: 0.7rem;
font-size: 0.8rem;
color: ${({ theme }) => theme.colors.primary};
position: relative;
top: 22%;
Expand All @@ -43,8 +43,8 @@ export const ListLayout = styled.div`

export const NextArrow = styled(I.NextArrowCircle)`
position: absolute;
bottom: calc(25% - 12px - 36.5px);
right: calc(40% - 12.5px - 59px);
bottom: 20%;
right: 22%;
z-index: 15;
width: 9%; /* Adjust width as needed */
height: 20%;
Expand Down
57 changes: 20 additions & 37 deletions src/components/AddGroup/AddGroupMembername/membernameList/Styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,60 +5,41 @@ import styled from 'styled-components';
export const nameLayout = styled.div`
display: flex;
flex-direction: column;
min-height: 30px;
align-items: center;
/* 전체 스크롤바 */
::-webkit-scrollbar {
width: 12px;
}
/* 스크롤바의 트랙 */
::-webkit-scrollbar-track {
background: none;
}
/* 스크롤바 핸들 */
::-webkit-scrollbar-thumb {
background: ${({ theme }) => theme.colors.backgroundPrimary};
border-radius: 10px;
}
/* 스크롤바 핸들 호버 */
::-webkit-scrollbar-thumb:hover {
background: ${({ theme }) => theme.colors.primary};
}
padding-top: 2rem;
`;

export const nameList = styled.div`
position: relative;
display: flex;
flex-direction: row;
display: grid;
grid-template-columns: repeat(3, 1fr);
row-gap: 1rem;
padding: 2rem 0;
width: 190px;
height: 140px;
overflow-y: auto;
align-items: center;
justify-content: center;
z-index: 10;
background: none;
flex-wrap: wrap;
top: 40px;
`;

export const nameFolder = styled(I.File)`
position: absolute;
width: 200px;
width: 58%;
z-index: 0;
align-items: center;
`;

export const nameContainer = styled.div`
display: flex;
gap: 0.1rem;
justify-content: center;
align-items: center;
z-index: 30;
background: none;
margin: 1px;
width: 58px; /* 고정된 너비 */
width: 55px; /* 고정된 너비 */
height: 20px; /* 고정된 높이 */
&:hover .nameButton {
display: inline;
Expand All @@ -67,7 +48,7 @@ export const nameContainer = styled.div`

export const NowImportName = styled(I.NowInportName)`
position: absolute;
width: 61px;
width: 60%;
z-index: 0;
align-items: center;
`;
Expand All @@ -77,7 +58,8 @@ export const name = styled.p`
white-space: nowrap;
text-overflow: ellipsis;
z-index: 5;
font-size: 0.7rem;
font-size: 0.8rem;
font-weight: 700;
color: #3c73ae;
`;

Expand All @@ -104,32 +86,33 @@ export const nameCreatelayout = styled.div`

export const MemberInput = styled(I.InputName)`
position: absolute;
width: 190px;
left: 10px;
left: -0.5rem;
z-index: 10;
`;

export const inputname = styled.input`
display: inline-block;
position: relative;
padding: 0 20px 0 30px;
padding: 0 25px;
width: 100%;
height: 40px;
background: none;
z-index: 30;
align-items: center;
font-weight: 500;
color: #3c73ae;
&::placeholder {
color: ${({ theme }) => theme.colors.tertiary};
opacity: 1;
font-weight: 500;
}
`;

export const inputplus = styled(I.PlusCircle)`
position: absolute;
top: 50%;
right: 25px;
margin-top: -10px;
width: 26px;
height: 26px;
top: 5px;
right: 5px;
width: 15%;
cursor: pointer;
z-index: 30;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ const MembernameList: React.FC = () => {
const addName = (name: string) => {
const newNames = [...names, name];
setNames(newNames);
console.log(`이름: ${newNames.join(', ')}`); // 콘솔에 이름 리스트 출력
};

const removeName = (index: number) => {
const newNames = names.filter((_, i) => i !== index); /*이름 제거*/
setNames(newNames);
console.log(`이름: ${newNames.join(', ')}`); // 콘솔에 이름 리스트 출력
};

return (
Expand Down
28 changes: 13 additions & 15 deletions src/components/AddGroup/AddGroupShare/AddGroupshare.tsx
Original file line number Diff line number Diff line change
@@ -1,49 +1,47 @@
import React, { useState } from 'react';
import React from 'react';
import * as S from './Styles';
import { useRecoilValue } from 'recoil';
import { useLocation, useNavigate } from 'react-router-dom';
import { shareGroupListState } from '../../../recoil/states/share_group';

const AddGroupshare = () => {
const location = useLocation();
const navigate = useNavigate();
const shareGroupList = useRecoilValue(shareGroupListState);

const { inviteUrl, place } = location.state || { inviteUrl: '', place: '' };
const { shareGroupId, inviteCode, name } = location.state || {
inviteCode: '',
place: '',
};

const handleCopyClipBoard = async () => {
try {
await navigator.clipboard.writeText(inviteUrl);
await navigator.clipboard.writeText(inviteCode);
alert('클립보드에 링크가 복사되었어요.');
} catch (err) {
console.log(err);
}
};
const handleClick = () => {
navigate('/group');
if (shareGroupId) {
navigate(`/group/${shareGroupId}`);
}
};

return (
<S.Layout>
<S.AddFileContainer>
<S.File />
<S.AddFileText>{place}</S.AddFileText>
<S.AddFileText>{name}</S.AddFileText>
</S.AddFileContainer>
<S.CopyCloudContainer>
<S.CopyCloudContainer onClick={handleCopyClipBoard}>
<S.Cloud />
<S.CopyCloudText>링크복사</S.CopyCloudText>
<S.Copy />
<S.CloudButton onClick={handleCopyClipBoard} />
</S.CopyCloudContainer>
<S.InviteContainer>
<S.InviteBar />
<S.InviteText>링크 공유해서 친구 초대하기</S.InviteText>
<S.MoveBar onClick={handleClick} />
<S.MoveText onClick={handleClick}>공유 폴더 가기</S.MoveText>
</S.InviteContainer>
<S.InviteContainer>
<S.InviteBar2 />
<S.InviteText2>공유 폴더 가기</S.InviteText2>
</S.InviteContainer>
<S.GroupFloderButton onClick={handleClick} />
</S.Layout>
);
};
Expand Down
Loading

0 comments on commit c03ef4a

Please sign in to comment.