Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cite page header action buttons layout #3240

Merged
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
88 changes: 45 additions & 43 deletions site/gatsby-site/src/templates/citeTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ function CiteTemplate({
return (
<>
<div className={'titleWrapper'}>
<div className="w-full flex justify-between flex-wrap lg:flex-nowrap gap-1">
<h1 data-testid="incident-title" className="text-2xl inline lg:w-[60%]">
<div className="w-full flex justify-between flex-wrap lg:flex-nowrap gap-1 items-center">
<h1 data-testid="incident-title" className="text-2xl inline">
{locale == 'en' ? metaTitle : defaultIncidentTitle}
</h1>
<div className="inline-flex gap-2 lg:w-[40%] lg:justify-end">
<div className="inline-flex gap-2 lg:justify-end">
{incidentResponded && (
<div className="self-center">
<Badge color="success" data-cy="responded-badge">
Expand All @@ -185,47 +185,49 @@ function CiteTemplate({
)}
{!readOnly && (
<>
<SocialShareButtons
metaTitle={metaTitle}
path={locationPathName}
page="cite"
></SocialShareButtons>
<div className="flex flex-wrap justify-end shrink">
<SocialShareButtons
metaTitle={metaTitle}
path={locationPathName}
page="cite"
></SocialShareButtons>

<div className="ml-4 text-lg">
<a
data-cy="header-previous-incident-link"
title={t('Previous Incident')}
className={`${
prevIncident ? 'text-black hover:text-primary-blue' : 'text-gray-400'
} h-[50px] leading-[50px]`}
href={
prevIncident ? localizePath({ path: `/cite/${prevIncident}` }) : undefined
}
>
<FontAwesomeIcon icon={faCircleArrowLeft} className="mr-2" />
</a>
<a
data-cy="header-random-incident-link"
title={t('Random Incident')}
className={`${
nextIncident ? 'text-black hover:text-primary-blue' : 'text-gray-400'
} h-[50px] leading-[50px]`}
href={localizePath({ path: `/random/` })}
>
<FontAwesomeIcon icon={faDice} className="mr-2" />
</a>
<a
data-cy="header-next-incident-link"
title={t('Next Incident')}
className={`${
nextIncident ? 'text-black hover:text-primary-blue' : 'text-gray-400'
} h-[50px] leading-[50px]`}
href={
nextIncident ? localizePath({ path: `/cite/${nextIncident}` }) : undefined
}
>
<FontAwesomeIcon icon={faCircleArrowRight} className="mr-2" />
</a>
<div className="ml-4 text-lg flex flex-nowrap gap-1">
<a
data-cy="header-previous-incident-link"
title={t('Previous Incident')}
className={`${
prevIncident ? 'text-black hover:text-primary-blue' : 'text-gray-400'
} h-[50px] leading-[50px]`}
href={
prevIncident ? localizePath({ path: `/cite/${prevIncident}` }) : undefined
}
>
<FontAwesomeIcon icon={faCircleArrowLeft} className="mr-2" />
</a>
<a
data-cy="header-random-incident-link"
title={t('Random Incident')}
className={`${
nextIncident ? 'text-black hover:text-primary-blue' : 'text-gray-400'
} h-[50px] leading-[50px]`}
href={localizePath({ path: `/random/` })}
>
<FontAwesomeIcon icon={faDice} className="mr-2" />
</a>
<a
data-cy="header-next-incident-link"
title={t('Next Incident')}
className={`${
nextIncident ? 'text-black hover:text-primary-blue' : 'text-gray-400'
} h-[50px] leading-[50px]`}
href={
nextIncident ? localizePath({ path: `/cite/${nextIncident}` }) : undefined
}
>
<FontAwesomeIcon icon={faCircleArrowRight} className="mr-2" />
</a>
</div>
</div>
</>
)}
Expand Down