You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: packages/banners/src/translators/reactjs/useBanner.ts
+7-19
Original file line number
Diff line number
Diff line change
@@ -2,32 +2,20 @@ import {Banners} from '@yoroi/types'
2
2
import{freeze}from'immer'
3
3
import*asReactfrom'react'
4
4
5
-
/**
6
-
* Custom hook to manage the state of a banner.
7
-
*
8
-
* @param {Object} params - The parameters for the hook.
9
-
* @param {string} params.id - The unique identifier for the banner.
10
-
* @param {Banners.Manager} params.manager - The manager responsible for handling banner state.
11
-
* @param {Function} params.shouldShowCb - Callback function to determine if the banner should be shown.
12
-
* @param {Object} params.shouldShowCb.params - Parameters for the callback function.
13
-
* @param {number} params.shouldShowCb.params.dismissedAt - The timestamp when the banner was dismissed.
14
-
* @returns {Object} An object containing the banner's dismissed timestamp, a function to dismiss the banner, and a boolean indicating if the banner should be shown.
15
-
* @note Remember wrapping the shouldShowCb function in a useCallback hook to prevent unnecessary re-renders.
0 commit comments