Merge pull request #13009 from overleaf/ii-history-react-sticky-date-headings

[web] Improve the sticky date headings

GitOrigin-RevId: 0ba4c4d589b01d250198ecf97f7937200d393fe2
This commit is contained in:
ilkin-overleaf 2023-05-12 12:19:18 +03:00 committed by Copybot
parent 32160a8c80
commit a94f241dcb
2 changed files with 7 additions and 6 deletions

View file

@ -4,6 +4,7 @@ import HistoryVersion from './history-version'
import LoadingSpinner from '../../../../shared/components/loading-spinner'
import { OwnerPaywallPrompt } from './owner-paywall-prompt'
import { NonOwnerPaywallPrompt } from './non-owner-paywall-prompt'
import { relativeDate } from '../../../utils/format-date'
function AllHistoryList() {
const { updatesInfo, fetchNextBatchOfUpdates, currentUserIsOwner } =
@ -77,6 +78,11 @@ function AllHistoryList() {
{update.meta.first_in_day && index > 0 && (
<hr className="history-version-divider" />
)}
{update.meta.first_in_day && (
<time className="history-version-day">
{relativeDate(update.meta.end_ts)}
</time>
)}
<HistoryVersion
update={update}
faded={

View file

@ -7,7 +7,7 @@ import HistoryVersionDropdown from './dropdown/history-version-dropdown'
import { useUserContext } from '../../../../shared/context/user-context'
import { useHistoryContext } from '../../context/history-context'
import { isVersionSelected } from '../../utils/history-details'
import { relativeDate, formatTime } from '../../../utils/format-date'
import { formatTime } from '../../../utils/format-date'
import { orderBy } from 'lodash'
import { LoadedUpdate } from '../../services/types/update'
import classNames from 'classnames'
@ -31,11 +31,6 @@ function HistoryVersion({ update, faded }: HistoryEntryProps) {
'history-version-faded': faded,
})}
>
{update.meta.first_in_day && (
<time className="history-version-day">
{relativeDate(update.meta.end_ts)}
</time>
)}
<HistoryVersionDetails
fromV={update.fromV}
toV={update.toV}