react-notify-sdk 1.0.38 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/FadeWrapper.js
CHANGED
|
@@ -4,7 +4,7 @@ export const FadeWrapper = styled("div") `
|
|
|
4
4
|
opacity: ${(props) => (props.visible ? 1 : 0)};
|
|
5
5
|
animation: ${(props) => (props.visible ? fadeIn : fadeOut)} 0.3s ease forwards;
|
|
6
6
|
transition: opacity 0.3s ease;
|
|
7
|
-
position:
|
|
7
|
+
position: fixed;
|
|
8
8
|
width: ${(props) => props.device === 'Mobile' ? '95%' : props.device === 'Tablet' ? '420px' : '420px'};
|
|
9
9
|
top: ${(props) => props.message?.position === 'top' ? '24px' : ''};
|
|
10
10
|
bottom: ${(props) => props.message?.position === 'bottom' ? '24px' : ''};
|
|
@@ -18,11 +18,7 @@ const routeMatches = (pattern, path) => {
|
|
|
18
18
|
return false;
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
export const FeatureMessageProvider = ({ projectKey,
|
|
22
|
-
//className,
|
|
23
|
-
//style,
|
|
24
|
-
//disableDefaultStyles = true,
|
|
25
|
-
}) => {
|
|
21
|
+
export const FeatureMessageProvider = ({ projectKey, }) => {
|
|
26
22
|
const [message, setMessage] = useState(null);
|
|
27
23
|
const [visible, setVisible] = useState(false);
|
|
28
24
|
const [pathname, setPathname] = useState(() => typeof window !== 'undefined' ? window.location.pathname : '');
|
|
@@ -67,8 +63,6 @@ export const FeatureMessageProvider = ({ projectKey,
|
|
|
67
63
|
.eq('route', pathname)
|
|
68
64
|
.eq('is_active', true)
|
|
69
65
|
.order('created_at', { ascending: false });
|
|
70
|
-
//.limit(1)
|
|
71
|
-
//.single();
|
|
72
66
|
const match = data?.find((msg) => routeMatches(msg.route, pathname));
|
|
73
67
|
if (match) {
|
|
74
68
|
setMessage(match);
|
|
@@ -105,6 +99,5 @@ export const FeatureMessageProvider = ({ projectKey,
|
|
|
105
99
|
}, [pathname, projectKey]);
|
|
106
100
|
if (!message)
|
|
107
101
|
return null;
|
|
108
|
-
//const defaultClasses = `absolute ${message?.position}-6 left-1/2 transform -translate-x-1/2 z-20 w-full md:w-[${message?.width}%] px-3 py-1 bg-[${message?.backgroundColor}] border border-[${message?.borderColor}] text-[${message?.textColor}] rounded-lg shadow`;
|
|
109
102
|
return (_jsx(FadeWrapper, { visible: visible, device: device, message: message, children: _jsx(FeatureMessage, { message: message }) }));
|
|
110
103
|
};
|