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), diff --git a/resources/scripts/components/server/settings/SettingsContainer.tsx b/resources/scripts/components/server/settings/SettingsContainer.tsx index f33462c4d..2da7552f3 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 && }
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;