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

Button comp #81

Merged
merged 2 commits into from
Oct 20, 2022
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
26 changes: 26 additions & 0 deletions components/BackToButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import PropTypes from 'prop-types'
import Link from 'next/link'

export default function BackToButton(props) {
return (
<>
<div className=" ">
<Link href={props.buttonHref}>
<a
id={props.buttonId}
className="inline-block my-4 py-2.5 px-3.5 font-display text-xl rounded bg-gray-30a text-deep-blue-60b hover:bg-gray-50a hover:cursor-pointer focus:ring focus:ring-offset-4 ring-deep-blue-60f"
>
{props.buttonLinkText}
</a>
</Link>
</div>
</>
)
}

BackToButton.propTypes = {
// Props for the Button
ButtonHref: PropTypes.string,
buttonId: PropTypes.string,
buttonLinkText: PropTypes.string,
}
2 changes: 1 addition & 1 deletion components/MostReqTasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function MostReqTasks(props) {
className="font-display font-bold justify-center py-4 md:py-6 pl-2"
>
<Link href={task.link} passHref>
<a className="flex items-center underline text-white hover:text-brighter-blue-light">
<a className="flex items-center underline text-white hover:text-gray-50">
<FontAwesomeIcon
icon={
icon[task.icon]
Expand Down
19 changes: 10 additions & 9 deletions components/PageLink.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import PropTypes from 'prop-types'
import Link from 'next/link'
import BackToButton from './BackToButton'

export default function PageLink(props) {
const linkText = undefined
Expand All @@ -19,6 +20,7 @@ export default function PageLink(props) {
<Link href={props.href}>
<a
id={`link-for-${linkID}`}
data-cy={props.dataCy}
className="text-blue-default hover:text-blue-hover visited:text-purple-medium underline"
>
{props.linkText}
Expand All @@ -27,14 +29,11 @@ export default function PageLink(props) {
<span className=" text-gray-darker">.</span>
</div>

<Link href={props.buttonHref}>
<a
id={props.buttonId}
className="inline-block my-4 py-2.5 px-3.5 font-display text-xl rounded bg-gray-30a text-deep-blue-60b hover:bg-gray-50a hover:cursor-pointer focus:ring focus:ring-offset-4 ring-deep-blue-60f"
>
{props.buttonLinkText}
</a>
</Link>
<BackToButton
buttonHref={props.buttonHref}
buttonId={props.buttonId}
buttonLinkText={props.buttonLinkText}
/>
</div>
</>
)
Expand All @@ -48,8 +47,10 @@ PageLink.propTypes = {
href: PropTypes.string,
id: PropTypes.string,
linkID: PropTypes.string,
dataCy: PropTypes.string,

// Props for the Button
ButtonHref: PropTypes.string,
buttonHref: PropTypes.string,
buttonId: PropTypes.string,
buttonLinkText: PropTypes.string,
}
2 changes: 1 addition & 1 deletion locales/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default {
securityLinkText: 'paramètres de sécurité',
accessYourSecurityText: 'Accéder à vos ',
pageLinkProfile: 'Vous recherchez les paramètres de votre profil?',
profileLinkText: 'profile',
profileLinkText: 'profil',
accessYourProfileText: 'Accéder à votre ',
backToDashboard: 'Retour à mon tableau de bord',

Expand Down
1 change: 1 addition & 0 deletions pages/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default function Home(props) {
linkText={t.securityLinkText}
href="/security"
linkID="link-id"
dataCy="access-security-page-link"
buttonHref={t.url_dashboard}
buttonId="back-to-dashboard-button"
buttonLinkText={t.backToDashboard}
Expand Down
1 change: 1 addition & 0 deletions pages/security.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default function Home(props) {
linkText={t.profileLinkText}
href="/profile"
linkID="link-id"
dataCy="access-profile-page-link"
buttonHref={t.url_dashboard}
buttonId="back-to-dashboard-button"
buttonLinkText={t.backToDashboard}
Expand Down