Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/elliptic-6.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
will0684 committed Nov 4, 2024
2 parents 4a78bfc + cd895c8 commit 8798819
Show file tree
Hide file tree
Showing 5 changed files with 426 additions and 141 deletions.
12 changes: 6 additions & 6 deletions components/fragment_renderer/PageHead.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ export default function PageHead(props) {
/>

{/* Twitter */}
<meta property="twitter:card" content="summary_large_image" />
<meta name="twitter:card" content="summary_large_image" />
<meta
property="twitter:url"
name="twitter:url"
content={
"https://alpha.service.canada.ca" +
`${
Expand All @@ -128,7 +128,7 @@ export default function PageHead(props) {
}
/>
<meta
property="twitter:title"
name="twitter:title"
content={
props.locale === "en"
? props.pageData.scTitleEn
Expand All @@ -137,19 +137,19 @@ export default function PageHead(props) {
/>
<meta name="twitter:creator" content="Service Canada" />
<meta
property="twitter:description"
name="twitter:description"
content={
props.locale === "en"
? props.pageData.scTitleEn
: props.pageData.scTitleFr
}
/>
<meta
property="twitter:image"
name="twitter:image"
content={props.pageData.scSocialMediaImageEn?._publishUrl}
/>
<meta
property="twitter:image:alt"
name="twitter:image:alt"
content={
props.locale === "en"
? props.pageData.scTitleEn
Expand Down
41 changes: 27 additions & 14 deletions components/organisms/Feedback.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { useState } from "react";
import { useState, useRef } from "react";
import Image from "next/image";
import { useRouter } from "next/router";
import { useTranslation } from "next-i18next";

function Feedback() {
const [isSubmitted, setIsSubmitted] = useState(false);
const [isProvidingFeedback, setIsProvidingFeedback] = useState(false);
const thankYouRef = useRef(null);

const router = useRouter();
const { t } = useTranslation("common");
Expand All @@ -22,9 +23,24 @@ function Feedback() {
});
} finally {
setIsSubmitted(true);
// Focus will move to thank you message when it appears
setFocus(thankYouRef);
}
}

function onYesClick() {
setIsSubmitted(true);
setFocus(thankYouRef);
}

function setFocus(ref) {
setTimeout(() => {
if (ref.current) {
ref.current.focus();
}
}, 100);
}

return (
<div className="sm:flex items-center justify-between gap-20 bg-gray-light-200 p-5 max-w-[568px] border rounded">
{isSubmitted && (
Expand All @@ -36,8 +52,10 @@ function Feedback() {
height={25}
style={{ width: 25, height: 25 }}
priority
></Image>
<p>{t("feedback.thank-you")}</p>
/>
<p ref={thankYouRef} tabIndex={-1} role="status" aria-live="polite">
{t("feedback.thank-you")}
</p>
</div>
)}

Expand All @@ -54,32 +72,27 @@ function Feedback() {
name="what-was-wrong"
value="cant-find-info"
required
></input>
/>
{t("feedback.cant-find-info")}
</label>
<label className="flex gap-2">
<input
type="radio"
name="what-was-wrong"
value="hard-to-understand"
></input>
/>
{t("feedback.hard-to-understand")}
</label>
<label className="flex gap-2">
<input
type="radio"
name="what-was-wrong"
value="there-was-an-error"
></input>
/>
{t("feedback.there-was-an-error")}
</label>
<label className="flex gap-2">
<input
type="radio"
name="what-was-wrong"
value="other-reason"
></input>

<input type="radio" name="what-was-wrong" value="other-reason" />
{t("feedback.other-reason")}
</label>
</fieldset>
Expand All @@ -98,7 +111,7 @@ function Feedback() {
aria-describedby="extra-info maximum-characters"
maxLength={300}
className="p-1"
></textarea>
/>
</label>
<button className="bg-multi-blue-blue70 hover:bg-multi-blue-blue60e text-white rounded py-1 px-2">
{t("feedback.submit")}
Expand All @@ -111,7 +124,7 @@ function Feedback() {
<p className="font-semibold text-sm">{t("feedback.did-you-find")}</p>
<div className="flex gap-2">
<button
onClick={() => setIsSubmitted(true)}
onClick={() => onYesClick()}
className="bg-multi-blue-blue70 hover:bg-multi-blue-blue60e text-white rounded py-1 px-2"
aria-label={t("feedback.yes-aria-label")}
>
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
"version": "1.20.1",
"private": true,
"dependencies": {
"@apollo/client": "^3.10.4",
"@apollo/client": "^3.11.8",
"@fortawesome/fontawesome-svg-core": "^6.5.2",
"@fortawesome/free-regular-svg-icons": "^6.5.2",
"@fortawesome/free-solid-svg-icons": "^6.5.2",
"@fortawesome/react-fontawesome": "^0.2.2",
"@lottiefiles/react-lottie-player": "^3.5.3",
"@types/react": "^18.3.3",
"@types/react": "^18.3.11",
"cors": "^2.8.5",
"cuid": "^2.1.8",
"focus-trap-react": "^8.11.2",
"graphql": "^16.8.1",
"graphql": "^16.9.0",
"i18next": "^23.11.3",
"i18next-http-backend": "^1.4.5",
"joi": "^17.13.1",
"next": "^14.2.3",
"next": "^14.2.10",
"next-i18next": "^14.0.3",
"prop-types": "^15.8.1",
"react": "^18.3.1",
Expand All @@ -27,7 +27,7 @@
"react-i18next": "^13.5.0",
"react-lock-scroll": "^0.1.8",
"react-select": "^5.8.0",
"sharp": "^0.33.4",
"sharp": "^0.33.5",
"unified": "^10.1.2",
"uuid": "^9.0.1"
},
Expand Down
2 changes: 1 addition & 1 deletion styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ html {
box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.1);
border-radius: 6px;
background: #ffffff;
position: absolute;
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
Expand Down
Loading

0 comments on commit 8798819

Please sign in to comment.