File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ function LastOnline(props: { lastOnlineTime?: string }) {
292292 return (
293293 < AboutRow
294294 icon = { < ClockIcon className = "h-5 w-5" /> }
295- text = { 'Last online ' + fromNow ( lastOnlineTime ) }
295+ text = { 'Last online ' + fromNow ( lastOnlineTime , true ) }
296296 />
297297 )
298298}
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ import {Col} from 'web/components/layout/col'
99import { Row } from 'web/components/layout/row'
1010import { SendMessageButton } from 'web/components/messaging/send-message-button'
1111import ProfilePrimaryInfo from './profile-primary-info'
12- import { OnlineIcon } from '../online-icon'
1312import { track } from 'web/lib/service/analytics'
1413import DropdownMenu from 'web/components/comments/dropdown-menu'
1514import { ShareProfileButton } from '../widgets/share-profile-button'
@@ -58,7 +57,7 @@ export default function ProfileHeader(props: {
5857 { currentUser && isCurrentUser && disabled &&
5958 < div className = "text-red-500" > You disabled your profile, so no one else can access it.</ div > }
6059 < Row className = "items-center gap-1 text-xl" >
61- { ! isCurrentUser && < OnlineIcon last_online_time = { userActivity ?. last_online_time } /> }
60+ { /*{ !isCurrentUser && <OnlineIcon last_online_time={userActivity?.last_online_time}/> }*/ }
6261 < span >
6362 { simpleView ? (
6463 < Link className = { linkClass } href = { `/${ user . username } ` } >
Original file line number Diff line number Diff line change @@ -3,8 +3,12 @@ import relativeTime from 'dayjs/plugin/relativeTime'
33
44dayjs . extend ( relativeTime )
55
6- export function fromNow ( time : number | string | Date ) {
7- return dayjs ( time ) . fromNow ( )
6+ export function fromNow ( time : number | string | Date , privacy : boolean = false ) {
7+ const date = dayjs ( time ) ;
8+ if ( privacy && dayjs ( ) . diff ( date , 'hour' ) < 24 ) {
9+ return 'in the past day' ;
10+ }
11+ return date . fromNow ( ) ;
812}
913
1014const FORMATTER = new Intl . DateTimeFormat ( 'default' , {
You can’t perform that action at this time.
0 commit comments