Skip to content

Commit

Permalink
Cleaner Panel UI if no interface options
Browse files Browse the repository at this point in the history
Fixes #3
  • Loading branch information
lukasbestle committed Jun 29, 2024
1 parent 1ad8379 commit 8c8bbef
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/config/blueprints/blocks/downloads.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,19 @@
];
}

$blueprint = [
'name' => I18n::translate('lukasbestle.downloads.downloads'),
'icon' => 'download',
];

// only display selection fields if all interface options have been disabled
if (count($uiFields) === 1) {
return [
...$blueprint,
'fields' => $selectionFields,
];
}

// prepend the info box to the selection fields
$selectionFields = [
'selectionInfo' => [
Expand All @@ -134,8 +147,7 @@
] + $selectionFields;

return [
'name' => I18n::translate('lukasbestle.downloads.downloads'),
'icon' => 'download',
...$blueprint,
'tabs' => [
'selection' => [
'label' => I18n::translate('lukasbestle.downloads.selection'),
Expand Down

0 comments on commit 8c8bbef

Please sign in to comment.