Skip to content

Commit

Permalink
Run prettier on all src files
Browse files Browse the repository at this point in the history
  • Loading branch information
eriktm committed Oct 7, 2023
1 parent 9e1fa6a commit b8c4fdc
Show file tree
Hide file tree
Showing 40 changed files with 358 additions and 359 deletions.
4 changes: 2 additions & 2 deletions src/components/Button/PrimaryButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ButtonHTMLAttributes, DetailedHTMLProps } from 'react';
import React, { ButtonHTMLAttributes, DetailedHTMLProps } from "react";

interface Props extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
loading?: string;
Expand All @@ -8,7 +8,7 @@ export const PrimaryButton: React.FC<Props> = ({ loading, children, className, .
return (
<button
className={`py-2 px-7 hover:scale-105 rounded-lg flex justify-center items-center text-white transition-all duration-150 bg-tg-brand-orange-500 hover:bg-tg-brand-orange-600 hover:font-semibold ${
className ?? ''
className ?? ""
}`}
{...props}
>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Button/SecondaryButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ButtonHTMLAttributes, DetailedHTMLProps } from 'react';
import React, { ButtonHTMLAttributes, DetailedHTMLProps } from "react";

interface Props extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
loading?: string;
Expand All @@ -8,7 +8,7 @@ export const SecondaryButton: React.FC<Props> = ({ loading, children, className,
return (
<button
className={`py-2 px-7 hover:scale-105 hover:font-semibold rounded-lg flex justify-center items-center text-tg-brand-orange-500 transition-all duration-150 border-2 border-tg-brand-orange-500 hover:border-tg-brand-orange-600 ${
className ?? ''
className ?? ""
}`}
{...props}
>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { Button } from './Button';
export { PrimaryButton } from './PrimaryButton';
export { SecondaryButton } from './SecondaryButton';
export { Button } from "./Button";
export { PrimaryButton } from "./PrimaryButton";
export { SecondaryButton } from "./SecondaryButton";
4 changes: 2 additions & 2 deletions src/components/ErrorBoundary/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { ErrorInfo } from 'react';
import * as Sentry from '@sentry/browser';
import React, { ErrorInfo } from "react";
import * as Sentry from "@sentry/browser";

class ErrorBoundary extends React.Component {
state = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ErrorBoundary/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { ErrorBoundary } from './ErrorBoundary';
export { ErrorBoundary } from "./ErrorBoundary";
2 changes: 1 addition & 1 deletion src/components/Input/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { Input } from './Input';
export { Input } from "./Input";
10 changes: 5 additions & 5 deletions src/components/Link/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Link as RRDLink } from 'react-router-dom';
import type { LinkProps } from 'react-router-dom';
import React from "react";
import { Link as RRDLink } from "react-router-dom";
import type { LinkProps } from "react-router-dom";

interface Props extends LinkProps {
className?: string;
Expand All @@ -12,9 +12,9 @@ export const Link = ({ className, inline, ...props }: Props) => {
<RRDLink
{...props}
className={`py-1 ${
inline ? 'hover:px-2 px-0' : 'px-1'
inline ? "hover:px-2 px-0" : "px-1"
} text-indigo-700 dark:text-indigo-300 underline transition-all duration-150 rounded-sm hover:text-indigo-900 hover:bg-indigo-200 dark:hover:text-indigo-100 dark:hover:bg-indigo-700 ${
className ?? ''
className ?? ""
}`}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Link/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { Link } from './Link';
export { Link } from "./Link";
14 changes: 7 additions & 7 deletions src/components/MusicPlayer/MusicPlayer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useRef, useState } from 'react';
import React, { useEffect, useRef, useState } from "react";

interface Props {
src: string;
Expand All @@ -16,7 +16,7 @@ export const MusicPlayer = ({ src }: Props) => {
useEffect(() => {
if (isPlaying) {
player.play().catch((e) => {
setPlayerError('Could not play this file');
setPlayerError("Could not play this file");
});
} else {
player.pause();
Expand All @@ -32,17 +32,17 @@ export const MusicPlayer = ({ src }: Props) => {
}, [playerTime]);

useEffect(() => {
player.addEventListener('canplay', () => setCanPlay(true));
player.addEventListener("canplay", () => setCanPlay(true));
}, [player]);

useEffect(() => {
player.addEventListener('ended', () => setIsPlaying(false));
player.addEventListener('timeupdate', (e) => {
player.addEventListener("ended", () => setIsPlaying(false));
player.addEventListener("timeupdate", (e) => {
console.log(e.target.currentTime);
setPlayerTime(e.target?.currentTime);
});
return () => {
player.removeEventListener('ended', () => setIsPlaying(false));
player.removeEventListener("ended", () => setIsPlaying(false));
};
}, [canPlay]);

Expand All @@ -52,7 +52,7 @@ export const MusicPlayer = ({ src }: Props) => {

return (
<>
<button onClick={() => setIsPlaying(!isPlaying)}>{isPlaying ? 'pause' : 'play'}</button>
<button onClick={() => setIsPlaying(!isPlaying)}>{isPlaying ? "pause" : "play"}</button>
<input
type="range"
ref={seekerRef}
Expand Down
2 changes: 1 addition & 1 deletion src/components/MusicPlayer/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { MusicPlayer } from './MusicPlayer';
export { MusicPlayer } from "./MusicPlayer";
8 changes: 4 additions & 4 deletions src/components/ProtectedRoute/ProtectedRoute.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useMemo } from 'react';
import { useUserState } from '../../context/Auth';
import { hasPermission as objectHasPermission, Permission } from '../../utils/permissions';
import React, { useMemo } from "react";
import { useUserState } from "../../context/Auth";
import { hasPermission as objectHasPermission, Permission } from "../../utils/permissions";

interface Props {
requiredRole?: 'crew' | 'particpant' | 'jury' | 'anon' | 'other';
requiredRole?: "crew" | "particpant" | "jury" | "anon" | "other";
requiredPermission?: Permission | Permission[];
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/ProtectedRoute/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { ProtectedRoute } from './ProtectedRoute';
export { ProtectedRoute } from "./ProtectedRoute";
2 changes: 1 addition & 1 deletion src/components/Select/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { Select } from './Select';
export { Select } from "./Select";
4 changes: 2 additions & 2 deletions src/components/View/View.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import React from "react";

interface IProps {
className?: string;
}

export const View: React.FC<React.PropsWithChildren<IProps>> = ({ children, className }) => {
return <main className={`${className ?? ''}`}>{children}</main>;
return <main className={`${className ?? ""}`}>{children}</main>;
};
2 changes: 1 addition & 1 deletion src/components/View/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { View } from './View';
export { View } from "./View";
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import { PrimaryButton, SecondaryButton } from '../../../components/Button';
import { Input } from '../../../components/Input';
import { Select } from '../../../components/Select';
import { Link } from './Link';
import React from "react";
import { PrimaryButton, SecondaryButton } from "../../../components/Button";
import { Input } from "../../../components/Input";
import { Select } from "../../../components/Select";
import { Link } from "./Link";

type Destinations = 'twitch' | 'discord' | 'facebook' | 'gathering.org';
type Destinations = "twitch" | "discord" | "facebook" | "gathering.org";

interface ILink {
href: string;
Expand All @@ -21,7 +21,7 @@ export const CompetitionLinksEdit = ({ label, onChange, value }: IProps) => {
const handleChangeDestination = (index: number, e: Destinations) => {
const newLinkList = [...value];
newLinkList[index] = {
...(newLinkList[index] ?? { href: '' }),
...(newLinkList[index] ?? { href: "" }),
destination: e,
};
onChange(newLinkList);
Expand All @@ -35,22 +35,22 @@ export const CompetitionLinksEdit = ({ label, onChange, value }: IProps) => {
onChange(value.filter((_, i) => i !== index));
};
const handleAdd = () => {
onChange([...value, ({ destination: '', href: '' } as unknown) as ILink]);
onChange([...value, { destination: "", href: "" } as unknown as ILink]);
};

return (
<fieldset>
<legend className="mb-2">{label ?? 'Links'}</legend>
<legend className="mb-2">{label ?? "Links"}</legend>
{value.length && (
<ul>
{value.map((val, i) => (
<li key={i} className="flex items-end mb-2">
<Select
options={[
{ label: 'Twitch', value: 'twitch' },
{ label: 'Discord channel', value: 'discord' },
{ label: 'Facebook', value: 'facebook' },
{ label: 'Gathering.org', value: 'gathering.org' },
{ label: "Twitch", value: "twitch" },
{ label: "Discord channel", value: "discord" },
{ label: "Facebook", value: "facebook" },
{ label: "Gathering.org", value: "gathering.org" },
]}
onChange={(e) => handleChangeDestination(i, e)}
value={val.destination}
Expand Down
2 changes: 1 addition & 1 deletion src/features/competitions/CompetitionLinksEdit/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React from "react";

interface IProps {}

Expand Down
2 changes: 1 addition & 1 deletion src/features/competitions/CompetitionLinksEdit/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { CompetitionLinksEdit } from './CompetitionLinksEdit';
export { CompetitionLinksEdit } from "./CompetitionLinksEdit";
2 changes: 1 addition & 1 deletion src/features/competitions/CompetitionPhases/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import CompetitionPhases from './CompetitionPhases';
import CompetitionPhases from "./CompetitionPhases";

export default CompetitionPhases;
2 changes: 1 addition & 1 deletion src/features/competitions/ContributorEditor/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { ContributorEditor } from './ContributorEditor';
export { ContributorEditor } from "./ContributorEditor";
6 changes: 3 additions & 3 deletions src/features/competitions/CreateCompetition/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { GeneralSettings } from './GeneralSettings';
export { Misc } from './Misc';
export { SelectGenre } from './SelectGenre';
export { GeneralSettings } from "./GeneralSettings";
export { Misc } from "./Misc";
export { SelectGenre } from "./SelectGenre";
2 changes: 1 addition & 1 deletion src/features/competitions/EditRegistration/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { EditRegistration } from './EditRegistration';
export { EditRegistration } from "./EditRegistration";
48 changes: 24 additions & 24 deletions src/features/competitions/FileEdit/File.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { useEffect, useState } from 'react';
import { Input } from '../../../components/Input';
import { Select } from '../../../components/Select';
import React, { useEffect, useState } from "react";
import { Input } from "../../../components/Input";
import { Select } from "../../../components/Select";

type FileType = 'archive' | 'music' | 'picture' | 'video';
type InputType = 'main' | 'screenshot' | 'progress1' | 'progress2' | 'progress3' | 'other';
type FileType = "archive" | "music" | "picture" | "video";
type InputType = "main" | "screenshot" | "progress1" | "progress2" | "progress3" | "other";

interface IUploadFile {
input: string;
Expand All @@ -22,9 +22,9 @@ interface IProps {
}

const defaultValue = (forceMain: boolean): IUploadFile => ({
file: 'archive',
input: '',
type: forceMain ? 'main' : 'screenshot',
file: "archive",
input: "",
type: forceMain ? "main" : "screenshot",
});

export const File = ({
Expand Down Expand Up @@ -81,10 +81,10 @@ export const File = ({
value={value.file}
label="File type"
options={[
{ label: 'Music (wav, mp3, flac)', value: 'music' },
{ label: 'Archive (zip, rar)', value: 'archive' },
{ label: 'Picture (png, jpg)', value: 'picture' },
{ label: 'Video (mov, mp4)', value: 'video' },
{ label: "Music (wav, mp3, flac)", value: "music" },
{ label: "Archive (zip, rar)", value: "archive" },
{ label: "Picture (png, jpg)", value: "picture" },
{ label: "Video (mov, mp4)", value: "video" },
]}
/>
<div>
Expand All @@ -98,30 +98,30 @@ export const File = ({
forceMain
? [
{
label: 'Main entry',
value: 'main',
label: "Main entry",
value: "main",
},
]
: [
{
label: 'Screenshot',
value: 'screenshot',
label: "Screenshot",
value: "screenshot",
},
{
label: 'Progress #1',
value: 'progress1',
label: "Progress #1",
value: "progress1",
},
{
label: 'Progress #2',
value: 'progress2',
label: "Progress #2",
value: "progress2",
},
{
label: 'Progress #3',
value: 'progress3',
label: "Progress #3",
value: "progress3",
},
{
label: 'Other',
value: 'other',
label: "Other",
value: "other",
},
]
}
Expand Down
2 changes: 1 addition & 1 deletion src/features/competitions/FileEdit/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { FileEdit } from './FileEdit';
export { FileEdit } from "./FileEdit";
10 changes: 5 additions & 5 deletions src/features/competitions/FileUpload/FileUpload.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import useSWR from 'swr';
import { httpGet } from '../../../utils/fetcher';
import type { ICompetition, IEntry } from '../competition';
import { UploadForm } from './UploadForm';
import React from "react";
import useSWR from "swr";
import { httpGet } from "../../../utils/fetcher";
import type { ICompetition, IEntry } from "../competition";
import { UploadForm } from "./UploadForm";

interface Props {
competition: ICompetition;
Expand Down
Loading

0 comments on commit b8c4fdc

Please sign in to comment.