react-notify-sdk 1.0.28 → 1.0.30

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.
@@ -27,10 +27,11 @@ const NotificationMessage = ({ message }) => {
27
27
  borderWidth: "1px",
28
28
  borderColor: `${hexToRgba(message.borderColor, 0.3)}`,
29
29
  boxShadow: `0 10px 15px -3px ${hexToRgba(message.borderColor, 0.4)}, 0 4px 6px -4px ${hexToRgba(message.borderColor, 0.4)}`
30
- }, children: [_jsxs("div", { className: 'w-full flex flex-row', style: {
30
+ }, children: [_jsxs("div", { className: 'w-full flex flex-row items-center', style: {
31
31
  width: '100%',
32
32
  display: 'flex',
33
- flexDirection: 'row'
33
+ flexDirection: 'row',
34
+ alignItems: 'center'
34
35
  }, children: [message?.type === 'Information' && _jsx(Info, { size: 16, style: { color: 'rgb(59 130 24)' } }), message?.type === 'Warning' && _jsx(AlertTriangle, { size: 16, style: { color: 'rgb(245 158 1)' } }), message?.type === 'Error' && _jsx(CircleX, { size: 16, style: { color: 'rgb(239 68 68)' } }), _jsx("p", { className: `text-lg font-semibold text-[${message?.textColor}] ml-3`, style: {
35
36
  fontSize: '1.125rem', // text-lg = 18px = 1.125rem
36
37
  fontWeight: 600, // font-semibold = 600
@@ -1,11 +1,14 @@
1
1
  import { useState, useEffect } from 'react';
2
+ import { UAParser } from 'ua-parser-js';
2
3
  const useDeviceDetection = () => {
3
4
  const [device, setDevice] = useState('');
4
5
  useEffect(() => {
5
6
  const handleDeviceDetection = () => {
6
- const userAgent = navigator.userAgent.toLowerCase();
7
- const isMobile = /iphone|ipad|ipod|android|blackberry|windows phone/g.test(userAgent);
8
- const isTablet = /(ipad|tablet|playbook|silk)|(android(?!.*mobile))/g.test(userAgent);
7
+ const parser = new UAParser(navigator.userAgent);
8
+ const parsedDevice = parser.getDevice();
9
+ const isMobile = parsedDevice.type === 'mobile';
10
+ const isTablet = parsedDevice.type === 'tablet';
11
+ const isDesktop = !isMobile && !isTablet;
9
12
  if (isMobile) {
10
13
  setDevice('Mobile');
11
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-notify-sdk",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "description": "SDK for displaying real-time route-specific messages in React apps",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,7 +18,8 @@
18
18
  "@supabase/supabase-js": "^2.50.0",
19
19
  "clsx": "^2.1.1",
20
20
  "goober": "^2.1.16",
21
- "lucide-react": "^0.541.0"
21
+ "lucide-react": "^0.541.0",
22
+ "ua-parser-js": "^2.0.4"
22
23
  },
23
24
  "devDependencies": {
24
25
  "@types/react": "^19.1.8",