Skip to content

Commit

Permalink
🚀 ver3.0.0
Browse files Browse the repository at this point in the history
변경 사항

방 생성 기능
공유 기능
배너 캐로셀
UI 개선
마이 페이지 추가
  • Loading branch information
Changyu-Ryou authored Dec 14, 2021
2 parents d711786 + 6a00223 commit 8d5ca11
Show file tree
Hide file tree
Showing 132 changed files with 4,459 additions and 812 deletions.
445 changes: 279 additions & 166 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@emotion/styled": "^11.3.0",
"@firebase/analytics": "^0.7.2",
"@karrotframe/navigator": "^0.17.3",
"@karrotmarket/mini": "^0.11.3",
"@karrotmarket/mini": "^0.12.0",
"agora-rtc-react": "^1.1.0",
"agora-rtc-sdk": "^3.6.6",
"axios": "^0.22.0",
Expand All @@ -42,11 +42,15 @@
"react-bubble-ui": "^1.1.1",
"react-cookie": "^4.1.1",
"react-dom": "^17.0.2",
"react-hook-form": "^7.21.0",
"react-icons": "^4.3.1",
"react-loading-skeleton": "^3.0.1",
"react-rewards": "^1.1.2",
"react-router-dom": "^5.3.0",
"react-slick": "^0.28.1",
"react-toast": "^1.0.3",
"recoil": "^0.4.1",
"slick-carousel": "^1.8.1",
"swiper": "^7.0.9",
"ts-node": "^10.2.1"
},
Expand All @@ -55,6 +59,7 @@
"@types/dotenv-webpack": "^7.0.3",
"@types/react": "^17.0.27",
"@types/react-dom": "^17.0.9",
"@types/react-slick": "^0.23.7",
"@types/webpack": "^5.28.0",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
Expand Down
3 changes: 2 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="shortcut icon" href="#">
<title>Document</title>
</head>
<body>
<div id="root"></div>
<div id="modal-root"></div>
<div id="spinner-root"></div>
</body>
</html>
29 changes: 18 additions & 11 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ import React, { useEffect } from 'react';
import { css } from '@emotion/css';
import { Navigator, Screen } from '@karrotframe/navigator';
import { getAnalytics, logEvent } from 'firebase/analytics';
import { ToastContainer } from 'react-toast';

import CreateMeetingForm from './components/CreateMeetingPage/CreateMeetingForm';
import CreateGuidePage from './components/FullImgPage/CreateGuidePage';
import GuidePage from './components/FullImgPage/GuidePage';
import LandingPage from './components/LandingPage';
import MeetingDetailPage from './components/MeetingDetailPage';
const AgoraPage = React.lazy(() => import('./components/MeetingPage'));
import MeetingSuggestionPage from './components/MeetingSuggestionPage';
import MyPage from './components/MyPage';
import NotFoundPage from './components/NotFountPage';
import NotServiceRegionPage from './components/NotServiceRegionPage';
import OnBoardPage from './components/OnBoardPage';
import ReservationPage from './components/ReservationPage';
import AuthWithoutMini from './hoc/AuthWithoutMini';
import useMini from './hook/useMini';
import { app } from './util/firebase';
import mini from './util/mini';
import { checkMobileType } from './util/utils';

const NavigatorStyle = css`
Expand All @@ -24,22 +27,26 @@ const NavigatorStyle = css`
export const analytics = getAnalytics(app);

const App: React.FC = () => {
const { ejectApp, loginWithoutMini } = useMini();

useEffect(() => {
logEvent(analytics, 'launch_app');
}, []);
loginWithoutMini();
}, [loginWithoutMini]);

return (
<Navigator
theme={checkMobileType()}
onClose={() => mini.close()}
onClose={ejectApp}
className={NavigatorStyle}
>
<Screen path="/" component={AuthWithoutMini(LandingPage)} />
<Screen path="/guide" component={OnBoardPage} />
<Screen
path="/meetings/:id"
component={AuthWithoutMini(MeetingDetailPage)}
/>
<ToastContainer position="bottom-center" delay={2000} />
<Screen path="/" component={LandingPage} />
<Screen path="/create-guide" component={CreateGuidePage} />
<Screen path="/guide" component={GuidePage} />
<Screen path="/me" component={MyPage} />
<Screen path="/meetings/:id" component={MeetingDetailPage} />
<Screen path="/create" component={CreateMeetingForm} />
<Screen path="/suggestion/meeting" component={MeetingSuggestionPage} />
<Screen path="/reservation" component={ReservationPage} />
<Screen path="/not-service-region" component={NotServiceRegionPage} />
Expand Down
7 changes: 7 additions & 0 deletions src/api/agora.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ export type InfoType = {
recommend_user: { text: string }[];
recommend_topic: { text: string }[];
};
host: {
id: number;
nickname: string;
profile_image_url: string;
manner_temperature: number;
region_name: string;
};
};
user: {
id: number;
Expand Down
46 changes: 46 additions & 0 deletions src/api/image.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import axios from 'axios';

import customAxios from '../util/request';

export const uploadImage = async (file: File): Promise<string | undefined> => {
const preSignedUrl = await getPreSignedUrl(file.name);
const imageUrl = await uploadToBucket(preSignedUrl, file);
return imageUrl
? `${preSignedUrl.data.url}${preSignedUrl.data.fields.key}`
: '';
};

const getPreSignedUrl = async (fileName: string) => {
const result: presignedUrlRes = await customAxios().get(
`/meetings/presigned-url?file_name=${fileName}`,
);
return result;
};

const uploadToBucket = async (preSignedUrl: presignedUrlRes, file: File) => {
try {
const formData = new FormData();
for (const [key, value] of Object.entries(preSignedUrl.data.fields)) {
formData.append(key, value);
}
formData.append('file', file);
await axios.post(preSignedUrl.data.url, formData);
return true;
} catch (e) {
return false;
}
};

type presignedUrlRes = {
data: {
url: string;
fields: {
key: string;
'x-amz-algorithm': string;
'x-amz-credential': string;
'x-amz-date': string;
policy: string;
'x-amz-signature': string;
};
};
};
71 changes: 71 additions & 0 deletions src/api/meeting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ export const getMeetings = async (region_id: string) => {
}
};

export const getMyMeetings = async () => {
try {
const result: getMeetingsRes = await customAxios().get(
`/users/me/meetings`,
);
return { success: true, data: result.data };
} catch (e) {
return { success: false };
}
};

export const getMeetingDetail = async (
id: string,
): Promise<getMeetingDetailRes> => {
Expand All @@ -35,6 +46,40 @@ export const increaseMeetingEnterUserCount = async (
}
};

export const createMeeting = async (
createData: createFormType,
): Promise<createMeetingRes> => {
try {
const res: { data: { id: number } } = await customAxios().post(
`/meetings/`,
createData,
);
return { success: true, data: res.data };
} catch (e) {
return { success: false };
}
};

export const deleteMeeting = async (id: string): Promise<deleteMeetingRes> => {
try {
await customAxios().delete(`/meetings/${id}/`);
return { success: true };
} catch (e) {
return { success: false };
}
};

export const shareMeeting = async (id: string): Promise<shareMeetingRes> => {
try {
const res: { data: { short_url: string } } = await customAxios().get(
`/share/short-url/meeting?meeting=${id}`,
);
return { success: true, data: res.data };
} catch (e) {
return { success: false };
}
};

interface getMeetingsRes {
success: boolean;
data?: MeetingList[];
Expand All @@ -48,3 +93,29 @@ interface getMeetingDetailRes {
interface increaseMeetingEnterUserCountRes {
success: boolean;
}

interface createFormType {
title: string;
date: string;
start_time: string;
end_time: string;
is_video: boolean;
image_url: string | undefined;
description: {
text: string;
};
}

interface createMeetingRes {
success: boolean;
data?: { id: number };
}

interface deleteMeetingRes {
success: boolean;
}

interface shareMeetingRes {
success: boolean;
data?: { short_url: string };
}
7 changes: 6 additions & 1 deletion src/api/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ interface loginReq {

interface loginRes {
success: boolean;
data?: { token: string; nickname: string; region: string };
data?: {
token: string;
nickname: string;
region: string;
profile_img_url: string;
};
}

interface usersRes {
Expand Down
33 changes: 0 additions & 33 deletions src/assets/icon/Notifications_none.tsx

This file was deleted.

12 changes: 12 additions & 0 deletions src/assets/icon/agora/host_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions src/assets/icon/arrow_iOS_large.svg

This file was deleted.

3 changes: 0 additions & 3 deletions src/assets/icon/arrow_iOS_small.svg

This file was deleted.

File renamed without changes
File renamed without changes
File renamed without changes
8 changes: 8 additions & 0 deletions src/assets/icon/common/nav_my_page.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
4 changes: 4 additions & 0 deletions src/assets/icon/common/person_fill__grey.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/icon/common/spinner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8d5ca11

Please sign in to comment.