Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,16 @@ exports[`HeaderAuthentication Rendering Render HeaderAuthentication component wi
className="HeaderAuthentication__authentication"
>
<span>
<React.Fragment>
<a
href="#"
>
BAM

<Link
className="HeaderAuthentication__authentication__linkIcon"
id="link-icon"
/>

<a
href="#"
rel="noreferrer"
target="_blank"
title="BAM-9.5.0"
>
:

<u>
BAM-9.5.0
</a>
</React.Fragment>
</u>
</a>
</span>
</div>
</React.Fragment>
Expand All @@ -34,23 +27,16 @@ exports[`HeaderAuthentication Rendering Render HeaderAuthentication component wi
className="HeaderAuthentication__authentication varClassName"
>
<span>
<React.Fragment>
<a
href="#"
>
BAM

<Link
className="HeaderAuthentication__authentication__linkIcon"
id="link-icon"
/>

<a
href="#"
rel="noreferrer"
target="_blank"
title="BAM-9.5.0"
>
:

<u>
BAM-9.5.0
</a>
</React.Fragment>
</u>
</a>
</span>
</div>
</React.Fragment>
Expand All @@ -62,23 +48,16 @@ exports[`HeaderAuthentication Rendering Render HeaderAuthentication component wi
className="HeaderAuthentication__authentication"
>
<span>
<React.Fragment>
<a
href="#"
>
Micetro

<Link
className="HeaderAuthentication__authentication__linkIcon"
id="link-icon"
/>

<a
href="#"
rel="noreferrer"
target="_blank"
title="Micetro-10"
>
:

<u>
Micetro-10
</a>
</React.Fragment>
</u>
</a>
</span>
</div>
</React.Fragment>
Expand Down
44 changes: 24 additions & 20 deletions __tests__/components/__snapshots__/HeaderLogo.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`HeaderLogo Rendering Render HeaderLogo component with default props 1`] = `
<a
className="HeaderLogo__logo"
href="/"
>
<img
alt="Gateway logo"
src="/parent/testpath"
/>
<React.Fragment>
<a
className="HeaderLogo__logo"
href="/"
>
<img
alt="Gateway logo"
src="/parent/testpath"
/>
</a>
<span
className="HeaderLogo__logo__name"
>
Gateway
Gateway
</span>
</a>
</React.Fragment>
`;

exports[`HeaderLogo Rendering Render HeaderLogo component with props 1`] = `
<a
className="HeaderLogo__logo varClassName"
href="/"
>
<img
alt="Gateway logo"
src="/parent/testpath"
/>
<React.Fragment>
<a
className="HeaderLogo__logo varClassName"
href="/"
>
<img
alt="Gateway logo"
src="/parent/testpath"
/>
</a>
<span
className="HeaderLogo__logo__name"
>
Gateway
Gateway
</span>
</a>
</React.Fragment>
`;
4 changes: 3 additions & 1 deletion src/header/Header.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// SOFTWARE.
@import '~@bluecateng/pelagos/less/spacing';
@import '~@bluecateng/pelagos/less/colors';
@import '~@bluecateng/pelagos/less/breakpoints';

.SideNavMenu__hamburgerIcon {
.Hamburger {
Expand Down Expand Up @@ -55,8 +56,9 @@
gap: @sp-16;

&__info {
display: flex;
flex-direction: row;
display: none;
.breakpoint(md, {display: flex});
}
}

Expand Down
21 changes: 4 additions & 17 deletions src/header/HeaderAuthentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
import { Link } from '@carbon/icons-react';
import PropTypes from 'prop-types';
import usePlatformData from '../hooks/usePlatformData';

Expand All @@ -46,22 +45,10 @@ const HeaderAuthentication = ({ className }) => {
}`}>
<span>
{authenticationAlias ? (
<>
{authenticationService} &nbsp;
<Link
/* eslint-disable-next-line max-len */
className='HeaderAuthentication__authentication__linkIcon'
id='link-icon'
/>
&nbsp;
<a
href={authenticationLink}
target='_blank'
rel='noreferrer'
title={authenticationAlias}>
{authenticationAlias}
</a>
</>
<a href={authenticationLink}>
{authenticationService}:{' '}
<u>{authenticationAlias}</u>
</a>
) : (
authenticationService
)}
Expand Down
4 changes: 1 addition & 3 deletions src/header/HeaderAuthentication.less
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@

a {
text-decoration: none;
color: var(--tag-color-teal);

padding-left: @sp-02;
max-width: @sp-160;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: var(--link-primary);
}
}

Expand Down
23 changes: 16 additions & 7 deletions src/header/HeaderLogo.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,24 @@ import usePlatformData from '../hooks/usePlatformData';

const HeaderLogo = ({ className }) => {
const { data } = usePlatformData();
const headerLogoPath = data?.platform?.header_logo_path;
const {
header_logo_path: headerLogoPath,
gateway_version: gatewayVersion,
} = data?.platform ?? {};

return (
<a
className={`HeaderLogo__logo${className ? ' ' + className : ''}`}
href='/'>
<img src={headerLogoPath} alt='Gateway logo' />
<span className='HeaderLogo__logo__name'>Gateway</span>
</a>
<>
<a
className={`HeaderLogo__logo${
className ? ` ${className}` : ''
}`}
href='/'>
<img src={headerLogoPath} alt='Gateway logo' />
</a>
<span className='HeaderLogo__logo__name'>
Gateway {gatewayVersion}
</span>
</>
);
};

Expand Down
1 change: 1 addition & 0 deletions stories/Header.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const platformMockValue = {
header_logo_path:
'https://cdn.pixabay.com/photo/2017/05/09/03/46/alberta-2297204_1280.jpg',
language: 'en',
gateway_version: '25.2.1',
},
user: {
authentication_info: {
Expand Down
1 change: 1 addition & 0 deletions stories/SimplePage.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const platformMockValue = {
header_logo_path:
'https://cdn.pixabay.com/photo/2017/05/09/03/46/alberta-2297204_1280.jpg',
language: 'en',
gateway_version: '25.2.1',
},
user: {
authentication_info: {
Expand Down