Skip to content

Commit a260ab4

Browse files
authored
Merge pull request #296 from boostcampwm-2024/feature-fe-#295
Popover 컴포넌트의 usePopover에 close 기능 추가
2 parents 9e4bee2 + 36e8285 commit a260ab4

File tree

3 files changed

+76
-1
lines changed

3 files changed

+76
-1
lines changed

apps/frontend/src/shared/model/usePopover.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export interface PopoverContextType {
1515
placement: Placement;
1616
offset: Offset;
1717
align: Alignment;
18+
close: () => void;
1819
}
1920

2021
export const PopoverContext = createContext<PopoverContextType | null>(null);

apps/frontend/src/shared/ui/Popover/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ function Popover({
2929
y: offset.y ?? 0,
3030
};
3131

32+
const close = () => setOpen(false);
33+
3234
return (
3335
<PopoverContext.Provider
3436
value={{
@@ -38,6 +40,7 @@ function Popover({
3840
placement,
3941
offset: fullOffset,
4042
align,
43+
close,
4144
}}
4245
>
4346
{children}

yarn.lock

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@
666666
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.26.2.tgz#278b6b13664557de95b8f35b90d96785850bb56e"
667667
integrity sha512-Z0WgzSEa+aUcdiJuCIqgujCshpMWgUpgOxXotrYPSA53hA3qopNaqcJpyr0hVb1FeWdnqFA35/fUtXgBK8srQg==
668668

669-
"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.7", "@babel/core@^7.23.9", "@babel/core@^7.26.0":
669+
"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.7", "@babel/core@^7.23.9", "@babel/core@^7.25.2", "@babel/core@^7.26.0":
670670
version "7.26.0"
671671
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40"
672672
integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==
@@ -2975,6 +2975,77 @@
29752975
resolved "https://registry.yarnpkg.com/@tanstack/virtual-file-routes/-/virtual-file-routes-1.81.9.tgz#8bd3e5ffac8c9581771a613cb14d822255cda1e6"
29762976
integrity sha512-jV5mWJrsh3QXHpb/by6udSqwva0qK50uYHpIXvKsLaxnlbjbLfflfPjFyRWXbMtZsnzCjSUqp5pm5/p+Wpaerg==
29772977

2978+
"@tanstack/react-router@^1.82.12":
2979+
version "1.82.12"
2980+
resolved "https://registry.yarnpkg.com/@tanstack/react-router/-/react-router-1.82.12.tgz#eaf71545cd9ded870fd1187753ddcd3360d82c9f"
2981+
integrity sha512-A7Jx3jBNuoXDy8Ni6dS4OWkF/bWFzITOB/HFWF5TfLFs621VNhwiD0C00ZpnSyqsEuekoGg6W/q4HDVR2rlzNQ==
2982+
dependencies:
2983+
"@tanstack/history" "1.81.9"
2984+
"@tanstack/react-store" "^0.6.1"
2985+
jsesc "^3.0.2"
2986+
tiny-invariant "^1.3.3"
2987+
tiny-warning "^1.0.3"
2988+
2989+
"@tanstack/react-store@^0.6.1":
2990+
version "0.6.1"
2991+
resolved "https://registry.yarnpkg.com/@tanstack/react-store/-/react-store-0.6.1.tgz#2632409ff4257846584b7779daed7eff3e4b8de1"
2992+
integrity sha512-6gOopOpPp1cAXkEyTEv6tMbAywwFunvIdCKN/SpEiButUayjXU+Q5Sp5Y3hREN3VMR4OA5+RI5SPhhJoqP9e4w==
2993+
dependencies:
2994+
"@tanstack/store" "0.6.0"
2995+
use-sync-external-store "^1.2.2"
2996+
2997+
"@tanstack/router-devtools@^1.82.12":
2998+
version "1.82.12"
2999+
resolved "https://registry.yarnpkg.com/@tanstack/router-devtools/-/router-devtools-1.82.12.tgz#35b739735ae8c3dc88dfa10f35f9e34b2afdb567"
3000+
integrity sha512-KaTQwyS9b8HdTC+ZG+yxCznrs/RE2SISpDCfP+USHTFLnzteFwlixv9XX+4f4UAy1Nl0yo0qCjIusSN7kAJrCg==
3001+
dependencies:
3002+
clsx "^2.1.1"
3003+
goober "^2.1.16"
3004+
3005+
"@tanstack/router-generator@^1.82.10":
3006+
version "1.82.10"
3007+
resolved "https://registry.yarnpkg.com/@tanstack/router-generator/-/router-generator-1.82.10.tgz#5afe4417e55da0fda6387b8ec4d813358856fd1e"
3008+
integrity sha512-0wycXexEaZ8zOlHbpvl5k1L2qwFwhF4HCV5GgcyfftE4n2ifJ+XGZUqGob4yxvJVbgG5fJTnnyWkvmnNgzCSyg==
3009+
dependencies:
3010+
"@tanstack/virtual-file-routes" "^1.81.9"
3011+
prettier "^3.3.3"
3012+
tsx "^4.19.2"
3013+
zod "^3.23.8"
3014+
3015+
"@tanstack/router-plugin@^1.82.10":
3016+
version "1.82.10"
3017+
resolved "https://registry.yarnpkg.com/@tanstack/router-plugin/-/router-plugin-1.82.10.tgz#5155b5033d59d677de7649745b241fae30057534"
3018+
integrity sha512-5hBb2sTv/pEQb0T/7V+P+tfjuq97sIcoRhiCGUCqVlCMG809Q+RQFzXdlhJhG/a0KBT5jE/He/Q1Hf+7XG5Wzg==
3019+
dependencies:
3020+
"@babel/core" "^7.26.0"
3021+
"@babel/generator" "^7.26.2"
3022+
"@babel/parser" "^7.26.2"
3023+
"@babel/plugin-syntax-jsx" "^7.25.9"
3024+
"@babel/plugin-syntax-typescript" "^7.25.9"
3025+
"@babel/template" "^7.25.9"
3026+
"@babel/traverse" "^7.25.9"
3027+
"@babel/types" "^7.26.0"
3028+
"@tanstack/router-generator" "^1.82.10"
3029+
"@tanstack/virtual-file-routes" "^1.81.9"
3030+
"@types/babel__core" "^7.20.5"
3031+
"@types/babel__generator" "^7.6.8"
3032+
"@types/babel__template" "^7.4.4"
3033+
"@types/babel__traverse" "^7.20.6"
3034+
babel-dead-code-elimination "^1.0.6"
3035+
chokidar "^3.6.0"
3036+
unplugin "^1.12.2"
3037+
zod "^3.23.8"
3038+
3039+
"@tanstack/[email protected]":
3040+
version "0.6.0"
3041+
resolved "https://registry.yarnpkg.com/@tanstack/store/-/store-0.6.0.tgz#f73d711c6e53f2f91c0f0af0771583095d449f67"
3042+
integrity sha512-+m2OBglsjXcLmmKOX6/9v8BDOCtyxhMmZLsRUDswOOSdIIR9mvv6i0XNKsmTh3AlYU8c1mRcodC8/Vyf+69VlQ==
3043+
3044+
"@tanstack/virtual-file-routes@^1.81.9":
3045+
version "1.81.9"
3046+
resolved "https://registry.yarnpkg.com/@tanstack/virtual-file-routes/-/virtual-file-routes-1.81.9.tgz#8bd3e5ffac8c9581771a613cb14d822255cda1e6"
3047+
integrity sha512-jV5mWJrsh3QXHpb/by6udSqwva0qK50uYHpIXvKsLaxnlbjbLfflfPjFyRWXbMtZsnzCjSUqp5pm5/p+Wpaerg==
3048+
29783049
"@theinternetfolks/snowflake@^1.3.0":
29793050
version "1.3.0"
29803051
resolved "https://registry.yarnpkg.com/@theinternetfolks/snowflake/-/snowflake-1.3.0.tgz#da26407eba4a0639d23e6ea08136e66270ee0e03"

0 commit comments

Comments
 (0)