diff --git a/src/pages/notifications.css b/src/pages/notifications.css index fdcc76aa..b948ae83 100644 --- a/src/pages/notifications.css +++ b/src/pages/notifications.css @@ -2,6 +2,36 @@ .notification { content-visibility: auto; } + + .timeline-header { + position: sticky; + --mask-padding: 8px; + top: calc(48px - var(--mask-padding)); + transition: top 0.5s ease-in-out; + header[hidden] ~ & { + top: calc(-1 * var(--mask-padding)); + } + z-index: 1; + background-color: inherit; + mask-image: linear-gradient( + to bottom, + transparent, + #000 var(--mask-padding) calc(100% - var(--mask-padding) * 2), + transparent + ); + + @media (min-width: 40em) { + background-color: var(--bg-faded-color); + } + padding-block: 16px; + margin: 0; + opacity: 1; + + small { + font-weight: normal; + font-size: var(--text-size); + } + } } .notification { diff --git a/src/pages/notifications.jsx b/src/pages/notifications.jsx index 96d9e048..06fbb5db 100644 --- a/src/pages/notifications.jsx +++ b/src/pages/notifications.jsx @@ -4,7 +4,13 @@ import { msg, Plural, t, Trans } from '@lingui/macro'; import { useLingui } from '@lingui/react'; import { Fragment } from 'preact'; import { memo } from 'preact/compat'; -import { useCallback, useEffect, useRef, useState } from 'preact/hooks'; +import { + useCallback, + useEffect, + useMemo, + useRef, + useState, +} from 'preact/hooks'; import { useHotkeys } from 'react-hotkeys-hook'; import { InView } from 'react-intersection-observer'; import { useSearchParams } from 'react-router-dom'; @@ -471,6 +477,15 @@ function Notifications({ columnMode }) { } }); + const today = new Date(); + const todaySubHeading = useMemo(() => { + return niceDateTime(today, { + forceOpts: { + weekday: 'long', + }, + }); + }, [today]); + return (
@@ -757,9 +773,21 @@ function Notifications({ columnMode }) {
: niceDateTime(currentDay, {
hideTime: true,
});
+ const subHeading = niceDateTime(currentDay, {
+ forceOpts: {
+ weekday: 'long',
+ },
+ });
return (
{heading}
}
+ {differentDay && (
+
+ {heading}{' '}
+
+ {subHeading}
+
+
+ )}