From cc7c74f63c8335b933862f42b8bb5c3d51c0233a Mon Sep 17 00:00:00 2001 From: Takeshi Umeda Date: Mon, 30 Dec 2019 00:59:25 +0900 Subject: [PATCH] [Glitch] Fix shortNumberFormat to within 3 chars without units Port ed1226c8c86137ce10daf35af76e00dd5f39b8a0 to glitch-soc Signed-off-by: Thibaut Girka --- .../flavours/glitch/styles/components/accounts.scss | 4 ++-- app/javascript/flavours/glitch/util/numbers.js | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/javascript/flavours/glitch/styles/components/accounts.scss b/app/javascript/flavours/glitch/styles/components/accounts.scss index 5be4da48a8..6305e2a4d0 100644 --- a/app/javascript/flavours/glitch/styles/components/accounts.scss +++ b/app/javascript/flavours/glitch/styles/components/accounts.scss @@ -681,13 +681,13 @@ &__links { font-size: 14px; color: $darker-text-color; + padding: 10px 0; a { display: inline-block; color: $darker-text-color; text-decoration: none; - padding: 10px; - padding-top: 20px; + padding: 5px 10px; font-weight: 500; strong { diff --git a/app/javascript/flavours/glitch/util/numbers.js b/app/javascript/flavours/glitch/util/numbers.js index f7e4ceb935..af18dcfddb 100644 --- a/app/javascript/flavours/glitch/util/numbers.js +++ b/app/javascript/flavours/glitch/util/numbers.js @@ -4,9 +4,13 @@ import { FormattedNumber } from 'react-intl'; export const shortNumberFormat = number => { if (number < 1000) { return ; - } else if (number < 1000000) { + } else if (number < 10000) { return K; - } else { + } else if (number < 1000000) { + return K; + } else if (number < 10000000) { return M; + } else { + return M; } };