Skip to content

Commit

Permalink
Updated icons to use FA
Browse files Browse the repository at this point in the history
  • Loading branch information
jLynx committed Jan 15, 2024
1 parent e7c2cc1 commit 6353692
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
12 changes: 9 additions & 3 deletions src/components/Controller/Controller.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
"use client";

import {
faRotate,
faRotateLeft,
faRotateRight,
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import React, { ChangeEvent, useEffect, useRef, useState } from "react";
import { LatestVersions } from "@/app/models";
import { parseDirectories } from "@/utils/fileUtils";
Expand Down Expand Up @@ -287,7 +293,7 @@ const Controller = () => {
}}
/>
<HotkeyButton
label="🔄"
label={<FontAwesomeIcon icon={faRotate} />}
disabled={disableTransmitAction}
onClickFunction={() => {
if (!disableTransmitAction) {
Expand Down Expand Up @@ -356,7 +362,7 @@ const Controller = () => {
onClick={() => write("button 7", autoUpdateFrame)}
className="h-12 w-12 self-end justify-self-start rounded bg-blue-400 text-white disabled:opacity-50"
>
↪️
<FontAwesomeIcon icon={faRotateLeft} />
</button>
<HotkeyButton
label="Up"
Expand Down Expand Up @@ -392,7 +398,7 @@ const Controller = () => {
onClick={() => write("button 8", autoUpdateFrame)}
className="h-12 w-12 self-end justify-self-end rounded bg-blue-400 text-white disabled:opacity-50"
>
↩️
<FontAwesomeIcon icon={faRotateRight} />
</button>
</div>
</div>
Expand Down
6 changes: 4 additions & 2 deletions src/components/DeviceButtons/DeviceButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { faRotateLeft, faRotateRight } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useWriteCommand } from "@/utils/serialUtils";
import HotkeyButton from "../HotkeyButton/HotkeyButton";

Expand Down Expand Up @@ -60,7 +62,7 @@ export const DeviceButtons = ({
onClick={() => write("button 7", autoUpdateFrame)}
className="h-12 w-12 self-end justify-self-start rounded bg-blue-400 text-white disabled:opacity-50"
>
↪️
<FontAwesomeIcon icon={faRotateLeft} />
</button>
<HotkeyButton
label="Up"
Expand Down Expand Up @@ -96,7 +98,7 @@ export const DeviceButtons = ({
onClick={() => write("button 8", autoUpdateFrame)}
className="h-12 w-12 self-end justify-self-end rounded bg-blue-400 text-white disabled:opacity-50"
>
↩️
<FontAwesomeIcon icon={faRotateRight} />
</button>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/components/HotkeyButton/HotkeyButton.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ReactNode } from "react";
import { useHotkeys } from "react-hotkeys-hook";

interface IHotkeyButton {
Expand All @@ -8,7 +9,7 @@ interface IHotkeyButton {
/**
* Text to display on button
*/
label?: string;
label?: string | ReactNode;
/**
* Comma-separated string of shortcutkeys
*/
Expand Down

0 comments on commit 6353692

Please sign in to comment.