Skip to content

Commit 09d4a79

Browse files
author
jyn
committed
Merge branch 'dev'
2 parents 21586e2 + 5562a4b commit 09d4a79

File tree

36 files changed

+888
-405
lines changed

36 files changed

+888
-405
lines changed

.github/workflows/deploy.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
container: pandoc/latex
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Install mustache (to update the date)
17+
18+
run: apk add ruby && gem install mustache
19+
20+
- name: creates output
21+
22+
run: sh ./build.sh
23+
24+
- name: Pushes to another repository
25+
26+
id: push_directory
27+
28+
uses: cpina/github-action-push-to-another-repository@main
29+
30+
env:
31+
API_TOKEN_GITHUB: ${{ secrets.AUTO_ACTIONS }}
32+
33+
with:
34+
source-directory: 'output'
35+
36+
destination-github-username: TopiaYu
37+
38+
destination-repository-name: nomadia
39+
40+
user-email: ${{ secrets.EMAIL }}
41+
42+
commit-message: ${{ github.event.commits[0].message }}
43+
44+
target-branch: main
45+
46+
- name: Test get variable exported by push-to-another-repository
47+
48+
run: echo $DESTINATION_CLONED_DIRECTORY

build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
cd ../
4+
5+
mkdir output
6+
7+
cp -R ./nomadia/* ./output
8+
9+
cp -R ./output ./nomadia/

next.config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ import type { NextConfig } from 'next';
22

33
const nextConfig: NextConfig = {
44
images: {
5-
domains: ['sprint-fe-project.s3.ap-northeast-2.amazonaws.com'],
5+
remotePatterns: [
6+
{
7+
protocol: 'https',
8+
hostname: 'sprint-fe-project.s3.ap-northeast-2.amazonaws.com',
9+
port: '',
10+
pathname: '/**',
11+
},
12+
],
613
},
714
};
815

public/images/sad-laptop.svg

Lines changed: 13 additions & 0 deletions
Loading

src/app/(auth)/login/page.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { LoginForm } from '@/features/auth/login/components/LoginForm';
55

66
const Login = () => {
77
return (
8-
<div className="mx-6 mt-9 mb-10 flex w-full max-w-[343px] flex-col items-center md:max-w-[460px]">
8+
<div className="mx-6 mt-[3.6rem] mb-10 flex w-full max-w-[34.3rem] flex-col items-center md:mt-[10rem] md:max-w-[46rem]">
99
<Image
1010
src="/images/icons/logo-desktop.png"
1111
alt="Signup logo image"
@@ -16,15 +16,17 @@ const Login = () => {
1616

1717
<LoginForm />
1818

19-
<p className="txt-16-medium mt-4 mb-12 text-gray-400">
20-
아직 계정이 없으신가요?{' '}
21-
<Link
22-
href="/signup"
23-
className="text-main txt-16-medium cursor-pointer underline"
24-
>
25-
가입하기
26-
</Link>
27-
</p>
19+
<div className="flex w-full justify-center gap-20">
20+
<p className="mt-4 mb-12 text-[1.4rem] text-gray-950 md:text-[1.6rem]">
21+
아직 계정이 없으신가요?{' '}
22+
<Link
23+
href="/signup"
24+
className="text-main cursor-pointer text-[1.4rem] underline md:text-[1.6rem]"
25+
>
26+
가입하기
27+
</Link>
28+
</p>
29+
</div>
2830

2931
<div className="my-6 flex w-full items-center">
3032
<hr className="border-main flex-1" />

src/app/(auth)/signup/page.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { SignupForm } from '@/features/auth/signup/components/SignupForm';
55

66
const Signup = () => {
77
return (
8-
<div className="mx-6 mt-9 mb-10 flex w-full max-w-[343px] flex-col items-center md:mt-[100px] md:max-w-[460px]">
8+
<div className="mx-6 mt-[3.6rem] mb-10 flex w-full max-w-[34.3rem] flex-col items-center md:mt-[10rem] md:max-w-[46rem]">
99
<Image
1010
src="/images/icons/logo-desktop.png"
1111
alt="Signup logo image"
@@ -16,9 +16,12 @@ const Signup = () => {
1616

1717
<SignupForm />
1818

19-
<p className="txt-16-medium my-6 text-gray-400">
20-
이미 회원이신가요?{' '}
21-
<Link href="/login" className="cursor-pointer text-gray-600 underline">
19+
<p className="my-[4rem] text-[1.4rem] text-gray-950 md:text-[1.6rem]">
20+
회원이신가요?{' '}
21+
<Link
22+
href="/login"
23+
className="text-main cursor-pointer text-[1.4rem] underline md:text-[1.6rem]"
24+
>
2225
로그인하기
2326
</Link>
2427
</p>

src/app/(test)/test-error/page.tsx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// // 🖥️ 클라이언트 컴포넌트에서의 에러 처리
2+
// 'use client';
3+
4+
// import { isAxiosError } from 'axios';
5+
6+
// import { useErrorQuery } from '@/features/(test)/useErrorQuery';
7+
8+
// export default function Page() {
9+
// const { data, error, isError } = useErrorQuery(); //-> 401 에러
10+
11+
// if (isError && error && isAxiosError(error)) {
12+
// const status = error?.response?.status;
13+
// throw new Error(String(status));
14+
// }
15+
// return <></>;
16+
// }
17+
18+
// 💿 서버 컴포넌트에서의 에러 처리
19+
import { isAxiosError } from 'axios';
20+
21+
import { testInstance } from '@/features/(test)/testInstance';
22+
23+
const fetchData = async () => {
24+
try {
25+
const res = await testInstance.post('activities/7/reservations'); //401 에러
26+
// const res = await testInstance.get('https://api.example.com/data'); // 500 & undefined 에러
27+
return res.data;
28+
} catch (error) {
29+
if (isAxiosError(error)) {
30+
const status = error.response?.status;
31+
throw new Error(String(status));
32+
}
33+
// 비-Axios 에러의 경우 일반적인 에러로 재발생
34+
throw new Error('500');
35+
}
36+
};
37+
38+
export default async function Page() {
39+
const data = await fetchData();
40+
41+
return <div>{data.title}</div>;
42+
}

src/app/(test)/test-scroll/getApi.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/app/(test)/test-scroll/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
//테스트 파일입니다. test-scroll
12
'use client';
23

34
import { useRef } from 'react';
45

5-
import { getApi } from '@/app/(test)/test-scroll/getApi';
6+
import { getTestApi } from '@/features/(test)/getTestApi';
67
import { useItemInfiniteQuery } from '@/shared/libs/hooks/infiniteScroll/useInfiniteQuery';
78
import { useInfiniteScroll } from '@/shared/libs/hooks/infiniteScroll/useInfiniteScroll';
89

@@ -17,7 +18,7 @@ export default function Page() {
1718
const { data, fetchNextPage, hasNextPage, isLoading, isError } =
1819
useItemInfiniteQuery({
1920
keyName: 'activities',
20-
getFn: getApi,
21+
getFn: getTestApi,
2122
params: {
2223
sort: 'most_reviewed' as const,
2324
size: 5,

src/app/activities/page.tsx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
1+
'use client';
2+
3+
import { useSearchParams } from 'next/navigation';
4+
15
import AllActivities from '@/features/activities/components/all-activities';
26
import BannerCarousel from '@/features/activities/components/banner-carousel';
37
import BestActivities from '@/features/activities/components/best-activities';
8+
import Search from '@/features/activities/components/search';
9+
import SearchResults from '@/features/activities/components/search-result';
410

511
const ActivitiesPage = () => {
12+
const searchParams = useSearchParams();
13+
const keyword = searchParams.get('search')?.trim() || '';
14+
const isSearching = keyword.trim().length > 0;
15+
616
return (
717
<main className="bg-background flex w-full flex-col gap-10">
818
<div className="mx-auto w-full max-w-[120rem]">
919
<BannerCarousel />
10-
{/* <Search /> */}
11-
<BestActivities />
12-
<AllActivities />
20+
<Search />
21+
22+
{isSearching ? (
23+
<SearchResults keyword={keyword} />
24+
) : (
25+
<>
26+
<BestActivities />
27+
<AllActivities />
28+
</>
29+
)}
1330
</div>
1431
</main>
1532
);

0 commit comments

Comments
 (0)