-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into feature/#102
- Loading branch information
Showing
22 changed files
with
454 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,42 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true | ||
}, | ||
"extends": [ | ||
"airbnb", | ||
"airbnb/hooks", | ||
"airbnb-typescript" | ||
], | ||
"globals": { | ||
"Atomics": "readonly", | ||
"SharedArrayBuffer": "readonly" | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"ecmaVersion": 2018, | ||
"project": "./tsconfig.json" | ||
}, | ||
"plugins": [ | ||
"react", | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"react/react-in-jsx-scope": "off", | ||
"linebreak-style" : "off", | ||
"react/jsx-props-no-spreading": "off", | ||
"react/require-default-props": "off", | ||
"no-restricted-imports": [ | ||
"error", | ||
{ | ||
"patterns": [ | ||
{ | ||
"group": ["../../*"], | ||
"message": "Usage of relative parent imports is not allowed." | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"settings": { | ||
"import/resolver": { | ||
"typescript": {} | ||
} | ||
} | ||
} | ||
"env": { | ||
"browser": true, | ||
"es6": true | ||
}, | ||
"extends": ["airbnb", "airbnb/hooks", "airbnb-typescript"], | ||
"globals": { | ||
"Atomics": "readonly", | ||
"SharedArrayBuffer": "readonly" | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"ecmaVersion": 2018, | ||
"project": "./tsconfig.json" | ||
}, | ||
"plugins": ["react", "@typescript-eslint"], | ||
"rules": { | ||
"react/react-in-jsx-scope": "off", | ||
"linebreak-style": "off", | ||
"react/jsx-props-no-spreading": "off", | ||
"react/require-default-props": "off", | ||
"no-restricted-imports": [ | ||
"error", | ||
{ | ||
"patterns": [ | ||
{ | ||
"group": ["../../*"], | ||
"message": "Usage of relative parent imports is not allowed." | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"settings": { | ||
"import/resolver": { | ||
"typescript": {} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
{ | ||
"extends": [ | ||
"stylelint-config-standard-scss" | ||
], | ||
"plugin": [ | ||
"stylelint-selector-bem-pattern" | ||
], | ||
"extends": ["stylelint-config-standard-scss"], | ||
"plugin": ["stylelint-selector-bem-pattern"], | ||
"rules": { | ||
"selector-class-pattern": null, | ||
"color-hex-length": null | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
export interface FetchTrendingsResponse { | ||
trendings: string[] | ||
} | ||
|
||
export interface SearchQueryParams { | ||
searchText : string; | ||
} | ||
|
||
export interface ShopsParams { | ||
keyword: string; | ||
location: Coords; | ||
} | ||
|
||
export interface FetchShopsResponse { | ||
content: Shop[]; | ||
} | ||
|
||
interface Shop { | ||
address: string, | ||
dist: 0, | ||
placeId: string, | ||
placeName: string, | ||
score: number, | ||
shopId: number, | ||
x: string, | ||
y: string, | ||
} | ||
|
||
export interface Coords { | ||
latitude: number, | ||
longitude: number | ||
} | ||
|
||
export interface FetchAutoCompleteParams { | ||
query: string; | ||
location?: Coords; | ||
} | ||
|
||
export interface FetchAutoCompleteResponse { | ||
data: string[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { | ||
FetchShopsResponse, | ||
FetchTrendingsResponse, | ||
ShopsParams, | ||
FetchAutoCompleteParams, | ||
FetchAutoCompleteResponse, | ||
} from './entity'; | ||
import searchApi from './searchApiClient'; | ||
|
||
export const fetchTrendings = () => searchApi.get<FetchTrendingsResponse>('/trending'); | ||
|
||
export const fetchShop = (shopId: string) => searchApi.get(`/shop?place_id=${shopId}`); | ||
|
||
export const fetchShops = (params: ShopsParams) => { | ||
const { keyword, location } = params; | ||
const url = `/shops?keyword=${keyword}`; | ||
const requestBody = { | ||
x: location?.latitude, | ||
y: location?.longitude, | ||
}; | ||
|
||
return searchApi.post<FetchShopsResponse>(url, requestBody); | ||
}; | ||
|
||
export const fetchAutoComplete = (params: FetchAutoCompleteParams) => { | ||
const { query, location } = params; | ||
const url = `/shops/auto-complete?query=${query}`; | ||
const requestBody = { | ||
x: location?.latitude, | ||
y: location?.longitude, | ||
}; | ||
return searchApi.post<FetchAutoCompleteResponse>(url, requestBody); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import axios from 'axios'; | ||
import { API_PATH } from 'config/constants'; | ||
|
||
const searchApi = axios.create({ | ||
baseURL: `${API_PATH}`, | ||
timeout: 2000, | ||
}); | ||
|
||
searchApi.interceptors.request.use( | ||
(config) => { | ||
const accessToken = sessionStorage.getItem('accessToken'); | ||
// eslint-disable-next-line no-param-reassign | ||
if (config.headers && accessToken) config.headers.Authorization = `Bearer ${accessToken}`; | ||
return config; | ||
}, | ||
); | ||
|
||
export default searchApi; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions
37
src/pages/Search/components/NotFoundPage/NotFoundPage.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
@use "src/utils/styles/mediaQuery.scss" as media; | ||
|
||
.not-found-page__container { | ||
padding-top: 180px; | ||
max-width: 980px; | ||
margin: 0 auto; | ||
|
||
&__title { | ||
width: 544px; | ||
height: 100px; | ||
color: #000; | ||
font-family: SUIT, system-ui; | ||
font-size: 40px; | ||
font-weight: 400; | ||
line-height: normal; | ||
} | ||
|
||
&__description { | ||
margin-top: 22px; | ||
width: 240px; | ||
height: 30px; | ||
color: #666; | ||
font-family: SUIT, system-ui; | ||
font-size: 24px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: normal; | ||
} | ||
|
||
&__image { | ||
display: flex; | ||
margin-left: auto; | ||
margin-top: 55px; | ||
width: 676px; | ||
height: 451px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import styles from 'pages/Search/components/NotFoundPage/NotFoundPage.module.scss'; | ||
import img from 'assets/images/search/not-found-img.jpeg'; | ||
|
||
export default function NotFoundPage() { | ||
return ( | ||
<section> | ||
<div className={styles['not-found-page__container']}> | ||
<div className={styles['not-found-page__container__title']}> | ||
해당 검색어와 관련된 | ||
{' '} | ||
<br /> | ||
{' '} | ||
음식점/게시물을 찾을 수 없습니다. | ||
</div> | ||
<div className={styles['not-found-page__container__description']}> | ||
<div className="not-found-page__container__description__text">다시 한 번 검색해 보세요!</div> | ||
</div> | ||
<img className={styles['not-found-page__container__image']} src={img} alt="not-found" /> | ||
</div> | ||
</section> | ||
|
||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.