From 58c2c1bf91aee5268686ed2b304fe235c5b62fc1 Mon Sep 17 00:00:00 2001 From: Nick Grato Date: Mon, 27 Nov 2023 13:45:05 -0800 Subject: [PATCH] adding warning --- client/classes/Hub.tsx | 8 +++++++ .../SidePanelLayout.module.scss | 4 +--- .../SidePanelLayout/SidePanelLayout.tsx | 23 +++++++++++-------- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/client/classes/Hub.tsx b/client/classes/Hub.tsx index 6e6c2253..ca6a572c 100644 --- a/client/classes/Hub.tsx +++ b/client/classes/Hub.tsx @@ -82,6 +82,14 @@ export default class Hub { return Math.min(100, this.currentStorageMb / this.storageLimitMb) * 100; } + /** + * Check if user has gone over storage max + * @returns Boolean + */ + hasReachedMaxStorage(): boolean { + return this.storageLimitMb < Number(this.currentStorageMb); + } + /** * Storage State * @returns StorageStateE diff --git a/client/layouts/SidePanelLayout/SidePanelLayout.module.scss b/client/layouts/SidePanelLayout/SidePanelLayout.module.scss index 7ada796f..cb36dce2 100644 --- a/client/layouts/SidePanelLayout/SidePanelLayout.module.scss +++ b/client/layouts/SidePanelLayout/SidePanelLayout.module.scss @@ -42,8 +42,6 @@ .warning { max-width: 1200px; + width: 100%; margin-bottom: 24px; - @include tablet-down { - max-width: 100%; - } } diff --git a/client/layouts/SidePanelLayout/SidePanelLayout.tsx b/client/layouts/SidePanelLayout/SidePanelLayout.tsx index 5ae7e38b..0b5a0813 100644 --- a/client/layouts/SidePanelLayout/SidePanelLayout.tsx +++ b/client/layouts/SidePanelLayout/SidePanelLayout.tsx @@ -28,17 +28,20 @@ const SidePanelLayout = ({ return ( <> - {/*
-
- { - window.open('mailto:hubs-feedback@mozilla.com'); - }} - /> + {hub.hasReachedMaxStorage() && ( +
+
+ { + window.open('mailto:hubs-feedback@mozilla.com'); + }} + /> +
-
*/} + )} +
{children} {/* SIDE PANEL WIDGET */}