-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 추후 다른 앰비언트 타입 작성을 고려해 svg.d.ts -> index.d.ts로 수정 * feat: setAccessToken window 객체 등록 * feat: 앰비언트 타입 lint 미적용 * chore: zustand 설치 * feat: accessToken 저장소 * feat: window 객체에 등록
- Loading branch information
Showing
9 changed files
with
58 additions
and
18 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,3 +1,4 @@ | ||
dist | ||
.eslintrc.cjs | ||
mocks | ||
mocks | ||
index.d.ts |
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,10 @@ | ||
declare module '*.svg' { | ||
const content: React.FC<React.SVGProps<SVGElement>>; | ||
export default content; | ||
} | ||
|
||
export declare global { | ||
interface Window { | ||
setAccessToken: (accessToken: string) => void; | ||
} | ||
} |
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,5 @@ | ||
import { setAccessToken } from '@/shared/store'; | ||
|
||
export function initWebViewInfo() { | ||
window.setAccessToken = setAccessToken; | ||
} |
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,23 @@ | ||
import { create } from 'zustand'; | ||
import { devtools } from 'zustand/middleware'; | ||
|
||
interface AuthState { | ||
accessToken: string | undefined; | ||
} | ||
|
||
const useAuthStore = create<AuthState>()( | ||
devtools( | ||
(): AuthState => ({ | ||
accessToken: undefined, | ||
}), | ||
{ name: 'auth-store' }, | ||
), | ||
); | ||
|
||
export function setAccessToken(accessToken: string) { | ||
useAuthStore.setState(() => ({ accessToken }), false, 'auth/setAccessToken'); | ||
} | ||
|
||
export function getAccessToken() { | ||
return useAuthStore.getState().accessToken; | ||
} |
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 { setAccessToken, getAccessToken } from './auth/auth-store'; |
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 |
---|---|---|
|
@@ -1677,11 +1677,6 @@ emoji-regex@^10.3.0: | |
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.3.0.tgz#76998b9268409eb3dae3de989254d456e70cfe23" | ||
integrity sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw== | ||
|
||
emoji-regex@^10.3.0: | ||
version "10.3.0" | ||
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-10.3.0.tgz#76998b9268409eb3dae3de989254d456e70cfe23" | ||
integrity sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw== | ||
|
||
emoji-regex@^8.0.0: | ||
version "8.0.0" | ||
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" | ||
|
@@ -2786,16 +2781,6 @@ json5@^2.2.3: | |
object.assign "^4.1.4" | ||
object.values "^1.1.6" | ||
|
||
"jsx-ast-utils@^2.4.1 || ^3.0.0": | ||
version "3.3.5" | ||
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz#4766bd05a8e2a11af222becd19e15575e52a853a" | ||
integrity sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ== | ||
dependencies: | ||
array-includes "^3.1.6" | ||
array.prototype.flat "^1.3.1" | ||
object.assign "^4.1.4" | ||
object.values "^1.1.6" | ||
|
||
keyv@^4.5.3: | ||
version "4.5.4" | ||
resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" | ||
|
@@ -4056,6 +4041,11 @@ url-parse@^1.5.3: | |
querystringify "^2.1.1" | ||
requires-port "^1.0.0" | ||
|
||
[email protected]: | ||
version "1.2.0" | ||
resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" | ||
integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== | ||
|
||
[email protected]: | ||
version "1.5.0" | ||
resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-1.5.0.tgz#7f74dadfecb15bca016c5ce5ef85e5cc4b82abf2" | ||
|
@@ -4295,3 +4285,10 @@ yocto-queue@^1.0.0: | |
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" | ||
integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== | ||
|
||
zustand@^4.5.2: | ||
version "4.5.2" | ||
resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.5.2.tgz#fddbe7cac1e71d45413b3682cdb47b48034c3848" | ||
integrity sha512-2cN1tPkDVkwCy5ickKrI7vijSjPksFRfqS6237NzT0vqSsztTNnQdHw9mmN7uBdk3gceVXU0a+21jFzFzAc9+g== | ||
dependencies: | ||
use-sync-external-store "1.2.0" |