-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into auth-refresh-token
- Loading branch information
Showing
22 changed files
with
314 additions
and
58 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
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
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
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,26 @@ | ||
import React from 'react'; | ||
|
||
import { useRouter } from 'next/navigation'; | ||
|
||
import Flex from '@shared/flex/Flex'; | ||
import Radio from '@shared/radio/Radio'; | ||
|
||
function FilterGroup() { | ||
const router = useRouter(); | ||
|
||
const handleRadioValue = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
const sortType = e.target.value; | ||
router.push(`/?filter=${sortType}`, { scroll: false }); | ||
}; | ||
|
||
return ( | ||
<Flex justify="space-between" align="center" gap={8}> | ||
<Radio label="조회순" name="filter" type="filter" value="viewCnt-order" defaultChecked onChange={handleRadioValue} /> | ||
<Radio label="위반제품" name="filter" type="filter" value="violation-products" onChange={handleRadioValue} /> | ||
<Radio label="추천순" name="filter" type="filter" value="recommend-order" onChange={handleRadioValue} /> | ||
<Radio label="최신순" name="filter" type="filter" value="recent-order" onChange={handleRadioValue} /> | ||
</Flex> | ||
); | ||
} | ||
|
||
export default FilterGroup; |
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 @@ | ||
export type HomeSortType = 'viewCnt-order' | 'violation-products' | 'recommend-order' | 'recent-order'; |
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
24 changes: 24 additions & 0 deletions
24
src/components/shared/kakao-share-button/KakaoShareButton.tsx
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,24 @@ | ||
/* eslint-disable jsx-a11y/control-has-associated-label */ | ||
|
||
import Script from 'next/script'; | ||
|
||
import Share from '@components/icons/Share'; | ||
import useKakaoShare from '@hooks/useKakaoShare'; | ||
|
||
function KakaoShareButton() { | ||
const containerId = useKakaoShare('#kakao-link-btn', process.env.NEXT_PUBLIC_KAKAO_APP_JS_KEY!); | ||
|
||
return ( | ||
<> | ||
<button id={containerId} style={{ cursor: 'pointer' }}> | ||
<Share /> | ||
</button> | ||
<Script | ||
strategy="afterInteractive" | ||
type="text/javascript" | ||
src={`https://t1.kakaocdn.net/kakao_js_sdk/${process.env.NEXT_PUBLIC_KAKAO_LOGIN_VERSION}/kakao.min.js`} | ||
/> | ||
</> | ||
); | ||
} | ||
export default KakaoShareButton; |
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
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,73 @@ | ||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
/* eslint-disable @typescript-eslint/no-unsafe-call */ | ||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */ | ||
import { useCallback, useEffect } from 'react'; | ||
|
||
declare global { | ||
interface Window { | ||
Kakao: any | ||
} | ||
} | ||
|
||
function useKakaoShare(containerId: string, key: string) { | ||
const createShareButton = useCallback(() => { | ||
// kakao sdk script이 정상적으로 불러와졌으면 window.Kakao로 접근이 가능합니다 | ||
if (window.Kakao) { | ||
const kakao = window.Kakao; | ||
// 중복 initialization 방지 | ||
if (!kakao.isInitialized()) { | ||
// 두번째 step 에서 가져온 javascript key 를 이용하여 initialize | ||
kakao.init(key); | ||
} | ||
kakao.Share.createDefaultButton({ | ||
// Render 부분 id=kakao-link-btn 을 찾아 그부분에 렌더링을 합니다 | ||
container: containerId, | ||
objectType: 'feed', | ||
content: { | ||
title: 'Washfit', | ||
description: '안전한 세차용품 정보 제공 플랫폼', | ||
imageUrl: | ||
'https://tago.kr/images/sub/TG300-D02_img01.png', | ||
link: { | ||
webUrl: 'https://dev.washfit.site/', | ||
mobileWebUrl: 'https://dev.washfit.site/', | ||
}, | ||
}, | ||
social: { | ||
likeCount: 77, | ||
commentCount: 55, | ||
sharedCount: 333, | ||
}, | ||
buttons: [ | ||
// 카카오톡 웹에서 보기 | ||
{ | ||
title: '웹으로 보기', | ||
link: { | ||
mobileWebUrl: 'https://dev.washfit.site/', | ||
webUrl: 'https://dev.washfit.site/', | ||
}, | ||
}, | ||
// 카카오톡 모바일에서 보기 | ||
{ | ||
title: '앱으로 보기', | ||
link: { | ||
mobileWebUrl: 'https://dev.washfit.site/', | ||
webUrl: 'https://dev.washfit.site/', | ||
}, | ||
}, | ||
], | ||
}); | ||
} | ||
}, [containerId, key]); | ||
|
||
useEffect(() => { | ||
createShareButton(); | ||
}, [createShareButton]); | ||
|
||
// #kakao-link-btn과 같은 id에서 '#'제거 과정 | ||
const id = containerId.substring(1); | ||
return id; | ||
} | ||
|
||
export default useKakaoShare; |
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 @@ | ||
'use client'; | ||
|
||
import { ToastContainer } from 'react-toastify'; | ||
|
||
interface ToastProviderProps { | ||
children: React.ReactNode; | ||
} | ||
|
||
function ToastProvider({ children }: ToastProviderProps) { | ||
return ( | ||
<> | ||
{children} | ||
<ToastContainer /> | ||
</> | ||
); | ||
} | ||
|
||
export default ToastProvider; |
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.