diff --git a/packages/cyberstorm/src/components/Layout/PackageDetailLayout/PackageDetailLayout.tsx b/packages/cyberstorm/src/components/Layout/PackageDetailLayout/PackageDetailLayout.tsx index a49851909..fc807fe73 100644 --- a/packages/cyberstorm/src/components/Layout/PackageDetailLayout/PackageDetailLayout.tsx +++ b/packages/cyberstorm/src/components/Layout/PackageDetailLayout/PackageDetailLayout.tsx @@ -28,7 +28,7 @@ import { import { faUsers } from "@fortawesome/pro-regular-svg-icons"; import { PackageDependencyList } from "./PackageDependencyList/PackageDependencyList"; import { CopyButton } from "../../CopyButton/CopyButton"; -import { bankersRound, formatInteger } from "../../../utils/utils"; +import { formatFileSize, formatInteger } from "../../../utils/utils"; import { useState } from "react"; import { Tabs } from "../../Tabs/Tabs"; import { PackageChangeLog } from "./PackageChangeLog/PackageChangeLog"; @@ -309,7 +309,7 @@ function getMetaInfoData(packageData: Package) { { key: "5", label: "Size", - content: <>{`${bankersRound(packageData.size / 1000, 1)} MB`}>, + content: <>{formatFileSize(packageData.size)}>, }, { key: "6", diff --git a/packages/cyberstorm/src/components/Layout/PackageDetailLayout/PackageTagList/PackageTagList.tsx b/packages/cyberstorm/src/components/Layout/PackageDetailLayout/PackageTagList/PackageTagList.tsx index f2cef66d0..2762f3379 100644 --- a/packages/cyberstorm/src/components/Layout/PackageDetailLayout/PackageTagList/PackageTagList.tsx +++ b/packages/cyberstorm/src/components/Layout/PackageDetailLayout/PackageTagList/PackageTagList.tsx @@ -10,7 +10,6 @@ import { faLips, faSparkles, } from "@fortawesome/pro-solid-svg-icons"; -import { bankersRound } from "../../../../utils/utils"; import { ReactNode } from "react"; export interface PackageTagListProps { @@ -36,9 +35,8 @@ export function PackageTagList(props: PackageTagListProps) { PackageTagList.displayName = "PackageTagList"; function getPackageFlags(packageData: Package) { - const updateTimeDelta = bankersRound( - (Date.now() - Date.parse(packageData.lastUpdated)) / 86400000, - 0 + const updateTimeDelta = Math.round( + (Date.now() - Date.parse(packageData.lastUpdated)) / 86400000 ); const isNew = updateTimeDelta < 3; if ( diff --git a/packages/cyberstorm/src/components/PackageCard/PackageCard.tsx b/packages/cyberstorm/src/components/PackageCard/PackageCard.tsx index f48cc4307..031f793ca 100644 --- a/packages/cyberstorm/src/components/PackageCard/PackageCard.tsx +++ b/packages/cyberstorm/src/components/PackageCard/PackageCard.tsx @@ -10,7 +10,7 @@ import { faWarning, } from "@fortawesome/free-solid-svg-icons"; import { Tag } from "../Tag/Tag"; -import { bankersRound, classnames, formatInteger } from "../../utils/utils"; +import { classnames, formatInteger } from "../../utils/utils"; import { PackagePreview } from "@thunderstore/dapper/types"; import { PackageLink, UserLink } from "../Links/Links"; import { faLips, faSparkles } from "@fortawesome/pro-solid-svg-icons"; @@ -101,9 +101,8 @@ const getStyle = (scheme: PackageCardProps["colorScheme"] = "default") => { }; function getPackageFlags(packageData: PackagePreview) { - const updateTimeDelta = bankersRound( - (Date.now() - Date.parse(packageData.lastUpdated)) / 86400000, - 0 + const updateTimeDelta = Math.round( + (Date.now() - Date.parse(packageData.lastUpdated)) / 86400000 ); const isNew = updateTimeDelta < 3; if ( @@ -159,9 +158,8 @@ function getPackageFlags(packageData: PackagePreview) { } function getMetaItemList(packageData: PackagePreview) { - const updateTimeDelta = bankersRound( - (Date.now() - Date.parse(packageData.lastUpdated)) / 86400000, - 0 + const updateTimeDelta = Math.round( + (Date.now() - Date.parse(packageData.lastUpdated)) / 86400000 ); return (