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

Alt text #1585

Closed
wants to merge 14 commits into from
Closed
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
19 changes: 17 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"extends": ["next", "next/core-web-vitals", "prettier"],
"plugins": ["i18next"],
"extends": [
"next",
"next/core-web-vitals",
"prettier",
"plugin:jsx-a11y/recommended"
],
"plugins": ["i18next", "jsx-a11y"],
"rules": {
// TODO: Fix these warnings and make them errors by removing these overrides.
"react/no-unescaped-entities": "off",
Expand All @@ -12,6 +17,16 @@
"additionalHooks": "^useAsync$"
}
],
"jsx-a11y/alt-text": [
2,
{
"elements": ["img", "object", "area", "input[type=\"image\"]"],
"img": ["Image"],
"object": ["Object"],
"area": ["Area"],
"input[type=\"image\"]": ["InputImage"]
}
],
// TODO: Fix existing warnings and make them errors going forward
"i18next/no-literal-string": "warn"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const WritingContent = () => (
className={`float-md-end`}
fluid
src="/computer-text-blob.svg"
alt="computer display with lines representing text"
alt=""
/>
</Col>
</Row>
Expand All @@ -50,11 +50,7 @@ const OralContent = () => (
md={{ span: 4, order: 0 }}
lg={{ span: 3, order: 0, offset: 1 }}
>
<StyledImage
fluid
src="/mic-with-testify.svg"
alt="microphone next to a sheet of paper"
/>
<StyledImage fluid src="/mic-with-testify.svg" alt="" />
</Col>
<Col
xs={{ span: 12, order: 1 }}
Expand Down Expand Up @@ -86,7 +82,7 @@ const WriteOrCallContent = () => (
className={`float-md-end`}
fluid
src="/open-envelope.svg"
alt="envelope with letter sticking out"
alt=""
/>
</Col>
</Row>
Expand Down
4 changes: 2 additions & 2 deletions components/EditProfilePage/ImageInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const ImageInput = ({ className }: ImageInputProps) => {
},
[updateProfileImage]
)
const { t } = useTranslation("profile")
const { t } = useTranslation(["profile", "auth"])

return (
<div className="d-flex flex-row px-3 col">
Expand All @@ -38,7 +38,7 @@ export const ImageInput = ({ className }: ImageInputProps) => {
borderRadius: "2rem",
margin: "1rem"
}}
alt="Profile image"
alt={t("profileIcon")}
src={profileImage}
></Image>
{updatingProfileImage && <Spinner animation="border" />}
Expand Down
22 changes: 13 additions & 9 deletions components/EditProfilePage/ProfileSettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,19 @@ function RenderPrivacyText(role: Role, isPublic: boolean) {
}
}

const EmailIcon = () => (
<Image
className={`me-1`}
src="/mail.svg"
alt="open envelope with letter, toggles update frequency options"
width="22"
height="19"
/>
)
const EmailIcon = () => {
const { t } = useTranslation("editProfile")

return (
<Image
className={`me-1`}
src="/mail.svg"
alt={t("emailIconAlt")}
width="22"
height="19"
/>
)
}

export default function ProfileSettingsModal({
actions,
Expand Down
7 changes: 1 addition & 6 deletions components/EditProfilePage/TestimonyFAQ.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ export const TestimonyFAQ = ({ className }: { className: string }) => {
<Card.Body>
<h2>{t("testimonies.faq")}</h2>
<div className="p-4 m-3 d-flex justify-content-center">
<Image
className="w-100"
fluid
alt="writing icon"
src="/writing.svg"
></Image>
<Image className="w-100" fluid alt="" src="/writing.svg"></Image>
</div>

<h4>{t("testimonies.edit")}</h4>
Expand Down
6 changes: 4 additions & 2 deletions components/Faq/FaqQandAButton.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { useEffect, useState } from "react"
import { Image, Collapse } from "../bootstrap"
import { useTranslation } from "next-i18next"

type faqQandAProps = {
question: string
answer: string
}

export const FaqQandAButton = ({ question, answer }: faqQandAProps) => {
const { t } = useTranslation("common")
const [open, setOpen] = useState(false)

useEffect(() => {}, [open])
Expand All @@ -32,9 +34,9 @@ export const FaqQandAButton = ({ question, answer }: faqQandAProps) => {
>
<div className={`align-items-center d-flex mt-4`}>
{open ? (
<Image src="/minus.svg" className={`me-2`} alt="minus icon" />
<Image src="/minus.svg" className={`me-2`} alt={t("hideAns")} />
) : (
<Image src="/add.svg" className={`me-2`} alt="plus icon" />
<Image src="/add.svg" className={`me-2`} alt={t("showAns")} />
)}
{question}
</div>
Expand Down
8 changes: 4 additions & 4 deletions components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function MapleContainer({ className }: { className?: string }) {
>
<Image
src="/images/twitter.svg"
alt="Twitter Icon"
alt={t("links.socials.twitter")}
width="24"
height="24"
></Image>
Expand All @@ -92,7 +92,7 @@ function MapleContainer({ className }: { className?: string }) {
>
<Image
src="/images/instagram.svg"
alt="Instagram Icon"
alt={t("links.socials.instagram")}
width="24"
height="24"
></Image>
Expand All @@ -106,7 +106,7 @@ function MapleContainer({ className }: { className?: string }) {
>
<Image
src="/Linked In.svg"
alt="LinkedIn Icon"
alt={t("links.socials.linkedin")}
width="24"
height="24"
></Image>
Expand All @@ -117,7 +117,7 @@ function MapleContainer({ className }: { className?: string }) {
<Image
className="bg-transparent"
src="/maple-footer-white.png"
alt="MAPLE logo"
alt={t("logo")}
width={100}
/>
</Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ const OurGoalsCardContent = () => {
<Row className="mb-4">
<Col md={6}>
<figure className="text-center mb-3">
<OurGoalsImage
fluid
src="/gov-with-key.svg"
alt="government building with key"
/>
<OurGoalsImage fluid src="/gov-with-key.svg" alt="" />
<figcaption className="text-align-center text-align-sm-start fs-5 fw-bold mt-3">
{t("goals.increase")}
</figcaption>
Expand All @@ -43,7 +39,7 @@ const OurGoalsCardContent = () => {
<OurGoalsImage
fluid
src="/doc-with-arrows-from-people.svg"
alt="government building with key"
alt=""
/>
<figcaption className="text-align-center text-align-sm-start fs-5 fw-bold mt-3">
{t("goals.engage")}
Expand All @@ -55,11 +51,7 @@ const OurGoalsCardContent = () => {
<Row>
<Col xs={{ span: 12, order: 2 }} md={{ span: 6, order: 1 }}>
<figure className="text-center mb-3">
<OurGoalsImage
fluid
src="/doc-with-arrows-to-people.svg"
alt="government building with key"
/>
<OurGoalsImage fluid src="/doc-with-arrows-to-people.svg" alt="" />
<figcaption className="text-align-center text-align-sm-start fs-5 fw-bold mt-3">
{t("goals.strengthen")}
</figcaption>
Expand All @@ -68,11 +60,7 @@ const OurGoalsCardContent = () => {

<Col xs={{ span: 12, order: 1 }} md={{ span: 6, order: 1 }}>
<figure className="text-center mb-3">
<OurGoalsImage
fluid
src="/gov-with-key.svg"
alt="government building with key"
/>
<OurGoalsImage fluid src="/gov-with-key.svg" alt="" />
<figcaption className="text-align-center text-align-sm-start fs-5 fw-bold mt-3">
{t("goals.encourage")}
</figcaption>
Expand Down Expand Up @@ -104,11 +92,7 @@ const OurMissionCardContent = () => {
lg={4}
className={`text-center`}
>
<MissionImage
fluid
src="/leg-with-mag-glass.svg"
alt="document with magnifying glass"
/>
<MissionImage fluid src="/leg-with-mag-glass.svg" alt="" />
</Col>
</Row>

Expand All @@ -119,11 +103,7 @@ const OurMissionCardContent = () => {
lg={4}
className="text-center"
>
<MissionImage
fluid
src="/doc-treasure-box.svg"
alt="document with magnifying glass"
/>
<MissionImage fluid src="/doc-treasure-box.svg" alt="" />
</Col>
<Col
sm={{ span: 12, order: 2 }}
Expand Down
2 changes: 1 addition & 1 deletion components/HearingsScheduled/HearingsScheduled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export const HearingsScheduled = () => {
<HearingImage
className={`d-block mx-auto`}
src="/speaker-podium.svg"
alt="speaker at podium"
alt=""
/>
</Col>
<Col md={7}>
Expand Down
2 changes: 1 addition & 1 deletion components/HeroHeader/HeroHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const HeroHeader = ({ authenticated }) => {
<Image
className={`${styles.statehouse}`}
src="/statehouse.svg"
alt="statehouse"
alt=""
></Image>
</Col>
<Col
Expand Down
17 changes: 14 additions & 3 deletions components/HotBillCard/Positions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,43 @@ import React from "react"
import { Container, CardImg } from "react-bootstrap"
import Image from "react-bootstrap/Image"
import styled from "styled-components"
import { useTranslation } from "next-i18next"

export const Positions = (props: {
endorseCount: number
opposeCount: number
neutralCount: number
}) => {
const { t } = useTranslation("testimony")

return (
<PositionsStyle>
<PositionStyle>
<p className="stanceTitle">Endorse</p>
<div>
<Image className="svg" alt="" src="/thumbs-endorse.svg" />
<Image className="svg" alt={t("counts.endorsements")} />
<p>{props.endorseCount}</p>
</div>
</PositionStyle>
<PositionStyle>
<p className="stanceTitle">Neutral</p>
<div>
<Image className="svg" alt="" src="/thumbs-neutral.svg" />
<Image
className="svg"
alt={t("counts.neutral")}
src="/thumbs-neutral.svg"
/>
<p>{props.neutralCount}</p>
</div>
</PositionStyle>
<PositionStyle>
<p className="stanceTitle">Oppose</p>
<div>
<Image className="svg" alt="" src="/thumbs-oppose.svg" />
<Image
className="svg"
alt={t("counts.oppose")}
src="/thumbs-oppose.svg"
/>
<p>{props.opposeCount}</p>
</div>
</PositionStyle>
Expand Down
2 changes: 1 addition & 1 deletion components/Leaf/Leaf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const Leaf = ({
}) => {
return (
<LeafContainer className="w-100">
<LeafImage className={position} fluid src="/leaf.svg" alt="leaf" />
<LeafImage className={position} fluid src="/leaf.svg" alt="" />
</LeafContainer>
)
}
Expand Down
Loading
Loading