Tweaks to floating date header fading
This commit is contained in:
parent
a34291f9dc
commit
bd41bdf3cb
3 changed files with 28 additions and 18 deletions
|
@ -9,6 +9,7 @@
|
|||
pointer-events: none;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
transition: opacity 0.25s ease-out;
|
||||
width: 100%;
|
||||
z-index: $z-index-above-base;
|
||||
|
||||
|
@ -18,7 +19,6 @@
|
|||
|
||||
&--hidden {
|
||||
opacity: 0;
|
||||
transition: opacity 0.25s ease-out;
|
||||
}
|
||||
|
||||
&__spinner-container {
|
||||
|
|
|
@ -501,7 +501,7 @@ export class Timeline extends React.PureComponent<PropsType, StateType> {
|
|||
}
|
||||
this.hasRecentlyScrolledTimeout = setTimeout(() => {
|
||||
this.setState({ hasRecentlyScrolled: false });
|
||||
}, 1000);
|
||||
}, 3000);
|
||||
|
||||
this.updateScrollMetrics(data);
|
||||
this.updateWithVisibleRows();
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
import classNames from 'classnames';
|
||||
import type { CSSProperties, ReactElement } from 'react';
|
||||
import React from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import type { LocalizerType } from '../../types/Util';
|
||||
import { TimelineDateHeader } from './TimelineDateHeader';
|
||||
import { Spinner } from '../Spinner';
|
||||
|
@ -20,24 +20,34 @@ export const TimelineFloatingHeader = ({
|
|||
style?: CSSProperties;
|
||||
timestamp: number;
|
||||
visible: boolean;
|
||||
}>): ReactElement => (
|
||||
<div
|
||||
className={classNames(
|
||||
'TimelineFloatingHeader',
|
||||
`TimelineFloatingHeader--${visible ? 'visible' : 'hidden'}`
|
||||
)}
|
||||
style={style}
|
||||
>
|
||||
<TimelineDateHeader floating i18n={i18n} timestamp={timestamp} />
|
||||
}>): ReactElement => {
|
||||
const [hasRendered, setHasRendered] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setHasRendered(true);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={classNames(
|
||||
'TimelineFloatingHeader__spinner-container',
|
||||
`TimelineFloatingHeader__spinner-container--${
|
||||
isLoading ? 'visible' : 'hidden'
|
||||
'TimelineFloatingHeader',
|
||||
`TimelineFloatingHeader--${
|
||||
visible && hasRendered ? 'visible' : 'hidden'
|
||||
}`
|
||||
)}
|
||||
style={style}
|
||||
>
|
||||
<Spinner direction="on-background" size="20px" svgSize="small" />
|
||||
<TimelineDateHeader floating i18n={i18n} timestamp={timestamp} />
|
||||
<div
|
||||
className={classNames(
|
||||
'TimelineFloatingHeader__spinner-container',
|
||||
`TimelineFloatingHeader__spinner-container--${
|
||||
isLoading ? 'visible' : 'hidden'
|
||||
}`
|
||||
)}
|
||||
>
|
||||
<Spinner direction="on-background" size="20px" svgSize="small" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue