Skip to content

Commit c9f0d5e

Browse files
committed
made changes to add greyed link colour - #6E6E73
1 parent 515b8ef commit c9f0d5e

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

src/app/components/MostRead/Canonical/Item/index.styles.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ const styles = {
4848
padding: 0,
4949
}),
5050

51+
visitedItem: () =>
52+
css({
53+
'&:visited': {
54+
color: '#6E6E73 !important',
55+
},
56+
// current article"
57+
'&.is-current': {
58+
color: '#6E6E73 !important',
59+
},
60+
}),
61+
5162
grid: ({ spacings }: Theme) =>
5263
css({
5364
position: 'relative',

src/app/components/MostRead/Canonical/Item/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ export const MostReadLink = ({
5050
const positionIndex =
5151
typeof position === 'string' ? parseInt(position, 10) : position;
5252

53+
const isCurrentPage =
54+
typeof window !== 'undefined' && href.includes(window.location.pathname);
55+
5356
const eventTrackingDataExtended = {
5457
...eventTrackingData,
5558
itemTracker: {
@@ -67,7 +70,12 @@ export const MostReadLink = ({
6770
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6871
<div css={getItemCss({ dir, size }) as any[]} dir={dir}>
6972
<a
70-
css={[styles.link, size === 'default' && styles.defaultLink]}
73+
css={[
74+
styles.link,
75+
size === 'default' && styles.defaultLink,
76+
styles.visitedItem(),
77+
isCurrentPage && styles.visitedItem(),
78+
]}
7179
href={href}
7280
{...clickTrackerHandler}
7381
>

0 commit comments

Comments
 (0)