Skip to content

Commit

Permalink
feat: conflict 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
urimeee committed Feb 7, 2025
2 parents b11c0b4 + b3b4c50 commit 5db1348
Show file tree
Hide file tree
Showing 30 changed files with 258 additions and 131 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

# misc
.DS_Store

.env
.env.local
.env.development.local
.env.test.local
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ cp -R ./output ./sohawgi_Front/
cd sohawgi_Front || exit 1

npm install
CI=false npm run build
CI=false npm run build
32 changes: 32 additions & 0 deletions 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/styled-components": "^5.1.34",
"axios": "^1.7.9",
"react": "^18.3.1",
"react-device-detect": "^2.2.3",
"react-dom": "^18.3.1",
Expand Down
Binary file added public/fonts/PretendardVariable.woff2
Binary file not shown.
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" charset="utf-8" />
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

Expand All @@ -15,7 +15,7 @@
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="/manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand Down
3 changes: 3 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ const ContentWrapper = styled.div`
word-break: break-all;
white-space: normal;
min-width: 340px;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
`;

function App() {
Expand Down
Binary file removed src/assets/fonts/Pretendard-Black.ttf
Binary file not shown.
Binary file removed src/assets/fonts/Pretendard-Bold.ttf
Binary file not shown.
Binary file removed src/assets/fonts/Pretendard-ExtraBold.ttf
Binary file not shown.
Binary file removed src/assets/fonts/Pretendard-ExtraLight.ttf
Binary file not shown.
Binary file removed src/assets/fonts/Pretendard-Light.ttf
Binary file not shown.
Binary file removed src/assets/fonts/Pretendard-Medium.ttf
Binary file not shown.
Binary file removed src/assets/fonts/Pretendard-Regular.ttf
Binary file not shown.
Binary file removed src/assets/fonts/Pretendard-SemiBold.ttf
Binary file not shown.
Binary file removed src/assets/fonts/Pretendard-Thin.ttf
Binary file not shown.
34 changes: 31 additions & 3 deletions src/components/AddPageContainer/AddPageContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,38 @@ type Props = {

const AddPageContainer = ({ title, contentTitles }: Props) => {
const onClickHandler = (contentTitle: string) => {
if (EXTERNAL_LINKS[contentTitle]) {
window.open(EXTERNAL_LINKS[contentTitle], 'popup');
if (title === '정보') {
if (EXTERNAL_LINKS[contentTitle]) {
window.open(EXTERNAL_LINKS[contentTitle], 'popup');
} else {
console.log('접근 가능한 링크가 없습니다.');
}
} else {
console.log('접근 가능한 링크가 없습니다.');
// title === '설정'
if (contentTitle === '로그아웃') {
if (
window.webkit &&
window.webkit.messageHandlers &&
window.webkit.messageHandlers.logoutHandler
) {
window.webkit.messageHandlers.logoutHandler.postMessage('logout');
} else {
console.error('Logout handler not found');
}
}
if (contentTitle === '회원탈퇴') {
if (
window.webkit &&
window.webkit.messageHandlers &&
window.webkit.messageHandlers.deleteAccountHandler
) {
window.webkit.messageHandlers.deleteAccountHandler.postMessage(
'deleteAccount',
);
} else {
console.error('DeleteAccount handler not found');
}
}
}
};

Expand Down
6 changes: 3 additions & 3 deletions src/components/BottomNavi/BottomNavi.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export const StyledLink = styled(Link)`
`;

export const BottomNavWrapper = styled.div`
position: fixed; /* 하단에 고정 */
bottom: 0;
position: fixed;
bottom: env(safe-area-inset-bottom);
left: 0;
right: 0;
display: flex;
Expand Down Expand Up @@ -58,5 +58,5 @@ export const MoreText = styled.span<{ $isActive: boolean }>`
font-size: ${({ theme }) => theme.fonts.Body_05};
color: ${({ $isActive, theme }) =>
$isActive ? theme.colors.Grey_06 : theme.colors.Grey_02};
text-decoration: none; /* 밑줄 제거 */
text-decoration: none;
`;
19 changes: 11 additions & 8 deletions src/components/ScheduleCard/ScheduleCard.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@
import styled from 'styled-components';

export const WrapperContainer = styled.div`
display: grid;
gap: 1.5rem; /* '일정' 텍스트와 그리드 사이 간격 */
width: 100%; /* 부모 요소에 맞게 너비를 조정 */
background-color: ${({ theme }) => theme.colors.White}; /* 배경 색상 추가 */
padding: 1.88rem 1.69rem; /* 내부 여백 추가 */
border-radius: 1.7rem; /* 모서리를 둥글게 */
box-sizing: border-box; /* 패딩을 너비에 포함하여 크기 조정 */ 텍스트 필드와 너비 같이 될 수 있도록
display: grid;
gap: 1.5rem; /* '일정' 텍스트와 그리드 사이 간격 */
width: 100%; /* 부모 요소에 맞게 너비를 조정 */
background-color: ${({ theme }) => theme.colors.White}; /* 배경 색상 추가 */
padding: 1.88rem 1.69rem; /* 내부 여백 추가 */
border-radius: 1.7rem; /* 모서리를 둥글게 */
box-sizing: border-box; /* 패딩을 너비에 포함하여 크기 조정 */
height: fit-content;
텍스트 필드와 너비 같이 될 수 있도록
`;

export const Title = styled.div`
font-family: ${({ theme }) => theme.fonts.Body_01}; /* 테마에 정의된 폰트 스타일 사용 */
font-family: ${({ theme }) =>
theme.fonts.Body_01}; /* 테마에 정의된 폰트 스타일 사용 */
color: ${({ theme }) => theme.colors.Grey_06}; /* 테마에 정의된 색상 사용 */
`;

Expand Down
33 changes: 12 additions & 21 deletions src/components/ScheduleCard/ScheduleCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useState, useEffect } from 'react';
import ScheduleDetail from '../ScheduleDetail/ScheduleDetail'; // ScheduleDetail 컴포넌트 경로에 맞게 수정
import BottomSheet from '../BottomSheet/BottomSheet'; // BottomSheet 컴포넌트 불러오기
import * as S from './ScheduleCard.style';
import { api } from '../../utils/axios';

interface Schedule {
scheduleId: number;
Expand All @@ -13,48 +14,39 @@ interface Schedule {

const ScheduleCard = () => {
const [isSheetOpen, setSheetOpen] = useState<boolean>(false);
const [scheduleList, setScheduleList] = useState<Schedule[]>([]);
const [scheduleList, setScheduleList] = useState<Schedule[] | null>([]);

const handleSheet = () => {
setSheetOpen(!isSheetOpen);
};

const getSchedules = async () => {
try {
const response = await fetch(
'http://15.165.191.48:8080/api/v1/schedules',
{
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Nickname': 'jini',
},
credentials: 'include',
},
);
const accessToken = localStorage.getItem('accessToken');
const refreshToken = localStorage.getItem('refreshToken');
const response = await api.get('/schedules');

if (!response.ok) {
if (response.data.length < 0) {
throw new Error(response.statusText);
}

const data = await response.json();
console.log(response);
// setScheduleList(data);
// const data = await response.json();
console.log(response.data);
setScheduleList(response.data);
} catch (e) {
console.log(e);
}
};

useEffect(() => {
// getSchedules();
getSchedules();
}, []);

return (
<S.WrapperContainer>
<S.Title>일정</S.Title> {/* Title 컴포넌트를 사용하여 스타일 적용 */}
<S.Title>일정</S.Title>
<S.GridContainer>
{/* 여러 개의 ScheduleDetail 컴포넌트를 그리드로 나열 */}
{scheduleList.map((schedule) => (
{scheduleList?.map((schedule) => (
<div key={schedule.scheduleId}>
<ScheduleDetail
title={schedule.title}
Expand All @@ -65,7 +57,6 @@ const ScheduleCard = () => {
</div>
))}
</S.GridContainer>
{/* 바텀시트 컴포넌트 */}
<BottomSheet isOpen={isSheetOpen} onClose={handleSheet} />
</S.WrapperContainer>
);
Expand Down
8 changes: 5 additions & 3 deletions src/components/TextField/TextField.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useState } from 'react';

import * as S from './TextField.style';

const TextField: React.FC = () => {
Expand All @@ -8,12 +9,13 @@ const TextField: React.FC = () => {
const postSchedule = async (e: React.MouseEvent<HTMLButtonElement>) => {
try {
const response = await fetch(
'http://15.165.191.48:8080/api/v1/schedules',
`${process.env.REACT_APP_BASE_SERVER_URL}/schedules`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Nickname': 'jini',
'X-ACCESS-TOKEN': `${process.env.REACT_APP_X_ACCESS_TOKEN}`,
'X-REFRESH-TOKEN': `${process.env.REACT_APP_X_REFRESH_TOKEN}`,
},
credentials: 'include',
body: JSON.stringify({ text: schedule }),
Expand All @@ -38,7 +40,7 @@ const TextField: React.FC = () => {
onBlur={() => setIsFocused(false)}
onChange={(e) => setSchedule(e.target.value)}
/>
<S.Button type="submit" onClick={postSchedule}>
<S.Button type="button" onClick={postSchedule}>
등록
</S.Button>
</S.Form>
Expand Down
13 changes: 9 additions & 4 deletions src/components/UserProfile/UserInfo/UserInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import React from 'react';
import appleIcon from '../../../assets/images/appleIcon.png';
import * as S from './UserInfo.style';
import React from 'react';

const UserInfo = () => {
type Props = {
name: string;
email: string;
};

const UserInfo = ({ name, email }: Props) => {
return (
<div>
<div>구나연</div>
<div>{name}</div>
<S.InfoContainer>
<S.appleImg src={appleIcon} alt={'appleIcon'} />
<div>[email protected]</div>
<div>{email}</div>
</S.InfoContainer>
</div>
);
Expand Down
12 changes: 9 additions & 3 deletions src/components/UserProfile/UserProfile.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import hamtori from '../../assets/images/hamtori.svg';
import React from 'react';

import hamtori from '../../assets/images/hamtori.svg';
import UserInfo from './UserInfo/UserInfo';
import * as S from './UserProfile.style';

const UserProfile = () => {
type Props = {
name: string;
email: string;
};

const UserProfile = ({ name, email }: Props) => {
return (
<S.Container>
<img src={hamtori} alt={'hamtori'} />
<UserInfo />
<UserInfo name={name} email={email} />
</S.Container>
);
};
Expand Down
6 changes: 6 additions & 0 deletions src/custom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ interface Window {
webViewReady?: {
postMessage: (message: any) => void;
};
logoutHandler?: {
postMessage: (message: any) => void;
};
deleteAccountHandler?: {
postMessage: (message: any) => void;
};
};
};
}
9 changes: 7 additions & 2 deletions src/pages/PlusPage/PlusPage.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ export const AddPageContainer = styled.div`
background-color: #fff;
width: 100%;
height: 100%;
padding-left: 17px;
padding-right: 17px;
`;

export const AddPageBelowContainer = styled.div`
display: flex;
flex-direction: column;
gap: 2.3125rem;
`;

export const AddPageContentContainer = styled.div`
display: flex;
flex-direction: column;
padding-left: 17px;
padding-right: 17px;
`;
Loading

0 comments on commit 5db1348

Please sign in to comment.