-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Stories): add hook for sync tabs #138
Conversation
Preview is ready. |
src/components/Stories/Stories.tsx
Outdated
@@ -48,13 +51,21 @@ export function Stories({ | |||
[onClose], | |||
); | |||
|
|||
const {callback: closeWithLS} = useSyncWithLS<NonNullable<StoriesProps['onClose']>>({ | |||
callback: (event, reason) => { | |||
if (syncInTabs) onClose?.(event, reason); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to check syncInTabs
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tnx, fixed.
@@ -62,6 +62,7 @@ const DefaultTemplate: StoryFn<StoriesProps> = (props: StoriesProps) => { | |||
<Stories | |||
{...props} | |||
open={visible} | |||
syncInTabs={props.syncInTabs} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Above, with the restructuring of props, syncInTabs
also will be set, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, right. Fixed.
UXRFC-300.
Perform action in multiple tabs simultaneously using Local Storage key and 'storage' event listener.