refactor(app): switch to @phosphor-icons/core and format files

This commit is contained in:
rektdeckard
2023-01-08 02:10:49 -07:00
parent b708d823a7
commit 2a030b08cd
16 changed files with 66 additions and 10426 deletions

View File

@@ -1,8 +1,8 @@
import React from 'react';
import { render } from '@testing-library/react';
import App from './App';
import React from "react";
import { render } from "@testing-library/react";
import App from "./App";
test('renders learn react link', () => {
test("renders learn react link", () => {
const { getByText } = render(<App />);
const linkElement = getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();

View File

@@ -5,13 +5,16 @@ interface ErrorBoundaryProps {
}
interface ErrorBoundaryState {
errorMessage?: string
errorMessage?: string;
}
export default class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
export default class ErrorBoundary extends React.Component<
ErrorBoundaryProps,
ErrorBoundaryState
> {
constructor(props: any) {
super(props);
this.state = { errorMessage: "" }
this.state = { errorMessage: "" };
}
static getDerivedStateFromError(error: any) {

View File

@@ -34,8 +34,8 @@ const Footer: React.FC<FooterProps> = () => {
a little quirky, too.
</p>
<p>
We're thankful for the tools we've benefited from and
this is our contribution towards a collaborative community.
We're thankful for the tools we've benefited from and this is our
contribution towards a collaborative community.
</p>
<p>
Phosphor is free and open-source, licensed under{" "}

View File

@@ -11,7 +11,11 @@ interface NoticeProps {
type?: "wait" | "help" | "warn" | "none";
}
const Notice: React.FC<NoticeProps> = ({ message, type = "warn", children }) => {
const Notice: React.FC<NoticeProps> = ({
message,
type = "warn",
children,
}) => {
const isDark = useRecoilValue(isDarkThemeSelector);
const query = useRecoilValue(searchQueryAtom);

View File

@@ -19,7 +19,8 @@ type SearchInputProps = {};
const SearchInput: React.FC<SearchInputProps> = () => {
const [value, setValue] = useState<string>("");
const [query, setQuery] = useRecoilState(searchQueryAtom);
const inputRef = useRef<HTMLInputElement>() as MutableRefObject<HTMLInputElement>;
const inputRef =
useRef<HTMLInputElement>() as MutableRefObject<HTMLInputElement>;
useHotkeys("ctrl+k,cmd+k", (e) => {
e.preventDefault();

View File

@@ -2,9 +2,9 @@ import React, { useMemo } from "react";
import { useRecoilState } from "recoil";
import Select from "react-dropdown-select";
import { PencilLine } from "phosphor-react";
import { IconStyle } from "@phosphor-icons/core";
import { iconWeightAtom } from "../../state/atoms";
import { IconStyle } from "../../lib";
import "./StyleInput.css";
type WeightOption = { key: string; value: IconStyle; icon: JSX.Element };