Skip to content

Commit

Permalink
test: test
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondanythings committed Mar 30, 2023
1 parent 78f87b8 commit 48c8bfa
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 13 deletions.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="ko">

<head>
<meta charset="UTF-8" />
Expand All @@ -12,6 +12,7 @@
<script>
Kakao.init('391f7206a40e805c09b77bb18110679d'); // 사용하려는 앱의 JavaScript 키 입력
</script>

<title>Vite + React + TS</title>
</head>

Expand Down
10 changes: 9 additions & 1 deletion src/hooks/useGetSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ const useGetSelection = () => {
(state: IStore) =>
Object.keys(state.selection).reduce((acc, cur) => {
if (param.get(cur) || state.selection[cur] || cur === 'needCompanion') {
return { ...acc, [cur]: param.get(cur) || state.selection[cur] }
const value = param.get(cur) || state.selection[cur]
const obj = {
[cur]: cur === 'needCompanion' ? value === 'true' : value,
}
console.log(obj)
return {
...acc,
...obj,
}
}
return { ...acc }
}, {}),
Expand Down
2 changes: 1 addition & 1 deletion src/routes/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ const Router = () => {
<Routes>
<Route path='' element={<Default />}>
<Route index element={<Home />} />
<Route path='result' element={<Search />} />
<Route path='convenient' element={<Convenient />} />
<Route path='detail' element={<Detail />} />
<Route path='result' element={<Search />} />
</Route>
</Routes>
</BrowserRouter>
Expand Down
7 changes: 4 additions & 3 deletions src/screen/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ const Home = () => {
HOME
<button
onClick={() =>
linkToKaKaoMap({
latitude: 37.4979502,
longitude: 127.0276368,
window.Kakao.Share.sendCustom({
templateId: 91940,

callback: () => console.log('???'),
})
}
>
Expand Down
14 changes: 7 additions & 7 deletions src/screen/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ const Search = () => {
setIsLoading(false)
},
})

const hasNextPage = places?.pageInfo.hasNextPage
const edges = useMemo(() => places?.edges, [places?.edges])

Expand All @@ -129,24 +128,25 @@ const Search = () => {
내 주변 가까운 <br />
{places?.totalCount}개의 추천 관광지
</h3>
<KakaoIcon
<div
onClick={() => {
console.log(edges[0].node.thumbnails[0])
console.log(edges[1].node.thumbnails[0])
console.log(edges[2].node.thumbnails[0])
console.log('onClick')
window.Kakao.Share.sendCustom({
templateId: 91940,
templateArgs: {
name: '???',
thumb_1: edges[0].node.thumbnails[0],
thumb_2: edges[1].node.thumbnails[0],
thumb_3: edges[2].node.thumbnails[0],
name: 'test',
...selection,
},

callback: () => console.log('???'),
})
}}
/>
>
<KakaoIcon />
</div>
</div>

<Stickable>
Expand Down
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default ({ mode }) => {
plugins: [react(), svgr()],
server: {
port: 3000,
host: true,
},

resolve: {
Expand Down

0 comments on commit 48c8bfa

Please sign in to comment.