diff --git a/frontend/__tests__/components/Button.spec.tsx b/frontend/__tests__/components/Button.spec.tsx index ba13e6ee0581..e78e9e3eabc9 100644 --- a/frontend/__tests__/components/Button.spec.tsx +++ b/frontend/__tests__/components/Button.spec.tsx @@ -1,3 +1,4 @@ +import { faKeyboard } from "@fortawesome/free-solid-svg-icons"; import { render, cleanup } from "@solidjs/testing-library"; import { describe, it, expect, vi, afterEach } from "vitest"; @@ -52,7 +53,7 @@ describe("Button component", () => { // }} fa={{ - icon: "keyboard", + icon: faKeyboard, }} /> )); @@ -70,7 +71,7 @@ describe("Button component", () => { // }} fa={{ - icon: "keyboard", + icon: faKeyboard, fixedWidth: true, }} /> @@ -88,7 +89,7 @@ describe("Button component", () => { }} fa={{ fixedWidth: true, - icon: "keyboard", + icon: faKeyboard, }} text="Hello" /> @@ -105,7 +106,7 @@ describe("Button component", () => { // }} fa={{ - icon: "keyboard", + icon: faKeyboard, }} text="Hello" /> diff --git a/frontend/package.json b/frontend/package.json index bac5f695da18..bd6f507f52b5 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -23,6 +23,10 @@ }, "dependencies": { "@date-fns/utc": "1.2.0", + "@fortawesome/fontawesome-svg-core": "7.1.0", + "@fortawesome/free-brands-svg-icons": "5.15.4", + "@fortawesome/free-regular-svg-icons": "5.15.4", + "@fortawesome/free-solid-svg-icons": "5.15.4", "@monkeytype/contracts": "workspace:*", "@monkeytype/funbox": "workspace:*", "@monkeytype/schemas": "workspace:*", @@ -60,7 +64,7 @@ }, "devDependencies": { "@eslint/json": "0.14.0", - "@fortawesome/fontawesome-free": "5.15.4", + "@fortawesome/fontawesome-common-types": "0.2.36", "@monkeytype/oxlint-config": "workspace:*", "@monkeytype/typescript-config": "workspace:*", "@solidjs/testing-library": "0.8.10", @@ -83,7 +87,6 @@ "eslint-plugin-compat": "6.0.2", "eslint-plugin-solid": "0.14.5", "firebase-tools": "13.15.1", - "fontawesome-subset": "4.4.0", "happy-dom": "20.0.10", "jsdom": "27.4.0", "madge": "8.0.0", diff --git a/frontend/src/html/pages/test-result.html b/frontend/src/html/pages/test-result.html index f40f5a3a80f8..88416a6324ed 100644 --- a/frontend/src/html/pages/test-result.html +++ b/frontend/src/html/pages/test-result.html @@ -6,6 +6,7 @@
wpm
+ } > diff --git a/frontend/src/ts/components/common/Fa.module.css b/frontend/src/ts/components/common/Fa.module.css new file mode 100644 index 000000000000..8b2fc65429b7 --- /dev/null +++ b/frontend/src/ts/components/common/Fa.module.css @@ -0,0 +1,12 @@ +.spin { + animation: spin 2s 0s infinite linear; +} + +@keyframes spin { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } +} diff --git a/frontend/src/ts/components/common/Fa.tsx b/frontend/src/ts/components/common/Fa.tsx index aa994ac26dfd..cd829726130d 100644 --- a/frontend/src/ts/components/common/Fa.tsx +++ b/frontend/src/ts/components/common/Fa.tsx @@ -1,28 +1,68 @@ -import { JSXElement } from "solid-js"; +import { IconDefinition } from "@fortawesome/fontawesome-common-types"; +import { createMemo, JSXElement, Show } from "solid-js"; -import { FaObject } from "../../types/font-awesome"; +import style from "./Fa.module.css"; export type FaProps = { fixedWidth?: boolean; spin?: boolean; size?: number; -} & FaObject; + icon: IconDefinition; +}; export function Fa(props: FaProps): JSXElement { - const variant = (): string => props.variant ?? "solid"; + const i = createMemo(() => props.icon?.icon); + return ( - + + viewBox={`0 0 ${i()[0]} ${i()[1]}`} + aria-hidden="true" + xmlns="http://www.w3.org/2000/svg" + > + + {/* */} + + + + + } + > + + + + + //
); } diff --git a/frontend/src/ts/components/layout/footer/Footer.tsx b/frontend/src/ts/components/layout/footer/Footer.tsx index fd6dbe21c6ba..847768108bc7 100644 --- a/frontend/src/ts/components/layout/footer/Footer.tsx +++ b/frontend/src/ts/components/layout/footer/Footer.tsx @@ -1,3 +1,12 @@ +import { faDiscord, faTwitter } from "@fortawesome/free-brands-svg-icons"; +import { + faCode, + faDonate, + faEnvelope, + faFileContract, + faLock, + faShieldAlt, +} from "@fortawesome/free-solid-svg-icons"; import { JSXElement } from "solid-js"; import { getFocus, getIsScreenshotting } from "../../../signals/core"; @@ -17,7 +26,6 @@ export function Footer(): JSXElement { })} > -
showModal("Contact")} @@ -38,7 +46,7 @@ export function Footer(): JSXElement { type="text" text="support" fa={{ - icon: "donate", + icon: faDonate, fixedWidth: true, }} onClick={() => showModal("Support")} @@ -47,7 +55,7 @@ export function Footer(): JSXElement { type="text" text="github" fa={{ - icon: "code", + icon: faCode, fixedWidth: true, }} href="https://github.com/monkeytypegame/monkeytype" @@ -56,8 +64,7 @@ export function Footer(): JSXElement { type="text" text="discord" fa={{ - icon: "discord", - variant: "brand", + icon: faDiscord, fixedWidth: true, }} href="https://www.discord.gg/monkeytype" @@ -66,8 +73,7 @@ export function Footer(): JSXElement { type="text" text="twitter" fa={{ - icon: "twitter", - variant: "brand", + icon: faTwitter, fixedWidth: true, }} href="https://x.com/monkeytype" @@ -76,7 +82,7 @@ export function Footer(): JSXElement { type="text" text="terms" fa={{ - icon: "file-contract", + icon: faFileContract, fixedWidth: true, }} href="/terms-of-service.html" @@ -86,7 +92,7 @@ export function Footer(): JSXElement { type="text" text="security" fa={{ - icon: "shield-alt", + icon: faShieldAlt, fixedWidth: true, }} /> @@ -95,7 +101,7 @@ export function Footer(): JSXElement { type="text" text="privacy" fa={{ - icon: "lock", + icon: faLock, fixedWidth: true, }} /> diff --git a/frontend/src/ts/components/layout/footer/ScrollToTop.tsx b/frontend/src/ts/components/layout/footer/ScrollToTop.tsx index 7c6238a0bb2f..db67d006ecb2 100644 --- a/frontend/src/ts/components/layout/footer/ScrollToTop.tsx +++ b/frontend/src/ts/components/layout/footer/ScrollToTop.tsx @@ -1,3 +1,4 @@ +import { faAngleDoubleUp } from "@fortawesome/free-solid-svg-icons"; import { JSXElement, createSignal, onMount, onCleanup } from "solid-js"; import { getActivePage } from "../../../signals/core"; @@ -43,7 +44,7 @@ export function ScrollToTop(): JSXElement { }); }} > - +
); diff --git a/frontend/src/ts/components/layout/footer/ThemeIndicator.tsx b/frontend/src/ts/components/layout/footer/ThemeIndicator.tsx index ed4d13ff6098..d661098adbb7 100644 --- a/frontend/src/ts/components/layout/footer/ThemeIndicator.tsx +++ b/frontend/src/ts/components/layout/footer/ThemeIndicator.tsx @@ -1,3 +1,4 @@ +import { faPalette, faStar } from "@fortawesome/free-solid-svg-icons"; import { JSXElement, Show } from "solid-js"; import * as Commandline from "../../../commandline/commandline"; @@ -43,10 +44,10 @@ export function ThemeIndicator(): JSXElement {
- +
- +
{getThemeIndicator().text}
diff --git a/frontend/src/ts/components/layout/footer/VersionButton.tsx b/frontend/src/ts/components/layout/footer/VersionButton.tsx index a335878452e0..db013fea6264 100644 --- a/frontend/src/ts/components/layout/footer/VersionButton.tsx +++ b/frontend/src/ts/components/layout/footer/VersionButton.tsx @@ -1,3 +1,4 @@ +import { faCodeBranch } from "@fortawesome/free-solid-svg-icons"; import { COMPATIBILITY_CHECK } from "@monkeytype/contracts"; import { JSXElement, Show, createSignal } from "solid-js"; import { envConfig } from "virtual:env-config"; @@ -46,7 +47,7 @@ export function VersionButton(): JSXElement { return ( } /> diff --git a/frontend/src/ts/components/layout/overlays/Overlays.tsx b/frontend/src/ts/components/layout/overlays/Overlays.tsx index 0c66dd4f836b..18541c1abeac 100644 --- a/frontend/src/ts/components/layout/overlays/Overlays.tsx +++ b/frontend/src/ts/components/layout/overlays/Overlays.tsx @@ -1,3 +1,4 @@ +import { faTerminal } from "@fortawesome/free-solid-svg-icons"; import { JSXElement } from "solid-js"; import { getIsScreenshotting } from "../../../signals/core"; @@ -29,7 +30,7 @@ export function Overlays(): JSXElement { }} tabIndex="-1" > - + diff --git a/frontend/src/ts/components/modals/ContactModal.tsx b/frontend/src/ts/components/modals/ContactModal.tsx index 6df442935430..7d9a848bb792 100644 --- a/frontend/src/ts/components/modals/ContactModal.tsx +++ b/frontend/src/ts/components/modals/ContactModal.tsx @@ -1,3 +1,11 @@ +import { + faQuestionCircle, + faCommentDots, + faBug, + faUserCircle, + faBriefcase, + faEllipsisH, +} from "@fortawesome/free-solid-svg-icons"; import { JSXElement } from "solid-js"; import { AnimatedModal } from "../common/AnimatedModal"; @@ -25,7 +33,7 @@ export function ContactModal(): JSXElement { text="Question" class={buttonClass} fa={{ - icon: "question-circle", + icon: faQuestionCircle, fixedWidth: true, }} /> @@ -33,7 +41,7 @@ export function ContactModal(): JSXElement { type="button" href="mailto:contact@monkeytype.com?subject=[Feedback] " fa={{ - icon: "comment-dots", + icon: faCommentDots, fixedWidth: true, }} text="Feedback" @@ -43,7 +51,7 @@ export function ContactModal(): JSXElement { type="button" href="mailto:support@monkeytype.com?subject=[Bug] " fa={{ - icon: "bug", + icon: faBug, fixedWidth: true, }} text="Bug Report" @@ -53,7 +61,7 @@ export function ContactModal(): JSXElement { type="button" href="mailto:support@monkeytype.com?subject=[Account] " fa={{ - icon: "user-circle", + icon: faUserCircle, fixedWidth: true, }} text="Account Help" @@ -63,7 +71,7 @@ export function ContactModal(): JSXElement { type="button" href="mailto:jack@monkeytype.com?subject=[Business] " fa={{ - icon: "briefcase", + icon: faBriefcase, fixedWidth: true, }} text="Business Inquiry" @@ -73,7 +81,7 @@ export function ContactModal(): JSXElement { type="button" href="mailto:contact@monkeytype.com?subject=[Other] " fa={{ - icon: "ellipsis-h", + icon: faEllipsisH, fixedWidth: true, }} text="Other" diff --git a/frontend/src/ts/components/modals/SupportModal.tsx b/frontend/src/ts/components/modals/SupportModal.tsx index c60b3b33710e..f0a00cffaf75 100644 --- a/frontend/src/ts/components/modals/SupportModal.tsx +++ b/frontend/src/ts/components/modals/SupportModal.tsx @@ -1,3 +1,10 @@ +import { faPatreon } from "@fortawesome/free-brands-svg-icons"; +import { + faAd, + faDonate, + faHeart, + faTshirt, +} from "@fortawesome/free-solid-svg-icons"; import { JSXElement } from "solid-js"; import { setCommandlineSubgroup } from "../../signals/core"; @@ -19,7 +26,7 @@ export function SupportModal(): JSXElement {
Thank you so much for thinking about supporting this project. It would not be possible without you and your continued support.{" "} - +
@@ -241,13 +261,13 @@ export function AboutPage(): JSXElement { class="ad advertisement ad-h-s place-self-center" >
- +
-

+

After completing a test you will be able to see your wpm, raw wpm, accuracy, character stats, test length, leaderboards info and test @@ -259,7 +279,7 @@ export function AboutPage(): JSXElement {

-

+

If you encounter a bug, or have a feature request - join the Discord server, send me an email, a direct message on Twitter or create an @@ -268,7 +288,7 @@ export function AboutPage(): JSXElement {

-

+

Thanks to everyone who has supported this project. It would not be possible without you and your continued support. @@ -276,7 +296,7 @@ export function AboutPage(): JSXElement {

-

+

If you encounter a bug, have a feature request or just want to say hi - here are the different ways you can contact me directly. @@ -294,25 +314,25 @@ export function AboutPage(): JSXElement {

-

+