Skip to content

Commit

Permalink
fix: linting issues on ConsentForm & SwitchInput
Browse files Browse the repository at this point in the history
  • Loading branch information
jbmoelker committed Dec 30, 2023
1 parent 6d079d4 commit e03d8fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 5 additions & 3 deletions src/components/ConsentForm/ConsentForm.astro
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ const groups = [
---

<form>
<h2>[ Consent form ]</h2>
<h1>[ Consent form ]</h1>
{
groups.map((group) => (
<consent-form-group>
<fieldset>
<legend class="a11y-sr-only">{group.title}</legend>
<details>
<summary>
<legend>{group.title}</legend>
<span aria-hidden>{group.title}</span>
<label for={`consent:${group.key}`} class="a11y-sr-only">
{group.title}
</label>
Expand Down Expand Up @@ -91,6 +92,7 @@ const groups = [
</consent-form-group>
))
}
<button type="submit">[ Save preferences ]</button>
</form>

<script src="./ConsentForm.client.ts"></script>
Expand All @@ -114,7 +116,7 @@ const groups = [
width: 100%;
background: yellow;
}
legend {
summary > span {
font-weight: bold;
padding: 10px;
cursor: pointer;
Expand Down
9 changes: 5 additions & 4 deletions src/components/SwitchInput/SwitchInput.astro
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
---
interface Props {
name: string;
checked?: boolean;
name?: string;
checked?: boolean | string;
[key: string]: unknown;
}
const { name, checked, ...props } = Astro.props;
---

<input
{...props}
name={name}
checked={checked}
role='checkbox'
checked={ checked ? 'checked' : undefined }
role='switch'
type='checkbox'
is='switch-input'
/>
Expand Down

0 comments on commit e03d8fa

Please sign in to comment.