From de36cd23f8b7f71c3f70f038d704a29d5c89eb7a Mon Sep 17 00:00:00 2001 From: Gamer3514 Date: Sat, 26 Oct 2024 17:42:57 +0100 Subject: [PATCH 1/4] Update StoreComposer.php --- app/Http/ViewComposers/StoreComposer.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/ViewComposers/StoreComposer.php b/app/Http/ViewComposers/StoreComposer.php index e2c6e33ba..ca068251e 100644 --- a/app/Http/ViewComposers/StoreComposer.php +++ b/app/Http/ViewComposers/StoreComposer.php @@ -38,6 +38,10 @@ public function compose(View $view) 'enabled' => $this->setting('renewal:editing', Composer::TYPE_BOOL), ], + 'deletion' => [ + 'enabled' => $this->setting('renewal:deletion', Composer::TYPE_BOOL), + ], + 'referrals' => [ 'enabled' => $this->setting('referrals:enabled', Composer::TYPE_BOOL), 'reward' => $this->setting('referrals:reward', Composer::TYPE_INT), From c85764bdafc7460b2d83fca7b872a3916c6a9ebc Mon Sep 17 00:00:00 2001 From: Gamer3514 Date: Sat, 26 Oct 2024 17:44:12 +0100 Subject: [PATCH 2/4] Update SettingsContainer.tsx --- .../components/server/settings/SettingsContainer.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/scripts/components/server/settings/SettingsContainer.tsx b/resources/scripts/components/server/settings/SettingsContainer.tsx index f33462c4d..e1099e963 100644 --- a/resources/scripts/components/server/settings/SettingsContainer.tsx +++ b/resources/scripts/components/server/settings/SettingsContainer.tsx @@ -9,11 +9,12 @@ import RenameServerBox from '@/components/server/settings/RenameServerBox'; import DeleteServerBox from '@/components/server/settings/DeleteServerBox'; import ReinstallServerBox from '@/components/server/settings/ReinstallServerBox'; import ChangeBackgroundBox from '@/components/server/settings/ChangeBackgroundBox'; +import { useStoreState } from 'easy-peasy'; export default () => { const uuid = ServerContext.useStoreState((state) => state.server.data!.uuid); const node = ServerContext.useStoreState((state) => state.server.data!.node); - + const deletion = useStoreState((state) => state.storefront.data!.deletion.enabled); return ( { - + {deletion && ( + + )}
From 9a7497dec359c01d551b3e38182f88834f4dce45 Mon Sep 17 00:00:00 2001 From: Gamer3514 Date: Sat, 26 Oct 2024 17:44:44 +0100 Subject: [PATCH 3/4] Update storefront.ts --- resources/scripts/state/storefront.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/scripts/state/storefront.ts b/resources/scripts/state/storefront.ts index ab677ed87..9e8032f87 100644 --- a/resources/scripts/state/storefront.ts +++ b/resources/scripts/state/storefront.ts @@ -10,6 +10,9 @@ export interface StorefrontSettings { editing: { enabled: boolean; }; + deletion: { + enabled: boolean; + }; referrals: { enabled: boolean; reward: number; From 1d8e994f6f73281030fd2082207369ca163a3f24 Mon Sep 17 00:00:00 2001 From: Gamer3514 Date: Fri, 1 Nov 2024 13:15:33 +0000 Subject: [PATCH 4/4] lint --- .../scripts/components/server/settings/SettingsContainer.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/resources/scripts/components/server/settings/SettingsContainer.tsx b/resources/scripts/components/server/settings/SettingsContainer.tsx index e1099e963..2da7552f3 100644 --- a/resources/scripts/components/server/settings/SettingsContainer.tsx +++ b/resources/scripts/components/server/settings/SettingsContainer.tsx @@ -35,9 +35,7 @@ export default () => {
- {deletion && ( - - )} + {deletion && }