hds-web 1.23.7 → 1.23.9
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/package.json
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { useState } from "react";
|
1
|
+
import React, { useState, useEffect } from "react";
|
2
2
|
import { Typography } from "../../../foundation/Typography";
|
3
3
|
import { HDSColor } from "../../../foundation/ColorPalette";
|
4
4
|
import { Icon } from '../../../components/common-components/Icon';
|
@@ -12,13 +12,41 @@ const tagColorVariants = {
|
|
12
12
|
green: 'bg-neutral-0 tb:bg-green-500 text-green-500 tb:text-neutral-0',
|
13
13
|
}
|
14
14
|
|
15
|
+
const isBrowser = typeof window !== "undefined";
|
16
|
+
|
15
17
|
export default function AnnouncementMd(props) {
|
16
18
|
const [isBannerActive, toggleBanner] = useState(true);
|
17
19
|
const bgClass = props.bgColorClass ? HDSColor(props.bgColorClass) : 'bg-neutral-0';
|
18
20
|
const linkTextClass = props.linkTextColorClass ? HDSColor(props.linkTextColorClass) : 'text-neutral-600';
|
19
21
|
const tagClass = props.tagColor ? props.tagColor : 'purple';
|
20
22
|
const iconBgClass = props.iconBgColor ? HDSColor(props.iconBgColor) : 'bg-blue-200'
|
21
|
-
|
23
|
+
|
24
|
+
const [isConsentForm, setIsConsentForm] = useState(false);
|
25
|
+
const onCloseBanner = () => {
|
26
|
+
toggleBanner(false);
|
27
|
+
if (isBrowser) {
|
28
|
+
window.sessionStorage.setItem("announcementConsent", "true");
|
29
|
+
}
|
30
|
+
};
|
31
|
+
|
32
|
+
useEffect(() => {
|
33
|
+
if (isBrowser) {
|
34
|
+
if (
|
35
|
+
"sessionStorage" in window &&
|
36
|
+
window.sessionStorage &&
|
37
|
+
"getItem" in window.sessionStorage
|
38
|
+
) {
|
39
|
+
const localSessionStorage = window.sessionStorage.getItem(
|
40
|
+
"announcementConsent"
|
41
|
+
);
|
42
|
+
if (localSessionStorage) {
|
43
|
+
setIsConsentForm(true);
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}, []);
|
48
|
+
|
49
|
+
if (isBannerActive && !isConsentForm) {
|
22
50
|
return (
|
23
51
|
<div className="py-6">
|
24
52
|
<div className={`${bgClass} flex justify-between relative rounded-2xl tb:rounded-full shadow p-4 tb:justify-center tb:items-center`}>
|
@@ -49,7 +77,7 @@ export default function AnnouncementMd(props) {
|
|
49
77
|
</Typography>
|
50
78
|
</a>
|
51
79
|
</div>
|
52
|
-
<div className="static mt-[2px] tb:mt-0 ml-3 tb:ml-0 tb:absolute top-1/2 tb:-translate-y-1/2 tb:left-6 cursor-pointer w-5 h-5 min-w-[20px] tb:w-8 tb:min-w-[32px] tb:h-8 rounded-full bg-neutral-100 flex items-center justify-center" onClick={()=>
|
80
|
+
<div className="static mt-[2px] tb:mt-0 ml-3 tb:ml-0 tb:absolute top-1/2 tb:-translate-y-1/2 tb:left-6 cursor-pointer w-5 h-5 min-w-[20px] tb:w-8 tb:min-w-[32px] tb:h-8 rounded-full bg-neutral-100 flex items-center justify-center" onClick={()=>onCloseBanner()}>
|
53
81
|
<Icon height={'block w-4 h-4 tb:w-6 tb:h-6 stroke-[2px] transition ease-in-out'} variant='xclose' strokeClass='stroke-neutral-800' />
|
54
82
|
</div>
|
55
83
|
</div>
|
@@ -153,10 +153,6 @@ V3Footer.defaultProps = {
|
|
153
153
|
{
|
154
154
|
title: 'Capabilities',
|
155
155
|
links: [
|
156
|
-
{
|
157
|
-
linkText: 'Performance',
|
158
|
-
linkUrl: 'https://hasura.io/product/performance/',
|
159
|
-
},
|
160
156
|
{
|
161
157
|
linkText: 'Instant API',
|
162
158
|
linkUrl: 'https://hasura.io/product/instant-api/',
|
@@ -166,12 +162,16 @@ V3Footer.defaultProps = {
|
|
166
162
|
linkUrl: 'https://hasura.io/product/authorization/',
|
167
163
|
},
|
168
164
|
{
|
169
|
-
linkText: '
|
170
|
-
linkUrl: 'https://hasura.io/product/
|
165
|
+
linkText: 'Performance',
|
166
|
+
linkUrl: 'https://hasura.io/product/performance/',
|
171
167
|
},
|
172
168
|
{
|
173
169
|
linkText: 'Federation',
|
174
|
-
linkUrl: 'https://hasura.io/
|
170
|
+
linkUrl: 'https://hasura.io/products/federation',
|
171
|
+
},
|
172
|
+
{
|
173
|
+
linkText: 'API Security',
|
174
|
+
linkUrl: 'https://hasura.io/product/api-security/',
|
175
175
|
},
|
176
176
|
{
|
177
177
|
linkText: 'Observability',
|
@@ -512,7 +512,6 @@ V3Header.defaultProps = {
|
|
512
512
|
secondaryCardArr:
|
513
513
|
[
|
514
514
|
{
|
515
|
-
|
516
515
|
childArray: [
|
517
516
|
{
|
518
517
|
description: '',
|
@@ -523,30 +522,30 @@ V3Header.defaultProps = {
|
|
523
522
|
},
|
524
523
|
{
|
525
524
|
description: '',
|
526
|
-
href: '/products/
|
527
|
-
icon: '
|
528
|
-
name: '
|
525
|
+
href: '/products/authorization',
|
526
|
+
icon: 'eye',
|
527
|
+
name: 'Authorization',
|
529
528
|
strokeClass: 'stroke-neutral-500'
|
530
529
|
},
|
531
530
|
{
|
532
531
|
description: '',
|
533
|
-
href: '/products/
|
534
|
-
icon: '
|
535
|
-
name: '
|
532
|
+
href: '/products/performance',
|
533
|
+
icon: 'speedometer03',
|
534
|
+
name: 'Performance',
|
536
535
|
strokeClass: 'stroke-neutral-500'
|
537
536
|
},
|
538
537
|
{
|
539
538
|
description: '',
|
540
|
-
href: '/products/
|
541
|
-
icon: '
|
542
|
-
name: '
|
539
|
+
href: '/products/federation',
|
540
|
+
icon: 'data',
|
541
|
+
name: 'Federation',
|
543
542
|
strokeClass: 'stroke-neutral-500'
|
544
543
|
},
|
545
544
|
{
|
546
545
|
description: '',
|
547
|
-
href: '/products/
|
548
|
-
icon: '
|
549
|
-
name: '
|
546
|
+
href: '/products/api-security',
|
547
|
+
icon: 'shieldtick',
|
548
|
+
name: 'API Security',
|
550
549
|
strokeClass: 'stroke-neutral-500'
|
551
550
|
},
|
552
551
|
{
|