Skip to content

Commit

Permalink
Restyle logo placement
Browse files Browse the repository at this point in the history
  • Loading branch information
wilson1000 committed Oct 9, 2024
1 parent d9a3de5 commit 4cc0cf1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
13 changes: 8 additions & 5 deletions public/app/themes/clarity/src/components/c-logo-bar/style.styl
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,23 @@
text-decoration: none;
}

img {
.image {
background-size: 94%;
background-repeat: no-repeat;
background-position: 1px 12px;
width: 38px;
height: 49px;
position: relative;
display: block;
float: left;
margin-right: 2px;
}
.agency-title {
color: white;
font-size: 26px;
font-weight: 400;
line-height: 29px;
line-height: 31px;
float: left;
padding: $spacing $spacing $spacing;
padding: $spacing $spacing 0.6rem;
}

&__switch {
Expand Down Expand Up @@ -57,5 +61,4 @@
&__stack--right {
float:right;
}

}
25 changes: 10 additions & 15 deletions public/app/themes/clarity/src/components/c-logo-bar/view.php
Original file line number Diff line number Diff line change
@@ -1,42 +1,37 @@
<?php
use MOJ\Intranet\Agency;

$oAgency = new Agency();
$activeAgency = $oAgency->getCurrentAgency();
use MOJ\Intranet\Agency;

$oAgency = new Agency();
$activeAgency = $oAgency->getCurrentAgency();

$logo = get_stylesheet_directory_uri() . '/dist/images/moj_logo_header.png';

if ($activeAgency['shortcode'] === 'law-commission') {
$logo = get_stylesheet_directory_uri() . '/dist/images/lawcomms_logo_new.png';
} else {
$logo = get_stylesheet_directory_uri() . '/dist/images/moj_logo_new.png';
}

$agency = get_intranet_code();

$header_logo = get_field($agency .'_header_logo', 'option');
$header_logo = get_field(get_intranet_code() .'_header_logo', 'option');

if(!empty($header_logo)){
$logo = $header_logo;
}

$page_name = get_query_var('name');
?>

<section class="c-logo-bar">
<div class="u-wrapper">

<div class="u-wrapper__stack--left">
<a href="/" rel="home">
<img aria-hidden="true" src="<?= $logo ?>" alt>
<span class="agency-title l-half-section"><?= $activeAgency['label'] ?></span>
<span class="image" style="background-image: url('<?= $logo ?>')">&nbsp;</span>
<span class="agency-title l-half-section"><?= $activeAgency['label'] ?></span>
</a>
</div>

<div class="u-wrapper__stack--right">
<?php if ($page_name !== 'agency-switcher') : ?>
<?php if (get_query_var('name') !== 'agency-switcher') : ?>
<a href="/agency-switcher" class="c-logo-bar__switch">Switch to other intranet</a>
<?php endif; ?>
</div>

</div>
</div>
</section>

0 comments on commit 4cc0cf1

Please sign in to comment.