Skip to content

Commit f734740

Browse files
committed
feat: usePopover에 close 기능 추가
1 parent 4d1e8de commit f734740

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
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}

0 commit comments

Comments
 (0)