Skip to content

Commit

Permalink
tools(lint): Apply lint fix for TS
Browse files Browse the repository at this point in the history
  • Loading branch information
oxodao committed Dec 15, 2024
1 parent f117d9c commit 3e65153
Show file tree
Hide file tree
Showing 47 changed files with 169 additions and 708 deletions.
6 changes: 2 additions & 4 deletions admin/src/assets/css/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ body,
--fg-yellow-shadow: 0 0 2px #393a33, 0 0 8px #f39f05, 0 0 2px #f39f05;

--fg-blue: #fdfdfd;
--fg-blue-shadow: 0 0 2px #001716, 0 0 3px #03edf9, 0 0 5px #03edf9,
0 0 8px #03edf9;
--fg-blue-shadow: 0 0 2px #001716, 0 0 3px #03edf9, 0 0 5px #03edf9, 0 0 8px #03edf9;

--fg-red: #fff5f6;
--fg-red-shadow: 0 0 2px #000, 0 0 10px #fc1f2c, 0 0 5px #fc1f2c,
0 0 25px #fc1f2c;
--fg-red-shadow: 0 0 2px #000, 0 0 10px #fc1f2c, 0 0 5px #fc1f2c, 0 0 25px #fc1f2c;

--fg-green: #72f1b8;
--fg-green-shadow: 0 0 2px #100c0f, 0 0 10px #257c55, 0 0 35px #212724;
Expand Down
6 changes: 1 addition & 5 deletions admin/src/assets/css/loader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
height: 56px;
border-radius: 50%;
background: conic-gradient(#0000 10%, #61e39c);
-webkit-mask: radial-gradient(
farthest-side,
#0000 calc(100% - 9px),
#000 0
);
-webkit-mask: radial-gradient(farthest-side, #0000 calc(100% - 9px), #000 0);
animation: spinner-zp9dbg 1s infinite linear;
}

Expand Down
10 changes: 2 additions & 8 deletions admin/src/components/event_card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@ export default function EventCard({ event }: { event: PhEvent }) {

return (
<Card title={<EventTitle event={event} />}>
{event.date && (
<KeyVal label={t('generic.date')}>
{event?.date.toFormat('yyyy/MM/dd - hh:mm')}
</KeyVal>
)}
{event.location && (
<KeyVal label={t('generic.location')}>{event.location}</KeyVal>
)}
{event.date && <KeyVal label={t('generic.date')}>{event?.date.toFormat('yyyy/MM/dd - hh:mm')}</KeyVal>}
{event.location && <KeyVal label={t('generic.location')}>{event.location}</KeyVal>}
</Card>
);
}
38 changes: 6 additions & 32 deletions admin/src/components/event_form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,7 @@ export default function EventForm({ event, onSaved }: Props) {

let formEvent = event;
if (!formEvent) {
formEvent = new PhEvent(
null,
data.name,
data.author,
data.date,
data.location,
data.nexusId
);
formEvent = new PhEvent(null, data.name, data.author, data.date, data.location, data.nexusId);
} else {
formEvent.name = data.name;
formEvent.author = data.author;
Expand Down Expand Up @@ -111,8 +104,7 @@ export default function EventForm({ event, onSaved }: Props) {
console.error(e);
notif.error({
message: 'Failed to create event on PartyNexus',
description:
'The event was not created due to an issue. See console for more detail',
description: 'The event was not created due to an issue. See console for more detail',
});
}

Expand All @@ -124,36 +116,22 @@ export default function EventForm({ event, onSaved }: Props) {
};

return (
<Form
layout="vertical"
style={{ width: 500 }}
variant="filled"
onFinish={handleSubmit(submit)}
>
<Form layout="vertical" style={{ width: 500 }} variant="filled" onFinish={handleSubmit(submit)}>
<FormItem control={control} name="name" label={tG('name')} required>
<Input />
</FormItem>
<FormItem control={control} name="author" label={tG('author')}>
<Input />
</FormItem>
<FormItem control={control} name="date" label={tG('date')} required>
<DatePicker
style={{ width: '100%' }}
format="DD/MM/YYYY hh:mm"
showTime
/>
<DatePicker style={{ width: '100%' }} format="DD/MM/YYYY hh:mm" showTime />
</FormItem>
<FormItem control={control} name="location" label={tG('location')}>
<Input />
</FormItem>

<Flex align="center" gap={8}>
<FormItem
control={control}
name="nexusId"
label="Nexus ID"
style={{ flex: '1' }}
>
<FormItem control={control} name="nexusId" label="Nexus ID" style={{ flex: '1' }}>
<Input />
</FormItem>

Expand All @@ -167,11 +145,7 @@ export default function EventForm({ event, onSaved }: Props) {
</Flex>

<Form.Item>
<Button
type="primary"
htmlType="submit"
style={{ width: '100%' }}
>
<Button type="primary" htmlType="submit" style={{ width: '100%' }}>
{tG('actions.' + (event?.id ? 'save' : 'create'))}
</Button>
</Form.Item>
Expand Down
8 changes: 1 addition & 7 deletions admin/src/components/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,5 @@ type Props = {
};

export default function Image({ hasImage, className, src, alt }: Props) {
return (
<img
className={className}
src={!hasImage && hasImage !== undefined ? PlaceHolderCover : src}
alt={alt}
/>
);
return <img className={className} src={!hasImage && hasImage !== undefined ? PlaceHolderCover : src} alt={alt} />;
}
37 changes: 7 additions & 30 deletions admin/src/components/karaoke/current_card.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import '../../assets/css/song_card.scss';
import { Button, Card, Flex, Popconfirm, Tooltip, Typography } from 'antd';
import {
IconPlayerPause,
IconPlayerPlay,
IconRecordMail,
IconVolume,
IconX,
} from '@tabler/icons-react';
import { IconPlayerPause, IconPlayerPlay, IconRecordMail, IconVolume, IconX } from '@tabler/icons-react';
import Image from '../image';
import TextSlider from '../text_slider';
import VolumeSlider from './volume_slider';
Expand Down Expand Up @@ -39,9 +33,7 @@ export default function CurrentCard() {
return;
}

await api.karaoke.cancelSession(
karaoke.current.id,
);
await api.karaoke.cancelSession(karaoke.current.id);
};

return (
Expand All @@ -58,12 +50,8 @@ export default function CurrentCard() {
/>

<Flex vertical flex={1}>
<Typography.Text className="SongCard__Title">
{karaoke.current.title}
</Typography.Text>
<Typography.Text>
{karaoke.current.artist}
</Typography.Text>
<Typography.Text className="SongCard__Title">{karaoke.current.title}</Typography.Text>
<Typography.Text>{karaoke.current.artist}</Typography.Text>
<Typography.Text className="SongCard__Singer">
{t('singer')}: {karaoke.current.sung_by}
</Typography.Text>
Expand Down Expand Up @@ -94,10 +82,7 @@ export default function CurrentCard() {
okText={tG('actions.ok')}
cancelText={tG('actions.cancel')}
>
<Button
icon={<IconX size={20} />}
shape="circle"
/>
<Button icon={<IconX size={20} />} shape="circle" />
</Popconfirm>
</Tooltip>
</Flex>
Expand All @@ -120,17 +105,9 @@ export default function CurrentCard() {
disabled
/>

<VolumeSlider
type="instrumental"
icon={<IconVolume size={20} />}
tooltip={t('volume')}
/>
<VolumeSlider type="instrumental" icon={<IconVolume size={20} />} tooltip={t('volume')} />
{karaoke.current.song.has_vocals && (
<VolumeSlider
type="vocals"
icon={<IconRecordMail size={20} />}
tooltip={t('voices')}
/>
<VolumeSlider type="vocals" icon={<IconRecordMail size={20} />} tooltip={t('voices')} />
)}
</Flex>
</Card>
Expand Down
21 changes: 4 additions & 17 deletions admin/src/components/karaoke/session_card.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import '../../assets/css/song_card.scss';
import { Button, Card, Flex, Popconfirm, Tooltip, Typography } from 'antd';
import {
IconCaretDownFilled,
IconCaretUpFilled,
IconPlayerPlayFilled,
IconTrash,
} from '@tabler/icons-react';
import { IconCaretDownFilled, IconCaretUpFilled, IconPlayerPlayFilled, IconTrash } from '@tabler/icons-react';
import Image from '../image';
import { PhSongSession } from '@partyhall/sdk';
import { useAuth } from '../../hooks/auth';
Expand Down Expand Up @@ -77,9 +72,7 @@ export default function SessionCard({ session, isFirst, isLast }: Props) {
/>

<Flex vertical flex={1}>
<Typography.Text className="SongCard__Title">
{session.title}
</Typography.Text>
<Typography.Text className="SongCard__Title">{session.title}</Typography.Text>
<Typography.Text>{session.artist}</Typography.Text>
<Typography.Text className="SongCard__Singer">
{t('singer')}: {session.sung_by}
Expand All @@ -93,10 +86,7 @@ export default function SessionCard({ session, isFirst, isLast }: Props) {
okText={tG('actions.ok')}
cancelText={tG('actions.cancel')}
>
<Button
icon={<IconPlayerPlayFilled size={18} />}
shape="circle"
/>
<Button icon={<IconPlayerPlayFilled size={18} />} shape="circle" />
</Popconfirm>
</Tooltip>
<Tooltip title={tG('actions.cancel')}>
Expand All @@ -106,10 +96,7 @@ export default function SessionCard({ session, isFirst, isLast }: Props) {
okText={tG('actions.ok')}
cancelText={tG('actions.cancel')}
>
<Button
icon={<IconTrash size={18} />}
shape="circle"
/>
<Button icon={<IconTrash size={18} />} shape="circle" />
</Popconfirm>
</Tooltip>
</Flex>
Expand Down
31 changes: 6 additions & 25 deletions admin/src/components/karaoke/song_card.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import '../../assets/css/song_card.scss';

import { Button, Card, Flex, Popconfirm, Tooltip, Typography } from 'antd';
import {
IconCirclePlus,
IconMicrophone,
IconPiano,
IconPlayerPlay,
IconVinyl,
} from '@tabler/icons-react';
import { IconCirclePlus, IconMicrophone, IconPiano, IconPlayerPlay, IconVinyl } from '@tabler/icons-react';
import Image from '../image';
import { PhSong } from '@partyhall/sdk';
import { useAuth } from '../../hooks/auth';
Expand Down Expand Up @@ -63,29 +57,19 @@ export default function SongCard({ song, type }: Props) {
/>

<Flex vertical flex={1}>
<Typography.Text className="SongCard__Title">
{song.title}
</Typography.Text>
<Typography.Text className="SongCard__Title">{song.title}</Typography.Text>
<Typography.Text>{song.artist}</Typography.Text>
<Typography.Text className="SongCard__Format">
{song.format}
</Typography.Text>
<Typography.Text className="SongCard__Format">{song.format}</Typography.Text>

<Flex gap={8} className="SongCard__Tracks">
<Tooltip title={t('instrumental')}>
<IconPiano size={20} color="#fafa" />
</Tooltip>
<Tooltip title={t('vocals')}>
<IconMicrophone
size={20}
color={song.has_vocals ? '#fafa' : '#777'}
/>
<IconMicrophone size={20} color={song.has_vocals ? '#fafa' : '#777'} />
</Tooltip>
<Tooltip title={t('full_song')}>
<IconVinyl
size={20}
color={song.has_combined ? '#fafa' : '#777'}
/>
<IconVinyl size={20} color={song.has_combined ? '#fafa' : '#777'} />
</Tooltip>
</Flex>
</Flex>
Expand All @@ -99,10 +83,7 @@ export default function SongCard({ song, type }: Props) {
cancelText={tG('actions.cancel')}
onConfirm={() => addToQueue(true)}
>
<Button
icon={<IconPlayerPlay size={20} />}
shape="circle"
/>
<Button icon={<IconPlayerPlay size={20} />} shape="circle" />
</Popconfirm>
</Tooltip>
)}
Expand Down
22 changes: 4 additions & 18 deletions admin/src/components/karaoke/song_queue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,8 @@ export default function SongQueue() {
}

return (
<Flex
vertical
gap={8}
className="fullheight overflowAuto"
align="center"
>
<Flex
vertical
style={{ width: 'min(500px, 100%)' }}
className="fullheight overflowAuto"
>
<Flex vertical gap={8} className="fullheight overflowAuto" align="center">
<Flex vertical style={{ width: 'min(500px, 100%)' }} className="fullheight overflowAuto">
{karaoke.current && <CurrentCard />}

<Typography.Title>{t('in_queue')}</Typography.Title>
Expand All @@ -34,16 +25,11 @@ export default function SongQueue() {
key={x.id}
session={x}
isFirst={karaokeQueue[0].id === x.id}
isLast={
karaokeQueue[karaokeQueue.length - 1].id ===
x.id
}
isLast={karaokeQueue[karaokeQueue.length - 1].id === x.id}
/>
))}
{karaokeQueue.length === 0 && (
<Typography.Title level={3}>
{t('no_songs_in_queue')}
</Typography.Title>
<Typography.Title level={3}>{t('no_songs_in_queue')}</Typography.Title>
)}
</Flex>
</Flex>
Expand Down
Loading

0 comments on commit 3e65153

Please sign in to comment.