Skip to content

Commit

Permalink
Update social media links (#1184)
Browse files Browse the repository at this point in the history
- Extracted a group of social media links into a dedicated component
- Use the SocialMediaLinks component in the footer on the Home page; on the About page;
   and in the ContactUs tab of the communications panel
- Added a base CSS layer, so that the CSS rules that are declared as part of the components layer
   do not get overridden by the regular (non-layered) styles
- Updated a label on the VEP page (Variant effect predictor -> Variant Effect Predictor)
  • Loading branch information
azangru authored Nov 6, 2024
1 parent abb78d0 commit 3b9cd78
Show file tree
Hide file tree
Showing 15 changed files with 305 additions and 240 deletions.
13 changes: 8 additions & 5 deletions src/content/app/about/About.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@
}

.aside {
position: sticky;
top: 0;
display: flex;
flex-direction: column;
align-self: start;
display: grid;
grid-template-rows: 1fr [social-media-links] auto;
}

.asideTitle {
font-weight: var(--font-weight-light);
margin-bottom: 1rem;
}

.socialMediaLinks {
align-self: start;
grid-row: social-media-links;
margin-bottom: 60px;
}
2 changes: 2 additions & 0 deletions src/content/app/about/About.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import Breadcrumbs from 'src/shared/components/breadcrumbs/Breadcrumbs';
import { CircleLoader } from 'src/shared/components/loader';
import ConversationIcon from 'src/shared/components/communication-framework/ConversationIcon';
import { NotFoundErrorScreen } from 'src/shared/components/error-screen';
import SocialMediaLinks from 'src/shared/components/social-media-links/SocialMediaLinks';

import helpStyles from '../help/Help.module.css';
import styles from './About.module.css';
Expand Down Expand Up @@ -105,6 +106,7 @@ const About = () => {
highlightActiveArticle={true}
/>
)}
<SocialMediaLinks className={styles.socialMediaLinks} />
</aside>
</HelpArticleGrid>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const EnsemblVepVersion = () => {
return (
<div className={styles.vepVersion}>
<Logotype />
<span>Variant effect predictor </span>
<span>Variant Effect Predictor </span>
v110
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
column-gap: var(--standard-gutter);
padding-right: 80px;
}

.transcriptSetWrapper {
display: flex;
align-items: baseline;
Expand Down
17 changes: 4 additions & 13 deletions src/content/home/Home.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,6 @@
margin-left: auto;
}

.footerRight .link {
margin-right: 12px;
margin-bottom: 10px;
white-space: nowrap;
color: var(--color-blue);
}

.footerRight .mediaIcon {
width: 24px;
height: 24px;
margin: 0 12px 10px;
}

.footerRight .gbcLogo {
height: 40px;
margin-left: clamp(30px, 3vw, 90px);
Expand All @@ -210,3 +197,7 @@
height: 52px;
margin-left: 40px;
}

.socialMediaLinks {
margin-right: 12px;
}
33 changes: 2 additions & 31 deletions src/content/home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@ import {
SpeciesSelectorIcon,
EntityViewerIcon
} from 'src/shared/components/app-icon';
import SocialMediaLinks from 'src/shared/components/social-media-links/SocialMediaLinks';

import Logotype from 'static/img/brand/logotype.svg';

import speciesStripUrl from 'static/img/home/species-strip.svg?url';
import ebiLogoUrl from 'static/img/home/EMBLEBI-logo.svg?url';
import elixirLogoUrl from 'static/img/home/elixir-logo.svg?url';
import gbcLogoUrl from 'static/img/home/gbc-logo.svg?url';
import facebookIconUrl from 'static/icons/icon_facebook.svg?url';
import twitterIconUrl from 'static/icons/icon_twitter.svg?url';
import blogIconUrl from 'static/icons/icon_blog.svg?url';

import styles from './Home.module.css';

Expand Down Expand Up @@ -142,34 +140,7 @@ const Home = () => {
</div>

<div className={styles.footerRight}>
<a
href="https://www.ensembl.info"
target="_blank"
rel="noopener noreferrer"
>
<div className={styles.link}>Ensembl blog</div>
</a>
<a
href="https://www.ensembl.info"
target="_blank"
rel="noopener noreferrer"
>
<img src={blogIconUrl} className={styles.mediaIcon} />
</a>
<a
href="https://www.facebook.com/Ensembl.org"
target="_blank"
rel="noopener noreferrer"
>
<img src={facebookIconUrl} className={styles.mediaIcon} />
</a>
<a
href="https://twitter.com/ensembl"
target="_blank"
rel="noopener noreferrer"
>
<img src={twitterIconUrl} className={styles.mediaIcon} />
</a>
<SocialMediaLinks className={styles.socialMediaLinks} />
<a
href="https://globalbiodata.org/scientific-activities/global-core-biodata-resources"
target="_blank"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@
margin-top: 50px;
}

.socialMediaInfo a {
display: inline-block;
margin-right: 20px;
}

.socialMediaLinkText {
display: inline-block;
margin-right: 10px;
.socialMediaLinks {
margin-top: 10px;
}

.icon {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ import { ContactUsInitialForm } from './contact-us-form';
import { Invitation, Header } from './preform-header/PreformHeader';
import { SecondaryButton } from 'src/shared/components/button/Button';
import ExternalLink from 'src/shared/components/external-link/ExternalLink';

import BlogIcon from 'static/icons/icon_blog.svg';
import FacebookIcon from 'static/icons/icon_facebook.svg';
import TwitterIcon from 'static/icons/icon_twitter.svg';
import SocialMediaLinks from 'src/shared/components/social-media-links/SocialMediaLinks';

import styles from './ContactUs.module.css';

Expand Down Expand Up @@ -78,30 +75,7 @@ const ContactUs = () => {
Visit Facebook or Twitter for the latest breaking Ensembl news and
service status updates.
</p>
<p>
<a
target="_blank"
rel="noopener noreferrer"
href="https://www.ensembl.info/"
>
<span className={styles.socialMediaLinkText}>Ensembl Blog</span>{' '}
<BlogIcon className={styles.icon} />{' '}
</a>
<a
target="_blank"
rel="noopener noreferrer"
href="https://www.facebook.com/Ensembl.org/"
>
<FacebookIcon className={styles.icon} />{' '}
</a>
<a
target="_blank"
rel="noopener noreferrer"
href="https://twitter.com/ensembl"
>
<TwitterIcon className={styles.icon} />
</a>
</p>
<SocialMediaLinks className={styles.socialMediaLinks} />
</section>
<section>
<h2>Online Help</h2>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
To style individual icons, use the following selectors:
- [data-part="blog-icon"] for the blog icon
- [data-part="facebook-icon"] for Facebook icon
- [data-part="twitter-icon"] for Twitter/X icon
*/

@layer components {
.container {
display: inline-grid;
grid-template-columns: repeat(3, auto);
column-gap: 24px;
}

.blog {
display: inline-flex;
align-items: center;
gap: 16px;
white-space: nowrap;
}

.mediaIcon {
height: 24px;
}

.mediaIcon[data-part="twitter-icon"] {
height: 22px;
}
}
71 changes: 71 additions & 0 deletions src/shared/components/social-media-links/SocialMediaLinks.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/**
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import classNames from 'classnames';

import facebookIconUrl from 'static/icons/icon_facebook.svg?url';
import twitterIconUrl from 'static/icons/icon_twitter.svg?url';
import blogIconUrl from 'static/icons/icon_blog.svg?url';

import styles from './SocialMediaLinks.module.css';

type Props = {
className?: string;
};

const SocialMediaLinks = (props: Props) => {
const componentStyles = classNames(styles.container, props.className);

return (
<div className={componentStyles}>
<a
className={styles.blog}
href="https://www.ensembl.info"
target="_blank"
rel="noopener noreferrer"
>
<span>Ensembl blog</span>
<img
data-part="blog-icon"
src={blogIconUrl}
className={styles.mediaIcon}
/>
</a>
<a
href="https://www.facebook.com/Ensembl.org"
target="_blank"
rel="noopener noreferrer"
>
<img
data-part="facebook-icon"
src={facebookIconUrl}
className={styles.mediaIcon}
alt="Ensembl profile on Facebook"
/>
</a>
<a href="https://x.com/ensembl" target="_blank" rel="noopener noreferrer">
<img
data-part="twitter-icon"
src={twitterIconUrl}
className={styles.mediaIcon}
alt="Ensembl profile on X"
/>
</a>
</div>
);
};

export default SocialMediaLinks;
Loading

0 comments on commit 3b9cd78

Please sign in to comment.