File tree Expand file tree Collapse file tree
src/app/components/MostRead/Canonical/Item Expand file tree Collapse file tree Original file line number Diff line number Diff 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' ,
Original file line number Diff line number Diff 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 >
You can’t perform that action at this time.
0 commit comments