gatsby-core-theme 44.0.15 → 44.0.16
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/CHANGELOG.md +24 -0
- package/gatsby-node.mjs +1 -1
- package/package.json +1 -1
- package/src/components/app-tracker.js +39 -0
- package/src/components/atoms/admin/button/button.test.js +55 -0
- package/src/components/atoms/notifications/index.js +9 -5
- package/src/components/atoms/notifications/notification-items/cards-v2/index.js +128 -0
- package/src/components/atoms/notifications/notification-items/cards-v2/notification-items.module.scss +276 -0
- package/src/components/atoms/notifications/notification-items/{index.js → spotlight/index.js} +3 -3
- package/src/components/atoms/notifications/notifications.test.js +212 -2
- package/src/components/molecules/spotlights_v2/image-text/template-one/index.js +27 -19
- package/src/components/molecules/spotlights_v2/image-text/template-three/index.js +5 -0
- package/src/components/molecules/spotlights_v2/image-text/template-three/item/index.js +32 -24
- package/src/components/molecules/spotlights_v2/image-text/template-two/index.js +30 -19
- package/src/components/pages/tracker/index-ssr.js +1 -1
- package/src/helpers/getters.mjs +18 -2
- package/src/helpers/getters.test.js +25 -0
- package/src/helpers/processor/index.mjs +3 -1
- package/src/helpers/processor/modules.mjs +11 -6
- package/src/helpers/processor/sports-relations.mjs +172 -123
- package/src/helpers/replaceMedia.js +0 -7
- package/src/helpers/replaceMedia.test.js +0 -35
- /package/src/components/atoms/notifications/notification-items/{notification-items.module.scss → spotlight/notification-items.module.scss} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
## [44.0.16](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.0.15...v44.0.16) (2025-04-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add / in the end for spotlight module ([2db0279](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/2db02790e6f40fa5ca480c5cce812a8cdd5c3e96))
|
|
7
|
+
* add regex ([14d21d5](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/14d21d538bf6669612857a3bb5e246263cc6fd97))
|
|
8
|
+
* add test and improve logic ([6117dfe](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/6117dfe85709875fbafd9f2881fc96c7fbb39482))
|
|
9
|
+
* add traling slash for spotlight module ([98b0ee4](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/98b0ee46eb529411201c2c10f1f21647347e1161))
|
|
10
|
+
* add traling slash for tracker lins ([fc41d0b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/fc41d0b1210bbf379461d62ba8e5a6a6a250bfb3))
|
|
11
|
+
* added cards_v2 to notifications section ([17f7b40](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/17f7b409cff5cf5f314c0bc3faeb073b0147dc5d))
|
|
12
|
+
* added function for tournament relation ([641d277](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/641d277a237c89123fc132d2ad1b11f370a86289))
|
|
13
|
+
* cleaned up events + tournaments ([bec627d](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/bec627dd40f1f90bc4be9008bb732fc49328adc3))
|
|
14
|
+
* code review fixes ([3ffe630](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/3ffe63056ac63af897e9f864ee379c44909d45f4))
|
|
15
|
+
* enable tracker without ssr ([f7a760b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/f7a760bd5c36b2531d097e2dffe9fa919c411e39))
|
|
16
|
+
* issue with country pages ([8624c15](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/8624c156e36f280a73411c0c7945e19db16d4c12))
|
|
17
|
+
* tests ([43cb61c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/43cb61cc1fa6cdd0c5b32ac1a87f02d23d5ba2e7))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
* Merge branch 'tm-5345-notifications' into 'master' ([614a25d](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/614a25df119584e09fbc47791f203be81ecb3e0b))
|
|
21
|
+
* Merge branch 'tm-5382-relation-cleanup' into 'master' ([0bc184b](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/0bc184b962dd3bc414825d6369ec5b9de320eb4f))
|
|
22
|
+
* Merge branch 'master' into tm-5345-notifications ([755446c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/755446c1b8e9bdcdf90d304475b71992332c47bd))
|
|
23
|
+
* Merge branch 'tm-5365-missing-slash' into 'master' ([15886f0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/15886f0bd823df30c5e6313448984c0f7ddfe094))
|
|
24
|
+
|
|
1
25
|
## [44.0.15](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.0.14...v44.0.15) (2025-04-14)
|
|
2
26
|
|
|
3
27
|
|
package/gatsby-node.mjs
CHANGED
|
@@ -474,7 +474,7 @@ export const createPages = async (
|
|
|
474
474
|
};
|
|
475
475
|
createPage({
|
|
476
476
|
path: trackerPath,
|
|
477
|
-
component: `${__dirname}/src/components
|
|
477
|
+
component: `${__dirname}/src/components/${process.env.IS_TRACKING_SSR === 'true' ? 'app-tracker-ssr.js' : 'app-tracker.js'}`,
|
|
478
478
|
context: {
|
|
479
479
|
page: trackerPageObject,
|
|
480
480
|
siteGeneralData,
|
package/package.json
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
2
|
+
/* eslint-disable react/forbid-prop-types */
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { useStaticQuery, graphql } from "gatsby";
|
|
5
|
+
import MainProvider from "~context/MainProvider";
|
|
6
|
+
import Tracker from "./pages/tracker/index-ssr";
|
|
7
|
+
import HeadData from "~organisms/head";
|
|
8
|
+
|
|
9
|
+
const AppTracker = (props) => {
|
|
10
|
+
const data = useStaticQuery(graphql`
|
|
11
|
+
query {
|
|
12
|
+
translations: allTranslation(filter: {}) {
|
|
13
|
+
edges {
|
|
14
|
+
node {
|
|
15
|
+
key
|
|
16
|
+
language
|
|
17
|
+
value
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
`);
|
|
23
|
+
|
|
24
|
+
const { pageContext } = props;
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<MainProvider
|
|
28
|
+
value={{ translations: data.translations, language: pageContext.page.language }}
|
|
29
|
+
>
|
|
30
|
+
<Tracker {...props} />
|
|
31
|
+
</MainProvider>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const Head = ({ pageContext }) => (
|
|
36
|
+
<HeadData page={pageContext.page} authors={pageContext.authors} siteInfo={pageContext.siteInfo} />
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
export default AppTracker;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render, screen } from "@testing-library/react";
|
|
3
|
+
import "@testing-library/jest-dom/extend-expect";
|
|
4
|
+
import AdminButtons from ".";
|
|
5
|
+
|
|
6
|
+
describe("AdminButtons Component", () => {
|
|
7
|
+
test("renders correct links for bonus module", () => {
|
|
8
|
+
const page = { id: 123 };
|
|
9
|
+
const module = {
|
|
10
|
+
name: "bonus",
|
|
11
|
+
value: {
|
|
12
|
+
operator_id: 45,
|
|
13
|
+
id: 999
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const modulePosition = 2;
|
|
17
|
+
|
|
18
|
+
// Set environment variable (override for test)
|
|
19
|
+
process.env.HERCULES_BACKEND_URL = 'https://hercules.g2m.com/';
|
|
20
|
+
|
|
21
|
+
render(<AdminButtons page={page} module={module} modulePosition={modulePosition} />);
|
|
22
|
+
|
|
23
|
+
// Test the first link (Edit Operator)
|
|
24
|
+
const editOperatorLink = screen.getByText("Edit Operator");
|
|
25
|
+
expect(editOperatorLink).toBeInTheDocument();
|
|
26
|
+
expect(editOperatorLink.closest('a')).toHaveAttribute(
|
|
27
|
+
'href',
|
|
28
|
+
'https://hercules.g2m.com/operators/45/sites-data/edit/999'
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
// Test the second link (Edit Module)
|
|
32
|
+
const editModuleLink = screen.getByText("Edit Module");
|
|
33
|
+
expect(editModuleLink).toBeInTheDocument();
|
|
34
|
+
expect(editModuleLink.closest('a')).toHaveAttribute(
|
|
35
|
+
'href',
|
|
36
|
+
'https://hercules.g2m.com/site-pages/123?index=2#sections'
|
|
37
|
+
);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test("returns null for unsupported module", () => {
|
|
41
|
+
const page = { id: 123 };
|
|
42
|
+
const module = {
|
|
43
|
+
name: "unknown_module"
|
|
44
|
+
};
|
|
45
|
+
const modulePosition = 0;
|
|
46
|
+
|
|
47
|
+
process.env.HERCULES_BACKEND_URL = 'https://hercules.g2m.com/';
|
|
48
|
+
|
|
49
|
+
render(<AdminButtons page={page} module={module} modulePosition={modulePosition} />);
|
|
50
|
+
|
|
51
|
+
// Should only render the Edit Module link
|
|
52
|
+
expect(screen.queryByText("Edit Operator")).not.toBeInTheDocument();
|
|
53
|
+
expect(screen.getByText("Edit Module")).toBeInTheDocument();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -2,7 +2,8 @@ import React, { useState, useContext, useEffect, useRef } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { toggleScroll } from 'gatsby-core-theme/src/helpers/scroll';
|
|
4
4
|
import { NavigationContext } from 'gatsby-core-theme/src/components/organisms/navigation/navigationContext';
|
|
5
|
-
import
|
|
5
|
+
import SpotlightItems from './notification-items/spotlight';
|
|
6
|
+
import CardsItems from './notification-items/cards-v2';
|
|
6
7
|
import BellIcon from '~images/icons/bell';
|
|
7
8
|
import styles from './notifications.module.scss';
|
|
8
9
|
|
|
@@ -13,7 +14,7 @@ const Notifications = ({ section }) => {
|
|
|
13
14
|
const [openNotification, setOpenNotification] = useState(false);
|
|
14
15
|
|
|
15
16
|
const { modules } = section || {};
|
|
16
|
-
const getNotifications = () => modules?.find((module) => module?.name === 'spotlights') || {};
|
|
17
|
+
const getNotifications = () => modules?.find((module) => module?.name === 'spotlights' || module?.name === 'cards_v2') || {};
|
|
17
18
|
|
|
18
19
|
const notificationActions = () => {
|
|
19
20
|
setNewNotification(false);
|
|
@@ -45,7 +46,7 @@ const Notifications = ({ section }) => {
|
|
|
45
46
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
46
47
|
};
|
|
47
48
|
}, [notificationRef]);
|
|
48
|
-
|
|
49
|
+
|
|
49
50
|
return (
|
|
50
51
|
<div ref={notificationRef} className={styles?.notificationOuter || ''}>
|
|
51
52
|
<div
|
|
@@ -61,8 +62,11 @@ const Notifications = ({ section }) => {
|
|
|
61
62
|
<BellIcon />
|
|
62
63
|
</div>
|
|
63
64
|
{openNotification && (
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
getNotifications()?.name === 'cards_v2' ?
|
|
66
|
+
<CardsItems module={getNotifications()} onClose={() => notificationActions()} /> :
|
|
67
|
+
<SpotlightItems module={getNotifications()} onClose={() => notificationActions()} />
|
|
68
|
+
)
|
|
69
|
+
}
|
|
66
70
|
</div>
|
|
67
71
|
);
|
|
68
72
|
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { imagePrettyUrl, getImageFilename, getAltText, getExtraField } from 'gatsby-core-theme/src/helpers/getters';
|
|
4
|
+
import LazyImage from 'gatsby-core-theme/src/hooks/lazy-image';
|
|
5
|
+
import keygen from 'gatsby-core-theme/src/helpers/keygen';
|
|
6
|
+
import Link from 'gatsby-core-theme/src/hooks/link';
|
|
7
|
+
import useTranslate from '~hooks/useTranslate/useTranslate';
|
|
8
|
+
import CloseIcon from '~images/icons/close';
|
|
9
|
+
import styles from './notification-items.module.scss';
|
|
10
|
+
|
|
11
|
+
const CardsItems = ({ module, onClose }) => {
|
|
12
|
+
const { items } = module;
|
|
13
|
+
const noNewUpdates = useTranslate('noNewUpdates', 'No new items');
|
|
14
|
+
|
|
15
|
+
const getTimeAgo = (dateString) => {
|
|
16
|
+
const date = new Date(dateString.replace(' ', 'T')); // Make it ISO-compliant
|
|
17
|
+
const now = new Date();
|
|
18
|
+
|
|
19
|
+
const diffMs = now.getTime() - date.getTime();
|
|
20
|
+
const diffMinutes = Math.floor(diffMs / (1000 * 60));
|
|
21
|
+
const diffHours = Math.floor(diffMinutes / 60);
|
|
22
|
+
const diffDays = Math.floor(diffHours / 24);
|
|
23
|
+
const diffMonths = Math.floor(diffDays / 30);
|
|
24
|
+
|
|
25
|
+
let timeAgo = '';
|
|
26
|
+
|
|
27
|
+
if (diffDays >= 32) {
|
|
28
|
+
timeAgo = `${diffMonths} month${diffMonths > 1 ? 's' : ''} ago`;
|
|
29
|
+
} else if (diffDays >= 1) {
|
|
30
|
+
timeAgo = `${diffDays} day${diffDays > 1 ? 's' : ''} ago`;
|
|
31
|
+
} else if (diffHours >= 1) {
|
|
32
|
+
timeAgo = `${diffHours} hour${diffHours > 1 ? 's' : ''} ago`;
|
|
33
|
+
} else {
|
|
34
|
+
timeAgo = `${diffMinutes} minute${diffMinutes !== 1 ? 's' : ''} ago`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return timeAgo;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const content = (item) => {
|
|
41
|
+
const img = getExtraField(item?.extra_fields, 'notification_image') || item?.relation?.logo?.filename || '';
|
|
42
|
+
const imageSrc = imagePrettyUrl(img, 40, 40);
|
|
43
|
+
const fileName = getImageFilename(imageSrc);
|
|
44
|
+
|
|
45
|
+
const TitleTag = item?.title_tag || 'label';
|
|
46
|
+
const ribbon = getExtraField(item?.extra_fields, 'notification_ribbon');
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div className={styles.notificationContent}>
|
|
52
|
+
{img && (
|
|
53
|
+
<LazyImage
|
|
54
|
+
width={40}
|
|
55
|
+
height={40}
|
|
56
|
+
alt={getAltText(item?.image_object, item?.label || item?.link_text || fileName)}
|
|
57
|
+
src={imageSrc}
|
|
58
|
+
/>
|
|
59
|
+
)}
|
|
60
|
+
<div className={styles.innerContent}>
|
|
61
|
+
{item?.title && <TitleTag>{item?.title}</TitleTag>}
|
|
62
|
+
{item?.description && (
|
|
63
|
+
<div className={styles.subtitle} dangerouslySetInnerHTML={{ __html: item?.description }} />
|
|
64
|
+
)}
|
|
65
|
+
{item?.template && (
|
|
66
|
+
<div className={styles.ribbonAndTime}>
|
|
67
|
+
{ribbon && <span className={styles.ribbon}>{ribbon}</span>}
|
|
68
|
+
<span className={styles.extraContent}>{getTimeAgo(item?.manual_updated_at || item?.updated_at || item?.manual_created_at || item?.created_at)}</span>
|
|
69
|
+
</div>
|
|
70
|
+
)}
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
return (
|
|
76
|
+
<div className={styles.container || ''}>
|
|
77
|
+
<div className={styles.notificationsContainer || ''}>
|
|
78
|
+
<span>
|
|
79
|
+
{useTranslate('latestUpdates', 'Latest Updates')}
|
|
80
|
+
<button
|
|
81
|
+
type='button'
|
|
82
|
+
onClick={onClose}
|
|
83
|
+
className={styles.close || ''}
|
|
84
|
+
aria-label="Close notifications"
|
|
85
|
+
>
|
|
86
|
+
<CloseIcon />
|
|
87
|
+
</button>
|
|
88
|
+
</span>
|
|
89
|
+
{items?.length ? (
|
|
90
|
+
<ul className={styles.notifications || ''}>
|
|
91
|
+
{items.map((item) => (
|
|
92
|
+
<li className={`${styles.notification} notification-item-gtm`} key={keygen()}>
|
|
93
|
+
<Link
|
|
94
|
+
to={item?.path}
|
|
95
|
+
title={item?.title}
|
|
96
|
+
className={`${styles.notificationLink} cards-gtm`}
|
|
97
|
+
aria-label={`${item?.title} Link`}
|
|
98
|
+
>
|
|
99
|
+
{content(item)}
|
|
100
|
+
</Link>
|
|
101
|
+
</li>
|
|
102
|
+
))}
|
|
103
|
+
</ul>
|
|
104
|
+
) : (
|
|
105
|
+
<>{noNewUpdates}</>
|
|
106
|
+
)}
|
|
107
|
+
</div>
|
|
108
|
+
<div className={styles.triangle} />
|
|
109
|
+
<div
|
|
110
|
+
className={styles.overlay}
|
|
111
|
+
onKeyDown={onClose}
|
|
112
|
+
onClick={onClose}
|
|
113
|
+
role="button"
|
|
114
|
+
aria-label="Notification Bell Icon"
|
|
115
|
+
tabIndex={0}
|
|
116
|
+
/>
|
|
117
|
+
</div>
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
CardsItems.propTypes = {
|
|
122
|
+
module: PropTypes.shape({
|
|
123
|
+
items: PropTypes.arrayOf(PropTypes.shape({}))
|
|
124
|
+
}),
|
|
125
|
+
onClose: PropTypes.func
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export default CardsItems;
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
position: relative;
|
|
3
|
+
position: fixed;
|
|
4
|
+
left: 0;
|
|
5
|
+
top: 7.6rem;
|
|
6
|
+
background: #fff;
|
|
7
|
+
|
|
8
|
+
@include min(tablet) {
|
|
9
|
+
left: auto;
|
|
10
|
+
top: calc(100% + 8px);
|
|
11
|
+
right: 3.8rem;
|
|
12
|
+
border-radius: 1rem;
|
|
13
|
+
box-shadow: 0 8px 8px -4px rgb(27 27 28 / 4%), 0 20px 24px -4px rgb(27 27 28 / 7%);
|
|
14
|
+
padding-bottom: 1px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@include min(tablet) {
|
|
18
|
+
position: absolute;
|
|
19
|
+
right: 0;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.notificationsContainer {
|
|
24
|
+
width: 100vw;
|
|
25
|
+
max-height: 58.4rem;
|
|
26
|
+
padding: 1.6rem 1.6rem 2.4rem;
|
|
27
|
+
|
|
28
|
+
@include flex-align(stretch, stretch);
|
|
29
|
+
@include flex-direction(column);
|
|
30
|
+
|
|
31
|
+
gap: 0.8rem;
|
|
32
|
+
transition: 0.5s ease-in;
|
|
33
|
+
overflow-y: hidden;
|
|
34
|
+
|
|
35
|
+
&::-webkit-scrollbar {
|
|
36
|
+
width: 4px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&::-webkit-scrollbar-track {
|
|
40
|
+
background: #e0e0e2;
|
|
41
|
+
|
|
42
|
+
@include min(tablet) {
|
|
43
|
+
border-radius: 0 10px 10px 0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&::-webkit-scrollbar-thumb {
|
|
48
|
+
background-color: #515156;
|
|
49
|
+
|
|
50
|
+
@include min(tablet) {
|
|
51
|
+
border-radius: 0 10px 10px 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@include min(tablet) {
|
|
56
|
+
border-radius: 4px;
|
|
57
|
+
padding: 1.6rem;
|
|
58
|
+
font-size: 1rem;
|
|
59
|
+
z-index: 100;
|
|
60
|
+
white-space: wrap;
|
|
61
|
+
max-width: 40.6rem;
|
|
62
|
+
width: 40.6rem;
|
|
63
|
+
max-height: 60rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
span {
|
|
67
|
+
font-size: 1.8rem;
|
|
68
|
+
font-weight: 600;
|
|
69
|
+
color: #1b1b1c;
|
|
70
|
+
line-height: 2.8rem;
|
|
71
|
+
margin: 0;
|
|
72
|
+
height: 3.2rem;
|
|
73
|
+
|
|
74
|
+
@include flex-align(center, space-between);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.notifications {
|
|
79
|
+
@include flex-align(stretch, flex-start);
|
|
80
|
+
@include flex-direction(column);
|
|
81
|
+
|
|
82
|
+
gap: 0.8rem;
|
|
83
|
+
overflow-y: auto;
|
|
84
|
+
|
|
85
|
+
&::-webkit-scrollbar {
|
|
86
|
+
width: 4px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&::-webkit-scrollbar-track {
|
|
90
|
+
background: #e0e0e2;
|
|
91
|
+
border-radius: 1rem;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&::-webkit-scrollbar-thumb {
|
|
95
|
+
background-color: #515156;
|
|
96
|
+
border-radius: 1rem;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@include min(tablet) {
|
|
100
|
+
max-height: 50.4rem;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.close {
|
|
105
|
+
align-self: flex-start;
|
|
106
|
+
padding-right: 1.6rem;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.triangle {
|
|
110
|
+
@include min(tablet) {
|
|
111
|
+
display: block;
|
|
112
|
+
position: absolute;
|
|
113
|
+
bottom: 99%;
|
|
114
|
+
left: 50%;
|
|
115
|
+
margin-top: -9px;
|
|
116
|
+
background-color: #fff;
|
|
117
|
+
width: 20px;
|
|
118
|
+
height: 20px;
|
|
119
|
+
border-top-right-radius: 5px;
|
|
120
|
+
transform: rotate(300deg) skewX(-30deg) scale(1, 0.866);
|
|
121
|
+
z-index: -1;
|
|
122
|
+
|
|
123
|
+
&::before,
|
|
124
|
+
&::after {
|
|
125
|
+
content: '';
|
|
126
|
+
position: absolute;
|
|
127
|
+
background-color: inherit;
|
|
128
|
+
width: 20px;
|
|
129
|
+
height: 20px;
|
|
130
|
+
border-top-right-radius: 5px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&::before {
|
|
134
|
+
transform: rotate(-135deg) skewX(-45deg) scale(1.414, 0.707) translate(0, -50%);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&::after {
|
|
138
|
+
transform: rotate(135deg) skewY(-45deg) scale(0.707, 1.414) translate(50%);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.notification {
|
|
144
|
+
border-radius: 8px;
|
|
145
|
+
background: #f4f4f4;
|
|
146
|
+
gap: 0 0.8rem;
|
|
147
|
+
position: relative;
|
|
148
|
+
border: 1px solid transparent;
|
|
149
|
+
|
|
150
|
+
&:hover {
|
|
151
|
+
border-color: var(--primary-button-color, #6e33e5);
|
|
152
|
+
background-color: #fbfaf9;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&::after {
|
|
156
|
+
display: block;
|
|
157
|
+
content: '';
|
|
158
|
+
width: 6px;
|
|
159
|
+
height: 6px;
|
|
160
|
+
position: absolute;
|
|
161
|
+
right: 1.6rem;
|
|
162
|
+
top: 50%;
|
|
163
|
+
transform: translateY(-50%);
|
|
164
|
+
background-color: var(--primary-button-color, #6e33e5);
|
|
165
|
+
border-radius: 100%;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.notificationLink{
|
|
170
|
+
padding: 1.2rem;
|
|
171
|
+
width: 100%;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.overlay {
|
|
175
|
+
position: fixed;
|
|
176
|
+
width: 100vw;
|
|
177
|
+
height: calc(100vh);
|
|
178
|
+
z-index: -1;
|
|
179
|
+
opacity: 0.45;
|
|
180
|
+
background: #0a0e19;
|
|
181
|
+
|
|
182
|
+
@include min(tablet) {
|
|
183
|
+
display: none;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.notificationContent {
|
|
188
|
+
@include flex-align(stretch, stretch);
|
|
189
|
+
@include flex-direction(row);
|
|
190
|
+
|
|
191
|
+
column-gap: 0.8rem;
|
|
192
|
+
|
|
193
|
+
img {
|
|
194
|
+
width: 4rem;
|
|
195
|
+
height: 4rem;
|
|
196
|
+
grid-row: 1 / span 2;
|
|
197
|
+
border-radius: 4px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
h2,
|
|
201
|
+
h3,
|
|
202
|
+
h4,
|
|
203
|
+
h5,
|
|
204
|
+
label {
|
|
205
|
+
color: #1b1b1c;
|
|
206
|
+
font-size: 1.4rem;
|
|
207
|
+
font-weight: 600;
|
|
208
|
+
line-height: 2.2rem;
|
|
209
|
+
margin: 0;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
> div {
|
|
213
|
+
color: #f4f4f4;
|
|
214
|
+
font-size: 1.2rem;
|
|
215
|
+
font-weight: 400;
|
|
216
|
+
line-height: 1.8rem;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.innerContent{
|
|
221
|
+
@include flex-direction(column);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.subtitle {
|
|
225
|
+
margin-bottom: 0.8rem;
|
|
226
|
+
grid-column: 2;
|
|
227
|
+
|
|
228
|
+
> p {
|
|
229
|
+
width: 26rem;
|
|
230
|
+
white-space: nowrap;
|
|
231
|
+
overflow: hidden;
|
|
232
|
+
text-overflow: ellipsis;
|
|
233
|
+
color: rgb(81 81 86);
|
|
234
|
+
-webkit-line-clamp: 2;
|
|
235
|
+
line-clamp: 2;
|
|
236
|
+
|
|
237
|
+
@include max(mobile-m) {
|
|
238
|
+
width: 20rem;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.ribbonAndTime {
|
|
244
|
+
@include flex-align(center, flex-start);
|
|
245
|
+
|
|
246
|
+
gap: 0.5rem;
|
|
247
|
+
font-weight: 500;
|
|
248
|
+
grid-column: 2;
|
|
249
|
+
height: 1.9rem;
|
|
250
|
+
|
|
251
|
+
.ribbon {
|
|
252
|
+
border-radius: 100px;
|
|
253
|
+
background: var(--primary-button-color, #6e33e5);
|
|
254
|
+
padding: 4px 8px;
|
|
255
|
+
|
|
256
|
+
@include flex-align(center, center);
|
|
257
|
+
|
|
258
|
+
color: #fff;
|
|
259
|
+
text-align: center;
|
|
260
|
+
font-size: 0.9rem;
|
|
261
|
+
font-weight: 700;
|
|
262
|
+
line-height: 1.1rem;
|
|
263
|
+
letter-spacing: 0.5px;
|
|
264
|
+
text-transform: uppercase;
|
|
265
|
+
height: 1.9rem;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.extraContent{
|
|
269
|
+
background: transparent;
|
|
270
|
+
color: #64646D;
|
|
271
|
+
font-size: 1.2rem;
|
|
272
|
+
font-weight: 500;
|
|
273
|
+
line-height: 1.8rem;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
package/src/components/atoms/notifications/notification-items/{index.js → spotlight/index.js}
RENAMED
|
@@ -8,7 +8,7 @@ import useTranslate from '~hooks/useTranslate/useTranslate';
|
|
|
8
8
|
import CloseIcon from '~images/icons/close';
|
|
9
9
|
import styles from './notification-items.module.scss';
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const SpotlightItems = ({ module, onClose }) => {
|
|
12
12
|
const { items } = module;
|
|
13
13
|
const noNewUpdates = useTranslate('noNewUpdates', 'No new items')
|
|
14
14
|
const content = (item) => {
|
|
@@ -102,11 +102,11 @@ const NotificationItems = ({ module, onClose }) => {
|
|
|
102
102
|
);
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
SpotlightItems.propTypes = {
|
|
106
106
|
module: PropTypes.shape({
|
|
107
107
|
items: PropTypes.arrayOf(PropTypes.shape({}))
|
|
108
108
|
}),
|
|
109
109
|
onClose: PropTypes.func
|
|
110
110
|
};
|
|
111
111
|
|
|
112
|
-
export default
|
|
112
|
+
export default SpotlightItems;
|