Skip to content

Commit

Permalink
style: 🎨 format code with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
nstringham committed Dec 1, 2024
1 parent 670019d commit 9764f00
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 47 deletions.
2 changes: 1 addition & 1 deletion src/popup.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
91 changes: 45 additions & 46 deletions src/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,57 +40,56 @@ function rerender() {
<h1 class="md-typescale-title-large">Redirect Origin</h1>
${rules.map(
(rule, i) =>
html`
<md-outlined-text-field
label="Source"
type="url"
value="${rule.source}"
@input=${(event: Event) => {
const input = event.target as HTMLInputElement;
validateUrlInput(input);
rule.source = input.value;
saveToStorage();
}}
>
</md-outlined-text-field>
(rule, i) => html`
<md-outlined-text-field
label="Source"
type="url"
value="${rule.source}"
@input=${(event: Event) => {
const input = event.target as HTMLInputElement;
validateUrlInput(input);
rule.source = input.value;
saveToStorage();
}}
>
</md-outlined-text-field>
<md-icon>
<svg viewBox="0 0 24 24">
<title>Redirects To</title>
<path d=${mdiArrowRightBold} />
</svg>
</md-icon>
<md-outlined-text-field
label="Destination"
type="url"
value=${rule.destination}
@input=${(event: Event) => {
const input = event.target as HTMLInputElement;
validateUrlInput(input);
rule.destination = input.value;
saveToStorage();
}}
>
</md-outlined-text-field>
<md-icon-button
class="delete"
@click=${() => {
rules.splice(i, 1);
rerender();
saveToStorage();
}}
>
<md-icon>
<svg viewBox="0 0 24 24">
<title>Redirects To</title>
<path d=${mdiArrowRightBold} />
<title>Delete</title>
<path d=${mdiDelete} />
</svg>
</md-icon>
<md-outlined-text-field
label="Destination"
type="url"
value=${rule.destination}
@input=${(event: Event) => {
const input = event.target as HTMLInputElement;
validateUrlInput(input);
rule.destination = input.value;
saveToStorage();
}}
>
</md-outlined-text-field>
<md-icon-button
class="delete"
@click=${() => {
rules.splice(i, 1);
rerender();
saveToStorage();
}}
>
<md-icon>
<svg viewBox="0 0 24 24">
<title>Delete</title>
<path d=${mdiDelete} />
</svg>
</md-icon>
</md-icon-button>
`
</md-icon-button>
`,
)}
<md-filled-button
class="new-rule"
Expand Down

0 comments on commit 9764f00

Please sign in to comment.