Skip to content

Commit

Permalink
Issue #278: Done in PR #279
Browse files Browse the repository at this point in the history
  • Loading branch information
lexhouk authored Nov 15, 2023
2 parents d6aec5c + 305c3d9 commit a68a288
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"drupal/recaptcha_preloader": "2.0.0",
"drupal/service": "1.0.0",
"drupal/seven": "1.0.0",
"drupal/standwithukraine": "1.3.10",
"drupal/standwithukraine": "2.0.0",
"drupal/symfony_mailer": "1.3.2"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion d8.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Basis for the site on Drupal 10.

type: profile
core_version_requirement: ^10
version: 0.18.0.163
version: 0.18.0.164

distribution:
name: D8+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Drupal\Core\Menu\LocalTaskManagerInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Theme\ThemeManagerInterface;
use Drupal\standwithukraine\Position;
use Drupal\standwithukraine\Service\StandWithUkraineNegotiatorInterface;
use Drupal\standwithukraine\StandWithUkraineSettingsInterface;

Expand All @@ -20,27 +21,24 @@ class D8StandWithUkraineNegotiator implements StandWithUkraineNegotiatorInterfac
* @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory
* The configuration factory.
* @param \Drupal\Core\Theme\ThemeManagerInterface $themeManager
* The theme.
* The theme manager.
* @param \Drupal\Core\Routing\RouteMatchInterface $routeMatch
* The currently active route match object.
* @param \Drupal\Core\Menu\LocalTaskManagerInterface $localTaskManager
* The local task manager.
*/
public function __construct(
private readonly ConfigFactoryInterface $configFactory,
private readonly ThemeManagerInterface $themeManager,
private readonly RouteMatchInterface $routeMatch,
private readonly LocalTaskManagerInterface $localTaskManager
protected ConfigFactoryInterface $configFactory,
protected ThemeManagerInterface $themeManager,
protected RouteMatchInterface $routeMatch,
protected LocalTaskManagerInterface $localTaskManager
) {}

/**
* {@inheritdoc}
*/
public function applies(StandWithUkraineSettingsInterface $settings): bool {
if (
$settings->isSingle() ||
$settings->getPosition() !== StandWithUkraineSettingsInterface::POSITION_RIGHT
) {
if ($settings->isSingle() || $settings->getPosition() !== Position::Right) {
$theme = $this->configFactory->get('system.theme')->get('admin');

if (!empty($theme)) {
Expand Down Expand Up @@ -84,7 +82,7 @@ public function override(StandWithUkraineSettingsInterface $settings): void {
->setText(StandWithUkraineSettingsInterface::TEXT)
->setDouble()
->setSizes(FALSE, TRUE)
->setPosition(StandWithUkraineSettingsInterface::POSITION_RIGHT)
->setPosition(Position::Right)
->setOffset($offset);
}

Expand Down

0 comments on commit a68a288

Please sign in to comment.