Skip to content

Commit

Permalink
feat: add links to issues and suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Belar committed Sep 11, 2024
1 parent 50a5db0 commit e67675b
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
15 changes: 15 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,18 @@

padding-bottom: 30px;
}

.icon-menu {
display: flex;
gap: 0.5rem;

padding: 0 0.5rem;
}

[data-theme="dark"] .icon-menu a {
color: var(--df-secondary);
}

[data-theme="light"] .icon-menu a {
color: var(--lf-secondary);
}
24 changes: 22 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
import Select from "./Select";
import LinkTag from "./LinkTag";
import { toSortedBy } from "./sort";
import { ChevronDown, ChevronRight } from "lucide-react";
import { Bug, ChevronDown, ChevronRight, Lightbulb } from "lucide-react";
import { sendMessage } from "./window";

function App() {
Expand Down Expand Up @@ -245,8 +245,28 @@ function App() {
onChange={setSearchPhrase}
/>
</ControlsBar>
<ControlsBar stickTo={"bottom"}>
<ControlsBar stickTo={"bottom"} growFirstItem={true}>
<p className="body-s">{metaBreadcrumbs || ""}</p>
<div className="icon-menu">
<a
href="https://github.com/author-more/all-icons/issues"
title="Report an issue"
target="_blank"
rel="noopener noreferrer"
>
<Bug aria-hidden="true" size={16} />{" "}
<span className="visually-hidden">Report an issue</span>
</a>
<a
href="https://github.com/author-more/all-icons/discussions"
title="Suggest a feature"
target="_blank"
rel="noopener noreferrer"
>
<Lightbulb aria-hidden="true" size={16} />{" "}
<span className="visually-hidden">Suggest a feature</span>
</a>
</div>
</ControlsBar>
{iconGrids}
<p className="caption">
Expand Down
18 changes: 18 additions & 0 deletions tests/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,22 @@ test.describe("app", () => {
const iconButtons = page.getByRole("button", { name: /(Insert icon:).*/ });
expect(await iconButtons.count()).toBeGreaterThan(1);
});

test("has links to report issues and suggest features", async ({ page }) => {
const reportIssueLink = page.getByRole("link", { name: /Report an issue/ });
await expect(reportIssueLink).toBeInViewport();
await expect(reportIssueLink).toHaveAttribute(
"href",
"https://github.com/author-more/all-icons/issues",
);

const suggestFeatureLink = page.getByRole("link", {
name: /Suggest a feature/,
});
await expect(suggestFeatureLink).toBeInViewport();
await expect(suggestFeatureLink).toHaveAttribute(
"href",
"https://github.com/author-more/all-icons/discussions",
);
});
});

0 comments on commit e67675b

Please sign in to comment.