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

feat: add support actions #15

Merged
merged 1 commit into from
Sep 11, 2024
Merged
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
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",
);
});
});