-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
43 additions
and
17 deletions.
There are no files selected for viewing
10 changes: 0 additions & 10 deletions
10
apps/HashRateGame/src/app/(telegram)/app/(main)/mining/_components/Condition.tsx
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
apps/HashRateGame/src/app/(telegram)/app/(main)/mining/_components/Information.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import addSuffixToNumber from '../../../../../../utils/addSuffixToNumber.util' | ||
|
||
export default function Information() { | ||
return ( | ||
<div className="flex flex-col font-extralight"> | ||
<div className="px-4 opacity-50">Information</div> | ||
<div className="bg-surface-container-l2 p-4 rounded-md text-sm grid grid-cols-2 gap-2 "> | ||
<div className="flex flex-row gap-2 col-span-2 items-center"> | ||
<div className="opacity-80">Complexity</div> | ||
<div className="text-nowrap">{addSuffixToNumber(1647, 2)}</div> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
apps/HashRateGame/src/app/(telegram)/app/(main)/mining/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import Condition from './_components/Condition' | ||
import Information from './_components/Information' | ||
import Profile from './_components/Profile' | ||
|
||
export default function Page() { | ||
return ( | ||
<div className="flex flex-col gap-2"> | ||
<Profile /> | ||
<Condition /> | ||
<Information /> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export default function addSuffixToNumber( | ||
number: number, | ||
float: number = 3, | ||
): string { | ||
const suffixes = ['', 'K', 'M', 'B', 'T', 'Q', 'S', 'O', 'N', 'D', 'U', 'D'] | ||
let suffixIndex = 0 | ||
|
||
while (number >= 1000 && suffixIndex < suffixes.length - 1) { | ||
number /= 1000 | ||
suffixIndex++ | ||
} | ||
|
||
if (number % 1 !== 0) { | ||
return `${number.toFixed(float)}${suffixes[suffixIndex]}` | ||
} else { | ||
return `${number.toFixed(0)}${suffixes[suffixIndex]}` | ||
} | ||
} |