Skip to content

Commit

Permalink
refactor(logo): import theme site logos to the story
Browse files Browse the repository at this point in the history
  • Loading branch information
tarantilis committed Dec 16, 2022
1 parent 91cdd66 commit 2f29136
Show file tree
Hide file tree
Showing 36 changed files with 987 additions and 111 deletions.
101 changes: 100 additions & 1 deletion src/ui/Logo/Logo.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ import LogoEEA from './Logo';
import LogoImage from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/images/Header/eea-logo.svg';
import InvertedLogoImage from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/EEA-Logo-White.svg';

import Bise from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/sites/Bise.svg';
import BiseInverted from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/sites/Bise_inverted.svg';

import Fise from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/sites/Fise.svg';
import FiseInverted from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/sites/Fise_inverted.svg';

import Freshwater from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/sites/WiseF.svg';
import FreshwaterInverted from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/sites/WiseF_inverted.svg';

import Marine from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/sites/WiseM.svg';
import MarineInverted from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/sites/WiseM_inverted.svg';

// import Energy from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/energy.svg';
// import Insitu from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/insitu.svg';
// import ClimateHealth from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/climate-health.svg';
// import Cca from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/cca.svg';
// import Copernicus from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/copernicus.svg';
// import Industry from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/industry.svg';
// import Eionet from '@eeacms/volto-eea-design-system/../theme/themes/eea/assets/logo/eionet.svg';

export default {
title: 'Components/Logo',
component: LogoEEA,
Expand All @@ -15,9 +35,87 @@ export default {
type: { summary: 'boolean' },
},
},
site: {
options: [
'EEA',
'Biodiversity Information System for Europe',
'Forest Information System for Europe',
'Fresh Water Information System for Europe',
'Marine Water Information System for Europe',
// 'Climate Adaptation Platform',
// 'Copernicus in situ component',
// 'Copernicus land monitoring',
// 'European Industrial Emissions Portal',
// 'Information Platform for Chemical Monitoring',
],
control: { type: 'select' },
defaultValue: 'tertiary',
table: {
name: 'Site Logo',
defaultValue: { summary: 'tertiary' },
type: { summary: 'string' },
},
},
},
};

const SiteLogo = (args) => {
let logo = args.site;

if (logo === 'Biodiversity Information System for Europe') {
return (
<LogoEEA
{...args}
src={Bise}
invertedSrc={BiseInverted}
url="https://biodiversity.europa.eu/"
/>
);
} else if (logo === 'Forest Information System for Europe') {
return (
<LogoEEA
{...args}
src={Fise}
invertedSrc={FiseInverted}
url="https://forest.eea.europa.eu/"
/>
);
} else if (logo === 'Marine Water Information System for Europe') {
return (
<LogoEEA
{...args}
src={Marine}
invertedSrc={MarineInverted}
url="https://water.europa.eu/marine"
/>
);
} else if (logo === 'Fresh Water Information System for Europe') {
return (
<LogoEEA
{...args}
src={Freshwater}
invertedSrc={FreshwaterInverted}
url="https://water.europa.eu/freshwater"
/>
);
}

// else if (logo === 'Climate Adaptation Platform') {
// return <LogoEEA {...args} src={Energy} invertedSrc={Energy} />
// } else if (logo === 'Copernicus in situ component') {
// return <LogoEEA {...args} src={Insitu} invertedSrc={Insitu} />
// } else if (logo === 'Copernicus land monitoring') {
// return <LogoEEA {...args} src={Copernicus} invertedSrc={Copernicus} />
// } else if (logo === 'European Industrial Emissions Portal') {
// return <LogoEEA {...args} src={Industry} invertedSrc={Industry} />
// } else if (logo === 'Information Platform for Chemical Monitoring') {
// return <LogoEEA {...args} src={Bise} invertedSrc={Bise} />
// }
else {
return <LogoEEA {...args} />;
}
};

export const Logo = (args) => (
<Container>
<Segment
Expand All @@ -26,12 +124,13 @@ export const Logo = (args) => (
floated="left"
inverted={args.inverted}
>
<LogoEEA {...args} />
<SiteLogo {...args} />
</Segment>
</Container>
);

Logo.args = {
site: 'EEA',
title: 'European Environment Agency',
alt: 'European Environment Agency',
url: 'https://eea.europa.eu',
Expand Down

0 comments on commit 2f29136

Please sign in to comment.