Skip to content

Commit

Permalink
create logo container
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrahoang686 committed Oct 28, 2024
1 parent 06b3a01 commit 947ad47
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
30 changes: 30 additions & 0 deletions app/scripts/components/common/page-header/logo-container.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React, { ComponentType } from 'react';
import { Tip } from '../tip';
import { LinkProperties } from '../card';
import { Brand, PageTitleSecLink } from './logo';
/**
* LogoContainer that is meant to integrate in the default page header without the dependencies of the veda virtual modules
* and expects the Logo SVG to be passed in as a prop - this will support the instance for refactor
*/

export default function LogoContainer ({ linkProperties, Logo, title, subTitle, version }: {
linkProperties: LinkProperties,
Logo: JSX.Element,
title: string,
subTitle: string,
version: string
}) {
const LinkElement: ComponentType<any> = linkProperties.LinkElement as ComponentType<any>;

return (
<Brand>
<LinkElement {...{[linkProperties.pathAttributeKeyName]: '/'}}>
{Logo}
<span>{title}</span> <span>{subTitle}</span>
</LinkElement>
<Tip content={`v${version}`}>
<PageTitleSecLink {...{as: linkProperties.LinkElement as ComponentType<any>, [linkProperties.pathAttributeKeyName]: '/development'}}>Beta</PageTitleSecLink>
</Tip>
</Brand>
);
}
4 changes: 2 additions & 2 deletions app/scripts/components/common/page-header/logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ComponentOverride } from '$components/common/page-overrides';
const appTitle = process.env.APP_TITLE;
const appVersion = process.env.APP_VERSION;

const Brand = styled.div`
export const Brand = styled.div`
display: flex;
flex-shrink: 0;
Expand Down Expand Up @@ -74,7 +74,7 @@ const Brand = styled.div`
}
`;

const PageTitleSecLink = styled.a`
export const PageTitleSecLink = styled.a`
align-self: end;
font-size: 0.75rem;
font-weight: ${themeVal('type.base.bold')};
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import PageHero from '$components/common/page-hero';
import StoriesHubContent from '$components/stories/hub/hub-content';
import { useFiltersWithQS } from '$components/common/catalog/controls/hooks/use-filters-with-query';
import PageHeader from '$components/common/page-header';
import Logo from '$components/common/page-header/logo';
import LogoContainer from '$components/common/page-header/logo-container';


export {
Expand All @@ -41,7 +41,7 @@ export {
PageHeader,
ReactQueryProvider,
StoriesHubContent,
Logo,
LogoContainer,
// HOOKS and utility functions
useFiltersWithQS
};

0 comments on commit 947ad47

Please sign in to comment.