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

Assignment 3 - Release 1.0.0 #32

Merged
merged 118 commits into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
4790e65
💄 스타일 작업 준비
od-log Nov 1, 2022
cd82b35
:bento: Car Data Type Definition
jong6598 Nov 1, 2022
53e667f
:bento: Car GET 응답데이터 타입 정의
jong6598 Nov 1, 2022
f2dae79
✨ Base Client Requester Instance 생성 & getCars 함수 정의
jong6598 Nov 1, 2022
ba8d8bb
🍱 API 관련 상수 정의
jong6598 Nov 1, 2022
85fb3d6
📚 README 작성
jong6598 Nov 1, 2022
0462eea
Merge branch 'develop' of https://github.com/wanted-pre-onboarding-fr…
od-log Nov 2, 2022
8dbb3f8
💄 CarList/layout/DetailForm 스타일 적용
od-log Nov 2, 2022
06ddb61
✨ 공통버튼 컴포넌트 추가
od-log Nov 2, 2022
e56aa62
:memo: 클래스 이름 변경
od-log Nov 2, 2022
37ae072
💄 VehicleDetail, Image UI 작업
forest-6 Nov 2, 2022
a5f927f
Merge remote-tracking branch 'refs/remotes/origin/feature/style' into…
forest-6 Nov 2, 2022
be1d61a
:art: 이미지 변수, 이미지 크기변경 변수 Image 컴포넌트 -> CarDetail 컴포넌트 이동
forest-6 Nov 2, 2022
34baa31
➕ react-icons 라이브러리 추가
hopak-e Nov 2, 2022
5baefaf
💄 Nav 컴포넌트 UI 구현
hopak-e Nov 2, 2022
bd91228
💄 VehicleItem 컴포넌트 UI 구현
hopak-e Nov 2, 2022
ad24b34
💄 Header 컴포넌트 UI 구현
hopak-e Nov 2, 2022
afbecd1
🔥 container padding 제거
hopak-e Nov 2, 2022
bf3cc2a
💄 layout 컴포넌트에 Header 추가
hopak-e Nov 2, 2022
6288ecf
💄 CarList 컴포넌트에 Nav, VehicleItem 컴포넌트 추가
hopak-e Nov 2, 2022
69c58fc
Merge branch 'feature/style' of github.com:wanted-pre-onboarding-fron…
hopak-e Nov 2, 2022
fcc5ac8
🎨 컴포넌트 선언 방식 arrow function으로 변경
hopak-e Nov 2, 2022
bef2acb
➖ react-icons 제거
hopak-e Nov 2, 2022
62e68ed
💄 화살표 styled-components로 직접 구현
hopak-e Nov 2, 2022
ae57d68
🍱 뒤로가기 버튼 이미지 추가
hopak-e Nov 2, 2022
9573864
💄 뒤로가기 버튼 CSS에서 이미지 파일로 변경
hopak-e Nov 2, 2022
8744870
:art: 이미지 컴포넌트 width, height 값 수정
forest-6 Nov 2, 2022
621de7b
🔥 img border 제거
hopak-e Nov 2, 2022
8817305
Merge pull request #4 from wanted-pre-onboarding-frontend-12team/feat…
youngminss Nov 2, 2022
06602ff
:heavy_plus_sign: recoil 전역 상태관리 의존성 패키지 설치
youngminss Nov 2, 2022
4d6c900
:bento: ESLint eqeqeq, no-console, un-used-var Rule 추가
youngminss Nov 2, 2022
960cd2b
:bento: TypeScript, Vite 절대경로 import 설정
youngminss Nov 2, 2022
70726da
:memo: un-used-variable 제거, 불필요한 Button 컴포넌트 제거, components index def…
youngminss Nov 2, 2022
aa1a699
🍱 attribute 더미데이터 추가
hopak-e Nov 2, 2022
f0bb0de
Merge branch 'feature/style' of https://github.com/wanted-pre-onboard…
od-log Nov 2, 2022
8d4add5
:heavy_plus_sign: CSR 환경에서 SEO 최적화 진행을 위한 React-Helmet-Async 의존성 패키지 추가
youngminss Nov 2, 2022
c3b4308
Merge pull request #6 from wanted-pre-onboarding-frontend-12team/feat…
youngminss Nov 2, 2022
34328f2
Merge branch 'develop' of https://github.com/wanted-pre-onboarding-fr…
od-log Nov 2, 2022
fb76cfd
💄 에러 UI 구현 및 경로 추가
forest-6 Nov 2, 2022
4eba3ec
✨ Nav 컴포넌트 추가
od-log Nov 2, 2022
da8beb2
:memo: 더미데이터 수정
od-log Nov 2, 2022
132f4b7
:memo: Chip컴포넌트 prop.name 실수 수정/ 더미데이터 타입 실수 수정
od-log Nov 2, 2022
fc02ad6
:ambulance: 전체 Chip 중복 수정
od-log Nov 2, 2022
0b0740d
:memo: 더미데이터 type 대문자 소문자로 수정
od-log Nov 2, 2022
ba9b6f9
:fire: 에러 바운더리 내부 콘솔 제거
forest-6 Nov 2, 2022
281940f
💄 신규 태그 스타일 추가
od-log Nov 2, 2022
b8b4bd0
✨ react helmet 오픈그래프 메타태그 추가
od-log Nov 2, 2022
9c4415c
:memo: api 명세에 따른 type name 수정
jong6598 Nov 2, 2022
a57caaa
:sparkles: 디테일페이지 데이터 관리를 위한 쿼리훅 구현
jong6598 Nov 2, 2022
f74cf8d
:art: 디테일 페이지 내 상세정보 구현 후 분리
jong6598 Nov 2, 2022
3b6f322
:lipstick: 디테일페이지 내 상세정보 분리에 따른 css 분리
jong6598 Nov 2, 2022
4a285f2
🎨 recoil root 추가
hopak-e Nov 2, 2022
9092e03
🎨 props 타입 추가 및 더미데이터 관련 props 추가
hopak-e Nov 2, 2022
f5e2f61
🔥 swiper 마진 제거
hopak-e Nov 2, 2022
35950b7
Merge pull request #9 from wanted-pre-onboarding-frontend-12team/feat…
jong6598 Nov 2, 2022
944941d
🎨 props 추가에 따른 타입 추가
hopak-e Nov 2, 2022
e47065e
📝 타입 별 더미데이터 구분
hopak-e Nov 2, 2022
62a2bff
✨ segment, fueltype 관련 recoilstate 추가
hopak-e Nov 2, 2022
db0981a
🎨 Nav 컴포넌트 2개 붙이고 props 추가
hopak-e Nov 2, 2022
54d459d
💄 스크롤바 없애기 위한 height 값 조정 및 margin 설정
hopak-e Nov 2, 2022
bbba94d
Merge pull request #12 from wanted-pre-onboarding-frontend-12team/fea…
jong6598 Nov 3, 2022
88119e7
Merge branch 'develop' into feature/recoil
jong6598 Nov 3, 2022
ce391a6
Merge pull request #13 from wanted-pre-onboarding-frontend-12team/fea…
jong6598 Nov 3, 2022
b6ca406
:lipstick: VehicleItem -> CarListItem 으로 컴포넌트명 변경 & UI 수정 및 props 데이터…
youngminss Nov 3, 2022
c510e45
:bento: Fuel(연료), Segment(차량 크기) 서버 데이터에 따른 실제 렌더링 데이터 매핑 테이블 생성 & 차량…
youngminss Nov 3, 2022
19a5069
:sparkles: 차량 목록 페이지 실제 서버 데이터 API 연결
youngminss Nov 3, 2022
75070fe
:bento: 도메인 관점 Type 정의, 각 데이터 타입에 대한 Utilization 함수 모듈 정의, global ul,…
youngminss Nov 3, 2022
058d0c1
Merge branch 'develop' of https://github.com/wanted-pre-onboarding-fr…
od-log Nov 3, 2022
cae8eb5
Merge branch 'develop' into feature/car-list
youngminss Nov 3, 2022
d1648c1
Merge pull request #16 from wanted-pre-onboarding-frontend-12team/fea…
jong6598 Nov 3, 2022
2ea09cc
:ambulance: 충돌 수정
od-log Nov 3, 2022
765f9b3
:ambulance: root index.tsx queryClient 코드 중복 수정
od-log Nov 3, 2022
86e2deb
✨ 상세페이지 react-helmet 메타태그 추가/ HelmetProvider 추가/ 메타태그 파일 타이틀 수정
od-log Nov 3, 2022
017556d
:art: insurance, addtinalProducts 데이터 렌더링을 위해 map 구현
jong6598 Nov 3, 2022
d8a2a66
:memo: FIXME 삭제 & 중복되거나 누락된 코드 수정
jong6598 Nov 3, 2022
8707d01
:lipstick: 상세페이지 높이 css 수정
jong6598 Nov 3, 2022
caa0872
:memo:메타태그 이미지파일 추가/description 수정
od-log Nov 3, 2022
b825c3a
:sparkles: 이용가능일 형태변경을 위한 getDay 메소드 추가
jong6598 Nov 3, 2022
d63703d
:lipstick: 헤더 높이 변경에 따른 차량목록 상세페이지 css 수정
jong6598 Nov 3, 2022
a0d6b4e
:memo: 월 이용료 렌더링 형식 변화
jong6598 Nov 3, 2022
9c23cf9
:ambulance: 서버데이터를 받아오기 위한 타입 이름 변경
jong6598 Nov 3, 2022
aa865ae
Merge pull request #17 from wanted-pre-onboarding-frontend-12team/rea…
od-log Nov 3, 2022
1758129
:memo: map 사용 데이터 직관성을 위한 코드 수정
jong6598 Nov 3, 2022
1bc5d65
Merge branch 'develop' into feature/cardetail
jong6598 Nov 3, 2022
2d28c07
Merge pull request #18 from wanted-pre-onboarding-frontend-12team/fea…
jong6598 Nov 3, 2022
02624b6
Merge branch 'develop' of https://github.com/wanted-pre-onboarding-fr…
od-log Nov 3, 2022
1c6e95f
:lipstick: 헤더 높이 수정 및 디테일페이지 컨텐츠 내 스크롤 속성 부여
jong6598 Nov 3, 2022
8423a3f
:memo: merge 과정에서 누락된 queryClient 코드 추가
jong6598 Nov 3, 2022
c65f47b
:memo: 디테일 페이지 랜더링을 위한 조건식 위치 조정
jong6598 Nov 3, 2022
56ca594
Merge pull request #19 from wanted-pre-onboarding-frontend-12team/fea…
jong6598 Nov 3, 2022
c29b490
Merge branch 'develop' of https://github.com/wanted-pre-onboarding-fr…
od-log Nov 3, 2022
6ca646c
:memo: 메타태그 타이틀 띄어쓰기
od-log Nov 3, 2022
eb56715
:lipstick: 슬라이더 스타일 수정
od-log Nov 3, 2022
e0a65a5
📝 og:description meta 데이터 defualt value 수정
youngminss Nov 3, 2022
1ca675c
Merge pull request #20 from wanted-pre-onboarding-frontend-12team/rea…
od-log Nov 3, 2022
f0a62aa
Merge pull request #21 from wanted-pre-onboarding-frontend-12team/fea…
od-log Nov 3, 2022
cc4316f
:lipstick: 앱 Global 최대 너비 적용
youngminss Nov 3, 2022
6d093fb
:sparkles: 데이터 로딩, 빈 데이터 시 보여줄 StatusContent 컴포넌트 분리
youngminss Nov 3, 2022
4ff289c
:lipstick: 차량 목록 페이지 - 헤더, 필터 영역 제외한 차량 아이템 컨테이너 영역만 스크롤 컨테이너로 적용(모바일…
youngminss Nov 3, 2022
3a63e59
:bento: queryStringGenerator Utilization 함수 분리
youngminss Nov 3, 2022
db6ac5b
:sparkles: 차량 목록 데이터 필터링 조회 기능 구현(with. queryStringGenerator 함수)
youngminss Nov 3, 2022
4801bf5
Merge pull request #23 from wanted-pre-onboarding-frontend-12team/fea…
youngminss Nov 3, 2022
eb0051a
:lipstick: 상세페이지 자동차 이미지 사이즈 조절
jong6598 Nov 3, 2022
5468186
:sparkles: 잘못된 상세페이지 연결을 처리하기 위한 에러바운더리 처리 코드 작성
jong6598 Nov 3, 2022
1d38f09
Merge pull request #25 from wanted-pre-onboarding-frontend-12team/fea…
youngminss Nov 3, 2022
f81c196
:lipstick: 에러 페이지 레이아웃 스타일 수정
youngminss Nov 3, 2022
c243b46
:rocket: 빌드 결과물 Redirect 인식을 위한 _redirects 파일 생성
youngminss Nov 3, 2022
174871c
:rocket: Base api url env 파일에서 동적으로 불러와서 사용(because. API Key 노출 방지)
youngminss Nov 3, 2022
40000e1
🚀 workflow.yml 파일 추가
od-log Nov 3, 2022
4744e1b
Merge pull request #28 from wanted-pre-onboarding-frontend-12team/fea…
youngminss Nov 3, 2022
f95c322
Merge pull request #29 from wanted-pre-onboarding-frontend-12team/fea…
od-log Nov 3, 2022
69c0f6d
Update README.md
jong6598 Nov 3, 2022
6c9973b
:books: 과제 달성 사항 및 해결 방법 추가 및 링크 수정
forest-6 Nov 3, 2022
7eb18dc
:books: recoil 기술 스택 추가
forest-6 Nov 3, 2022
5dab263
:rocket: React-Helmet-Async open graph meta 데이터 변경
youngminss Nov 3, 2022
4f7f505
Merge pull request #31 from wanted-pre-onboarding-frontend-12team/fea…
youngminss Nov 3, 2022
a14309e
:rocket: 검색엔진 크롤러 모든 페이지 접근 가능 robots.txt 설정
youngminss Nov 3, 2022
b527b7a
:heavy_plus_sign: react-snap 의존성 패키지 pre-render 를 위해 설치
youngminss Nov 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/triple-slash-reference": "off",
"react/react-in-jsx-scope": "off",
"no-var": "error"
"no-var": "error",
"no-unused-vars": "error",
"eqeqeq": "error",
"no-console": "warn"
}
}
26 changes: 26 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI/CD

on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- run: yarn install --immutable --immutable-cache --check-cache
- run: yarn run build
- run: echo GITHUB ACTION RUN BUILD
- name: deploy to s3
uses: jakejarvis/s3-sync-action@master
with:
args: --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'ap-northeast-2'
SOURCE_DIR: 'build'
191 changes: 191 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
# 원티드 프리온보딩 7차 3차 과제

## 과제 설명

> Assignment 3 주제 : B2C 차량대여 서비스

- 진행 기간 : 2022-11-02 ~ 2022-11-04

<br />

## 데모 링크

[🚀 GO TO DEMO]()

<br />

## 실행 방법

### Local

```bash
# Clone Repo
git clone

# Install Dependency
yarn run install

# Run Project
yarn run dev

# Build Project
yarn run build
```

<br />

## 12팀 소개

| <img src="https://avatars.githubusercontent.com/u/40523487?v=4"/> | <img src="https://avatars.githubusercontent.com/u/50790145?v=4"/> | <img src="https://avatars.githubusercontent.com/u/108744804?v=4"> | <img src="https://avatars.githubusercontent.com/u/97100045?v=4"/> | <img src="https://avatars.githubusercontent.com/u/92246102?v=4"> | <img src="https://avatars.githubusercontent.com/u/96763714?v=4"> |
| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
| <a href="https://github.com/od-log">[팀장] 오다영</a> | <a href="https://github.com/youngminss">[부팀장] 위영민</a> | <a href="https://github.com/jong6598">김종현</a> | <a href="https://github.com/hopak-e">박상호</a> | <a href="https://github.com/forest-6">임승민</a> | <a href="https://github.com/kyunghee47">피경희</a> |

<br/>

## 12팀이 동료학습으로 협업하는 방식

1. Convention Rule을 정하고, 모든 팀원이 실천합니다.

2. 게더 타운에서 만나요~

- 1시부터 6시까지는 12팀이 집중해서 작업하는 코어 시간입니다. 멀리 떨어져 있지만 옆에 있는 것처럼 화면을 공유하고 서로 자유롭게 의견을 나누면서 과제를 해결하기 위해 협업합니다.

3. gitflow

- 12팀은 git flow 방식으로 개발하고 있습니다. devlop branch에 자신이 작업한 branch를 merge하려면 최소 두 명 이상의 팀원이 리뷰를 하고, 요청을 수락해야 합니다. 그래서 12팀은 pull request 요청이 오는 즉시 12팀의 디스코드에 알람으로, 메일로 각 팀원들에게 전달되어 빠르게 피드백이 가능하면서도 작업하는 branch의 변경사항을 공유할 수 있는 환경을 구성했습니다.

4. 피그잼 & 피그마

- 피그잼에 모여서 UI를 고민하는 팀과 데이터를 고민하는 팀으로 나누어서 계획을 짜고, 다시 모여서 함께 짧은 시간동안 완성해야하는 작업을 나눴습니다. 피그잼과 피그마로 함께 만들 소프트웨어를 기획했습니다. 작업을 시작했습니다~

[피그잼에서 고민한 내용 보러가기](https://www.figma.com/file/imDU0VKds37F3eM4tdbgjc/Assignment-3---%EC%95%8C%ED%8B%B0%EB%AA%A8%EB%B9%8C%EB%A6%AC%ED%8B%B0?node-id=0%3A1)
[피그마에서 기획한 내용 보러가기](https://www.figma.com/file/c91jQRLuanBMFRE9ztbXcz/Assignment-3---%EC%95%8C%ED%8B%B0%EB%AA%A8%EB%B9%8C%EB%A6%AC%ED%8B%B0?node-id=0%3A1)

<br />

## 과제 달성 사항 및 해결 방법

### 필수 요구 사항

- [x] Figma 상의 디자인 및 기능 구현
- [x] segment, fuelType은 받아온 데이터를 치환해서 사용
- [x] 차량 생성일로부터 1일 이내일 경우 "신규" 표시
- [x] 좌우 슬라이드 카테고리
- [x] 카테고리를 누르면 segment에 맞는 차량만 표시
- [x] 컴포넌트를 클릭 시 차량 상세 페이지 이동
- [x] 차량 리스트
- [x] 차량이 없을 때 처리
- [x] 차량 불러오는 중 처리
- [x] 차량 상세

### 추가 구현 사항

- [x] SEO
- 카카오톡, 페이스북에 공유 시 아래의 내용이 미리보기로 노출되도록 해야 함
- 제목: car.brand + car.name
- 내용: 월 car.amount 원
- 사진: 차량 사진

<br />

## 레포지토리 구조(src)

```jsx
📦src
┣ 📂apis
┃ ┣ 📜car.ts
┃ ┗ 📜requester.ts
┣ 📂assets
┃ ┗ 📂images
┃ ┃ ┗ 📜back_icon.svg
┣ 📂components
┃ ┣ 📂feature
┃ ┃ ┣ 📂CarListItem
┃ ┃ ┃ ┣ 📜index.tsx
┃ ┃ ┃ ┗ 📜styled.ts
┃ ┃ ┣ 📂DetailForm
┃ ┃ ┃ ┣ 📜index.tsx
┃ ┃ ┃ ┗ 📜styled.ts
┃ ┃ ┣ 📂FormBody
┃ ┃ ┃ ┣ 📜index.tsx
┃ ┃ ┃ ┗ 📜styled.ts
┃ ┃ ┣ 📂FormHeader
┃ ┃ ┃ ┣ 📜index.tsx
┃ ┃ ┃ ┗ 📜styled.ts
┃ ┃ ┣ 📂Nav
┃ ┃ ┃ ┣ 📜index.tsx
┃ ┃ ┃ ┗ 📜styled.ts
┃ ┃ ┗ 📂VehicleItem
┃ ┃ ┃ ┗ 📜index.tsx
┃ ┣ 📂layout
┃ ┃ ┣ 📂Header
┃ ┃ ┃ ┣ 📜index.tsx
┃ ┃ ┃ ┗ 📜styled.ts
┃ ┃ ┣ 📜index.tsx
┃ ┃ ┗ 📜styled.ts
┃ ┣ 📂shared
┃ ┃ ┣ 📂Chip
┃ ┃ ┃ ┣ 📜index.tsx
┃ ┃ ┃ ┗ 📜styled.ts
┃ ┃ ┣ 📂Image
┃ ┃ ┃ ┣ 📜index.tsx
┃ ┃ ┃ ┗ 📜styled.ts
┃ ┃ ┣ 📂SEOMetaTag
┃ ┃ ┃ ┗ 📜index.tsx
┃ ┃ ┗ 📂StatusContent
┃ ┃ ┃ ┣ 📜index.tsx
┃ ┃ ┃ ┗ 📜styled.ts
┃ ┗ 📜index.ts
┣ 📂constants
┃ ┣ 📜api.ts
┃ ┣ 📜attributeDummyData.ts
┃ ┗ 📜car.ts
┣ 📂hooks
┃ ┣ 📜useCar.ts
┃ ┗ 📜useCars.ts
┣ 📂pages
┃ ┣ 📂CarDetail
┃ ┃ ┣ 📜index.tsx
┃ ┃ ┗ 📜styled.ts
┃ ┣ 📂CarList
┃ ┃ ┣ 📜index.tsx
┃ ┃ ┗ 📜styled.ts
┃ ┣ 📂ErrorPage
┃ ┃ ┣ 📜ErrorBoundary.tsx
┃ ┃ ┣ 📜index.tsx
┃ ┃ ┗ 📜styled.ts
┃ ┗ 📜index.ts
┣ 📂recoil
┃ ┗ 📂atoms
┃ ┃ ┗ 📜ChipAtom.tsx
┣ 📂router
┃ ┣ 📜index.tsx
┃ ┗ 📜routePath.ts
┣ 📂styles
┃ ┣ 📜GlobalStyle.tsx
┃ ┣ 📜index.ts
┃ ┣ 📜styled.d.ts
┃ ┗ 📜theme.ts
┣ 📂types
┃ ┗ 📜car.ts
┣ 📂utils
┃ ┣ 📜ArrayUtils.ts
┃ ┣ 📜DateUtils.ts
┃ ┗ 📜StringUtils.ts
┣ 📜App.tsx
┣ 📜index.tsx
┗ 📜vite-env.d.ts
```

## 기술 스택

<img src="https://img.shields.io/badge/react-61DAFB?style=for-the-badge&logo=react&logoColor=black"> <img src="https://img.shields.io/badge/React_Query-FF4154?style=for-the-badge&logo=react query&logoColor=white">
<img src="https://img.shields.io/badge/recoil-gray?style=for-the-badge&logo=recoil&logoColor=white">
<img src="https://img.shields.io/badge/react-router-CA4245?style=for-the-badge&logo=react-router&logoColor=white"> <img src="https://img.shields.io/badge/swiper-6332F6?style=for-the-badge&logo=swiper&logoColor=white"> <img src="https://img.shields.io/badge/styled-component-DB7093?style=for-the-badge&logo=styled-component&logoColor=white">
<br /><img src="https://img.shields.io/badge/typescript-3178C6?style=for-the-badge&logo=typescript&logoColor=black">
<img src="https://img.shields.io/badge/html-E34F26?style=for-the-badge&logo=html5&logoColor=white">
<img src="https://img.shields.io/badge/css-1572B6?style=for-the-badge&logo=css3&logoColor=white"><br />
<img src="https://img.shields.io/badge/yarn-2C8EBB?style=for-the-badge&logo=yarn&logoColor=white">
<img src="https://img.shields.io/badge/vite-646CFF?style=for-the-badge&logo=vite&logoColor=white">
<img src="https://img.shields.io/badge/prettier-1A2C34?style=for-the-badge&logo=prettier&logoColor=F7BA3E">
<img src="https://img.shields.io/badge/eslint-181717?style=for-the-badge&logo=eslint&logoColor=white">
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>알티모빌리티 - 차량대여 서비스</title>
</head>
<body>
<div id="root"></div>
Expand Down
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,24 @@
"preview": "vite preview",
"lint": "eslint . --fix --cache --max-warnings=0",
"pretty": "prettier . --write --cache",
"prepare": "husky install"
"prepare": "husky install",
"postbuild": "react-snap"
},
"dependencies": {
"@tanstack/react-query": "^4.14.1",
"axios": "^1.1.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet-async": "^1.3.0",
"react-router-dom": "^6.4.3",
"react-snap": "^1.23.0",
"recoil": "^0.7.6",
"styled-components": "^5.3.6",
"styled-reset": "^4.4.2",
"swiper": "^8.4.4"
},
"devDependencies": {
"@types/node": "^18.11.9",
"@types/react": "^18.0.22",
"@types/react-dom": "^18.0.7",
"@types/styled-components": "^5.1.26",
Expand All @@ -46,5 +51,8 @@
"yarn run pretty",
"yarn run lint"
]
},
"reactSnap": {
"source": "./dist"
}
}
1 change: 1 addition & 0 deletions public/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* /index.html 200
2 changes: 2 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
allow: /
12 changes: 11 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import Layout from './components/layout';
import Router from './router';
import ErrorBoundary from './pages/ErrorPage/ErrorBoundary';
import SEOMetaTag from './components/shared/SEOMetaTag';

const App = () => {
return <Router />;
return (
<Layout>
<SEOMetaTag />
<ErrorBoundary>
<Router />
</ErrorBoundary>
</Layout>
);
};
export default App;
16 changes: 16 additions & 0 deletions src/apis/car.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { GET, PATH } from '../constants/api';
import { CarsReponseDto } from '../types/car';
import { requester } from './requester';

export const getCars = async (query: string) => {
const {
car: { index },
} = PATH;

const { data } = await requester<CarsReponseDto>({
method: GET,
url: `${index}${query}`,
});

return data.payload;
};
25 changes: 25 additions & 0 deletions src/apis/requester.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';

const createAxiosInstance = () => {
const base = axios.create({
baseURL: import.meta.env.VITE_BASE_API_URL,
});

return base;
};

const axiosInstance = createAxiosInstance();

export async function requester<Payload>(option: AxiosRequestConfig) {
const response: AxiosResponse<Payload> = await axiosInstance({
headers: {
'Content-Type': 'application/json',
},
...option,
});
return {
status: response.status,
headers: response.headers,
data: response.data,
};
}
4 changes: 4 additions & 0 deletions src/assets/images/back_icon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions src/components/feature/CarListItem/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import * as S from './styled';
import { Car } from '@src/types/car';
import Image from '../../shared/Image';
import { carAttributeTable } from '@src/constants/car';
import { isNewDate } from '@src/utils/DateUtils';
import { numberWithCommasConverter } from '@src/utils/StringUtils';

const CarListItem = ({ car }: { car: Car }) => {
return (
<S.Container>
<S.SLink to={`/detail/${car.id}`}>
<S.Information>
<S.Brand>
<span>{car.attribute.brand}</span>
<span>{car.attribute.name}</span>
</S.Brand>
<S.Segment>
<span>
{carAttributeTable.segmentTable[car.attribute.segment]} / {carAttributeTable.fuelTable[car.attribute.fuelType]}
</span>
<span>월 {numberWithCommasConverter(car.amount)} 원 부터</span>
</S.Segment>
</S.Information>
<S.Img>
<Image imgUrl={car.attribute.imageUrl} />
<S.NewChip>{isNewDate(car.createdAt) && '신규'}</S.NewChip>
</S.Img>
</S.SLink>
</S.Container>
);
};

export default CarListItem;