File tree Expand file tree Collapse file tree 2 files changed +4
-20
lines changed
Expand file tree Collapse file tree 2 files changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import Icon from "../ui/icon/Icon";
1515import { Notice } from "../ui/Notice/Notice" ;
1616import Text from "../ui/Text" ;
1717import { Banner } from "../ui/Banner" ;
18- import { getDaysAgo , timeSince } from "@/common/date" ;
18+ import { timeSince } from "@/common/date" ;
1919import { toast , useCustomPortal } from "../ui/custom-portal/CustomPortal" ;
2020import { Skeleton } from "../ui/skeleton/Skeleton" ;
2121import { classNames , cn } from "@/common/classNames" ;
@@ -352,12 +352,6 @@ function PublicItem(props: {
352352 ) ) ;
353353 } ;
354354
355- const bumpedUnder24Hours = ( ) => {
356- const millisecondsSinceLastBump =
357- new Date ( ) . getTime ( ) - props . item . bumpedAt ;
358- return millisecondsSinceLastBump < 24 * 60 * 60 * 1000 ;
359- } ;
360-
361355 return (
362356 < ServerItemContainer
363357 class = { classNames (
@@ -434,9 +428,7 @@ function PublicItem(props: {
434428 < Icon name = "schedule" size = { 17 } color = "var(--primary-color)" />
435429 < Text size = { 14 } >
436430 { t ( "explore.bumped" ) } { " " }
437- { ( bumpedUnder24Hours ( ) ? timeSince : getDaysAgo ) (
438- props . item . bumpedAt
439- ) }
431+ { timeSince ( props . item . bumpedAt , false ) }
440432 </ Text >
441433 </ FlexRow >
442434 </ MemberContainer >
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import Icon from "../ui/icon/Icon";
1717import { Notice } from "../ui/Notice/Notice" ;
1818import Text from "../ui/Text" ;
1919import { Banner } from "../ui/Banner" ;
20- import { getDaysAgo , timeSince } from "@/common/date" ;
20+ import { timeSince } from "@/common/date" ;
2121import { toast , useCustomPortal } from "../ui/custom-portal/CustomPortal" ;
2222import LegacyModal from "../ui/legacy-modal/LegacyModal" ;
2323import { Turnstile , TurnstileRef } from "@nerimity/solid-turnstile" ;
@@ -411,12 +411,6 @@ function PublicServerItem(props: {
411411 ) ) ;
412412 } ;
413413
414- const bumpedUnder24Hours = ( ) => {
415- const millisecondsSinceLastBump =
416- new Date ( ) . getTime ( ) - props . publicServer . bumpedAt ;
417- return millisecondsSinceLastBump < 24 * 60 * 60 * 1000 ;
418- } ;
419-
420414 return (
421415 < ServerItemContainer
422416 class = { classNames (
@@ -497,9 +491,7 @@ function PublicServerItem(props: {
497491 < Icon name = "schedule" size = { 17 } color = "var(--primary-color)" />
498492 < Text size = { 14 } >
499493 { t ( "explore.bumped" ) } { " " }
500- { ( bumpedUnder24Hours ( ) ? timeSince : getDaysAgo ) (
501- props . publicServer . bumpedAt ,
502- ) }
494+ { timeSince ( props . publicServer . bumpedAt , false ) }
503495 </ Text >
504496 </ FlexRow >
505497 </ MemberContainer >
You can’t perform that action at this time.
0 commit comments