refs #4655 Go to top when clicking timeline title
This commit is contained in:
parent
446005dafe
commit
000e289812
|
@ -173,11 +173,18 @@ export default function Notifications(props: Props) {
|
||||||
return 'timeline'
|
return 'timeline'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const backToTop = () => {
|
||||||
|
scrollerRef.current.scrollTo({
|
||||||
|
top: 0,
|
||||||
|
behavior: 'smooth'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex timeline-wrapper">
|
<div className="flex timeline-wrapper">
|
||||||
<section className={`h-full ${timelineClass()}`}>
|
<section className={`h-full ${timelineClass()}`}>
|
||||||
<div className="w-full bg-blue-950 text-blue-100 p-2 flex justify-between">
|
<div className="w-full bg-blue-950 text-blue-100 p-2 flex justify-between">
|
||||||
<div className="text-lg font-bold">
|
<div className="text-lg font-bold cursor-pointer" onClick={() => backToTop()}>
|
||||||
<FormattedMessage id="timeline.notifications" />
|
<FormattedMessage id="timeline.notifications" />
|
||||||
</div>
|
</div>
|
||||||
<div className="w-64 text-xs text-right">
|
<div className="w-64 text-xs text-right">
|
||||||
|
|
|
@ -204,11 +204,18 @@ export default function Timeline(props: Props) {
|
||||||
return 'timeline'
|
return 'timeline'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const backToTop = () => {
|
||||||
|
scrollerRef.current.scrollTo({
|
||||||
|
top: 0,
|
||||||
|
behavior: 'smooth'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex timeline-wrapper">
|
<div className="flex timeline-wrapper">
|
||||||
<section className={`h-full ${timelineClass()}`}>
|
<section className={`h-full ${timelineClass()}`}>
|
||||||
<div className="w-full bg-blue-950 text-blue-100 p-2 flex justify-between">
|
<div className="w-full bg-blue-950 text-blue-100 p-2 flex justify-between">
|
||||||
<div className="text-lg font-bold">
|
<div className="text-lg font-bold cursor-pointer" onClick={() => backToTop()}>
|
||||||
{props.timeline.match(/list_(\d+)/) ? <>{list && list.title}</> : <FormattedMessage id={`timeline.${props.timeline}`} />}
|
{props.timeline.match(/list_(\d+)/) ? <>{list && list.title}</> : <FormattedMessage id={`timeline.${props.timeline}`} />}
|
||||||
</div>
|
</div>
|
||||||
<div className="w-64 text-xs">
|
<div className="w-64 text-xs">
|
||||||
|
|
Loading…
Reference in New Issue