Skip to content

Commit

Permalink
Merge pull request #296 from boostcampwm-2024/feature-fe-#295
Browse files Browse the repository at this point in the history
Popover 컴포넌트의 usePopover에 close 기능 추가
  • Loading branch information
yewonJin authored Nov 27, 2024
2 parents 9e4bee2 + 36e8285 commit a260ab4
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
1 change: 1 addition & 0 deletions apps/frontend/src/shared/model/usePopover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface PopoverContextType {
placement: Placement;
offset: Offset;
align: Alignment;
close: () => void;
}

export const PopoverContext = createContext<PopoverContextType | null>(null);
Expand Down
3 changes: 3 additions & 0 deletions apps/frontend/src/shared/ui/Popover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ function Popover({
y: offset.y ?? 0,
};

const close = () => setOpen(false);

return (
<PopoverContext.Provider
value={{
Expand All @@ -38,6 +40,7 @@ function Popover({
placement,
offset: fullOffset,
align,
close,
}}
>
{children}
Expand Down
73 changes: 72 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.26.2.tgz#278b6b13664557de95b8f35b90d96785850bb56e"
integrity sha512-Z0WgzSEa+aUcdiJuCIqgujCshpMWgUpgOxXotrYPSA53hA3qopNaqcJpyr0hVb1FeWdnqFA35/fUtXgBK8srQg==

"@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":
"@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":
version "7.26.0"
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.26.0.tgz#d78b6023cc8f3114ccf049eb219613f74a747b40"
integrity sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==
Expand Down Expand Up @@ -2975,6 +2975,77 @@
resolved "https://registry.yarnpkg.com/@tanstack/virtual-file-routes/-/virtual-file-routes-1.81.9.tgz#8bd3e5ffac8c9581771a613cb14d822255cda1e6"
integrity sha512-jV5mWJrsh3QXHpb/by6udSqwva0qK50uYHpIXvKsLaxnlbjbLfflfPjFyRWXbMtZsnzCjSUqp5pm5/p+Wpaerg==

"@tanstack/react-router@^1.82.12":
version "1.82.12"
resolved "https://registry.yarnpkg.com/@tanstack/react-router/-/react-router-1.82.12.tgz#eaf71545cd9ded870fd1187753ddcd3360d82c9f"
integrity sha512-A7Jx3jBNuoXDy8Ni6dS4OWkF/bWFzITOB/HFWF5TfLFs621VNhwiD0C00ZpnSyqsEuekoGg6W/q4HDVR2rlzNQ==
dependencies:
"@tanstack/history" "1.81.9"
"@tanstack/react-store" "^0.6.1"
jsesc "^3.0.2"
tiny-invariant "^1.3.3"
tiny-warning "^1.0.3"

"@tanstack/react-store@^0.6.1":
version "0.6.1"
resolved "https://registry.yarnpkg.com/@tanstack/react-store/-/react-store-0.6.1.tgz#2632409ff4257846584b7779daed7eff3e4b8de1"
integrity sha512-6gOopOpPp1cAXkEyTEv6tMbAywwFunvIdCKN/SpEiButUayjXU+Q5Sp5Y3hREN3VMR4OA5+RI5SPhhJoqP9e4w==
dependencies:
"@tanstack/store" "0.6.0"
use-sync-external-store "^1.2.2"

"@tanstack/router-devtools@^1.82.12":
version "1.82.12"
resolved "https://registry.yarnpkg.com/@tanstack/router-devtools/-/router-devtools-1.82.12.tgz#35b739735ae8c3dc88dfa10f35f9e34b2afdb567"
integrity sha512-KaTQwyS9b8HdTC+ZG+yxCznrs/RE2SISpDCfP+USHTFLnzteFwlixv9XX+4f4UAy1Nl0yo0qCjIusSN7kAJrCg==
dependencies:
clsx "^2.1.1"
goober "^2.1.16"

"@tanstack/router-generator@^1.82.10":
version "1.82.10"
resolved "https://registry.yarnpkg.com/@tanstack/router-generator/-/router-generator-1.82.10.tgz#5afe4417e55da0fda6387b8ec4d813358856fd1e"
integrity sha512-0wycXexEaZ8zOlHbpvl5k1L2qwFwhF4HCV5GgcyfftE4n2ifJ+XGZUqGob4yxvJVbgG5fJTnnyWkvmnNgzCSyg==
dependencies:
"@tanstack/virtual-file-routes" "^1.81.9"
prettier "^3.3.3"
tsx "^4.19.2"
zod "^3.23.8"

"@tanstack/router-plugin@^1.82.10":
version "1.82.10"
resolved "https://registry.yarnpkg.com/@tanstack/router-plugin/-/router-plugin-1.82.10.tgz#5155b5033d59d677de7649745b241fae30057534"
integrity sha512-5hBb2sTv/pEQb0T/7V+P+tfjuq97sIcoRhiCGUCqVlCMG809Q+RQFzXdlhJhG/a0KBT5jE/He/Q1Hf+7XG5Wzg==
dependencies:
"@babel/core" "^7.26.0"
"@babel/generator" "^7.26.2"
"@babel/parser" "^7.26.2"
"@babel/plugin-syntax-jsx" "^7.25.9"
"@babel/plugin-syntax-typescript" "^7.25.9"
"@babel/template" "^7.25.9"
"@babel/traverse" "^7.25.9"
"@babel/types" "^7.26.0"
"@tanstack/router-generator" "^1.82.10"
"@tanstack/virtual-file-routes" "^1.81.9"
"@types/babel__core" "^7.20.5"
"@types/babel__generator" "^7.6.8"
"@types/babel__template" "^7.4.4"
"@types/babel__traverse" "^7.20.6"
babel-dead-code-elimination "^1.0.6"
chokidar "^3.6.0"
unplugin "^1.12.2"
zod "^3.23.8"

"@tanstack/[email protected]":
version "0.6.0"
resolved "https://registry.yarnpkg.com/@tanstack/store/-/store-0.6.0.tgz#f73d711c6e53f2f91c0f0af0771583095d449f67"
integrity sha512-+m2OBglsjXcLmmKOX6/9v8BDOCtyxhMmZLsRUDswOOSdIIR9mvv6i0XNKsmTh3AlYU8c1mRcodC8/Vyf+69VlQ==

"@tanstack/virtual-file-routes@^1.81.9":
version "1.81.9"
resolved "https://registry.yarnpkg.com/@tanstack/virtual-file-routes/-/virtual-file-routes-1.81.9.tgz#8bd3e5ffac8c9581771a613cb14d822255cda1e6"
integrity sha512-jV5mWJrsh3QXHpb/by6udSqwva0qK50uYHpIXvKsLaxnlbjbLfflfPjFyRWXbMtZsnzCjSUqp5pm5/p+Wpaerg==

"@theinternetfolks/snowflake@^1.3.0":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@theinternetfolks/snowflake/-/snowflake-1.3.0.tgz#da26407eba4a0639d23e6ea08136e66270ee0e03"
Expand Down

0 comments on commit a260ab4

Please sign in to comment.