Skip to content

Commit

Permalink
New eslint rule
Browse files Browse the repository at this point in the history
  • Loading branch information
chimpdev committed Oct 22, 2024
1 parent 14e6810 commit 554bb22
Show file tree
Hide file tree
Showing 124 changed files with 448 additions and 440 deletions.
4 changes: 4 additions & 0 deletions client/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ module.exports = {
},
rules: {
'react/prop-types': 'off',
'jsx-quotes': [
'error',
'prefer-single'
],
'react/self-closing-comp': [
'error',
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export default function CollapseIcon({ ...props }) {
return (
<svg
stroke="currentColor"
fill="currentColor"
stroke-width="0"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
stroke='currentColor'
fill='currentColor'
stroke-width='0'
viewBox='0 0 24 24'
xmlns='http://www.w3.org/2000/svg'
{...props}
>
<path d="M15 4.00008H13V11.0001H20V9.00008H16.4142L20.7071 4.70718L19.2929 3.29297L15 7.58586V4.00008ZM4.00008 15H7.58586L3.29297 19.2929L4.70718 20.7071L9.00008 16.4142V20H11.0001V13H4.00008V15Z" />
<path d='M15 4.00008H13V11.0001H20V9.00008H16.4142L20.7071 4.70718L19.2929 3.29297L15 7.58586V4.00008ZM4.00008 15H7.58586L3.29297 19.2929L4.70718 20.7071L9.00008 16.4142V20H11.0001V13H4.00008V15Z' />
</svg>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function Sidebar({ blocks }) {
src={theme === 'dark' ? '/symbol_white.png' : '/symbol_black.png'}
width={64}
height={64}
alt="discord.place Logo"
alt='discord.place Logo'
className='size-6'
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default function CreateProfile() {
}, [debouncedSlug]);

return (
<div className="flex flex-col gap-y-4">
<div className='flex flex-col gap-y-4'>
<div className='flex flex-col'>
<div className='flex items-center gap-x-2'>
<h2 className='text-sm font-semibold text-secondary'>
Expand All @@ -87,7 +87,7 @@ export default function CreateProfile() {
{t('accountPage.tabs.myAccount.sections.yourProfile.createProfileModal.fields.host.description')}
</p>

<div className="mt-2 flex w-full">
<div className='mt-2 flex w-full'>
{['discord.place/p', ...config.customHostnames]
.map(hostname => (
<div
Expand Down Expand Up @@ -153,9 +153,9 @@ export default function CreateProfile() {
</p>

<input
type="text"
type='text'
placeholder={t('accountPage.tabs.myAccount.sections.yourProfile.createProfileModal.fields.slug.placeholder')}
className="mt-2 w-full rounded-xl bg-secondary px-3 py-2 text-sm text-secondary outline-none ring-purple-500 transition-all placeholder:text-placeholder hover:bg-background hover:ring-2 focus-visible:bg-background"
className='mt-2 w-full rounded-xl bg-secondary px-3 py-2 text-sm text-secondary outline-none ring-purple-500 transition-all placeholder:text-placeholder hover:bg-background hover:ring-2 focus-visible:bg-background'
value={slug}
maxLength={32}
onChange={event => setSlug(event.target.value)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ export default function NewBot() {

return (
<>
<div className="pointer-events-none fixed left-0 top-0 z-10 h-svh w-full">
<Lottie options={{ loop: false, autoplay: false, animationData: confetti }} isStopped={!renderConfetti} height="100%" width="100%"/>
<div className='pointer-events-none fixed left-0 top-0 z-10 h-svh w-full'>
<Lottie options={{ loop: false, autoplay: false, animationData: confetti }} isStopped={!renderConfetti} height='100%' width='100%'/>
</div>

<div className="flex w-full max-w-[800px] flex-col justify-center gap-y-4">
<div className="flex items-center gap-x-4">
<button className="rounded-xl bg-secondary p-1.5 hover:bg-tertiary" onClick={() => {
<div className='flex w-full max-w-[800px] flex-col justify-center gap-y-4'>
<div className='flex items-center gap-x-4'>
<button className='rounded-xl bg-secondary p-1.5 hover:bg-tertiary' onClick={() => {
setBotId('');
setBotShortDescription('');
setBotDescription('');
Expand All @@ -124,56 +124,56 @@ export default function NewBot() {
<MdChevronLeft size={24}/>
</button>

<h1 className="flex flex-wrap items-center gap-x-1 text-lg font-bold sm:text-3xl">
<h1 className='flex flex-wrap items-center gap-x-1 text-lg font-bold sm:text-3xl'>
{t('accountPage.tabs.myBots.sections.addBot.title')}
</h1>
</div>

<p className="max-w-[800px] text-sm text-tertiary sm:text-base">
<p className='max-w-[800px] text-sm text-tertiary sm:text-base'>
{t('accountPage.tabs.myBots.sections.addBot.subtitle')}
</p>

<div className="mt-12 flex w-full items-center justify-center">
<div className="flex w-full max-w-[800px] flex-col gap-y-1">
<h2 className="text-lg font-semibold">
<div className='mt-12 flex w-full items-center justify-center'>
<div className='flex w-full max-w-[800px] flex-col gap-y-1'>
<h2 className='text-lg font-semibold'>
{t('accountPage.tabs.myBots.sections.addBot.fields.botId.label')}
</h2>

<p className="text-sm text-tertiary sm:text-base">
<p className='text-sm text-tertiary sm:text-base'>
{t('accountPage.tabs.myBots.sections.addBot.fields.botId.description')}
</p>

<input
className="mt-4 block w-full rounded-lg border-2 border-transparent bg-secondary p-2 text-sm text-placeholder outline-none focus-visible:border-purple-500 focus-visible:text-primary"
className='mt-4 block w-full rounded-lg border-2 border-transparent bg-secondary p-2 text-sm text-placeholder outline-none focus-visible:border-purple-500 focus-visible:text-primary'
onChange={event => setBotId(event.target.value)}
value={botId}
/>

<h2 className="mt-8 text-lg font-semibold">
<h2 className='mt-8 text-lg font-semibold'>
{t('accountPage.tabs.myBots.sections.addBot.fields.shortDescription.label')}
</h2>

<p className="text-sm text-tertiary sm:text-base">
<p className='text-sm text-tertiary sm:text-base'>
{t('accountPage.tabs.myBots.sections.addBot.fields.shortDescription.description')}
</p>

<input
className="mt-4 block w-full rounded-lg border-2 border-transparent bg-secondary p-2 text-sm text-placeholder outline-none focus-visible:border-purple-500 focus-visible:text-primary"
className='mt-4 block w-full rounded-lg border-2 border-transparent bg-secondary p-2 text-sm text-placeholder outline-none focus-visible:border-purple-500 focus-visible:text-primary'
maxLength={config.botShortDescriptionMaxLength}
value={botShortDescription}
onChange={event => setBotShortDescription(event.target.value)}
/>

<h2 className="mt-8 text-lg font-semibold">
<h2 className='mt-8 text-lg font-semibold'>
{t('accountPage.tabs.myBots.sections.addBot.fields.longDescription.label')}
</h2>

<p className="text-sm text-tertiary sm:text-base">
<p className='text-sm text-tertiary sm:text-base'>
{t('accountPage.tabs.myBots.sections.addBot.fields.longDescription.description')}
</p>

<button
className="mt-4 flex size-max items-center gap-x-1.5 rounded-lg bg-black px-3 py-1.5 text-sm font-semibold text-white hover:bg-black/70 disabled:pointer-events-none disabled:opacity-70 dark:bg-white dark:text-black dark:hover:bg-white/70"
className='mt-4 flex size-max items-center gap-x-1.5 rounded-lg bg-black px-3 py-1.5 text-sm font-semibold text-white hover:bg-black/70 disabled:pointer-events-none disabled:opacity-70 dark:bg-white dark:text-black dark:hover:bg-white/70'
onClick={() => setMarkdownPreviewing(!markdownPreviewing)}
>
{markdownPreviewing ? (
Expand All @@ -190,41 +190,41 @@ export default function NewBot() {
</button>

{markdownPreviewing ? (
<Markdown className="mt-4 h-[250px] overflow-y-auto rounded-lg border-2 border-transparent">
<Markdown className='mt-4 h-[250px] overflow-y-auto rounded-lg border-2 border-transparent'>
{botDescription}
</Markdown>
) : (
<textarea
className="mt-4 block h-[250px] w-full resize-none overflow-y-auto rounded-lg border-2 border-transparent bg-secondary p-2 text-placeholder outline-none focus-visible:border-purple-500 focus-visible:text-primary"
className='mt-4 block h-[250px] w-full resize-none overflow-y-auto rounded-lg border-2 border-transparent bg-secondary p-2 text-placeholder outline-none focus-visible:border-purple-500 focus-visible:text-primary'
value={botDescription}
onChange={event => setBotDescription(event.target.value)}
maxLength={config.botDescriptionMaxLength}
/>
)}

<h2 className="mt-8 text-lg font-semibold">
<h2 className='mt-8 text-lg font-semibold'>
{t('accountPage.tabs.myBots.sections.addBot.fields.inviteUrl.label')}
</h2>

<p className="text-sm text-tertiary sm:text-base">
<p className='text-sm text-tertiary sm:text-base'>
{t('accountPage.tabs.myBots.sections.addBot.fields.inviteUrl.description')}
</p>

<input
className="mt-4 block w-full rounded-lg border-2 border-transparent bg-secondary p-2 text-sm text-placeholder outline-none focus-visible:border-purple-500 focus-visible:text-primary"
className='mt-4 block w-full rounded-lg border-2 border-transparent bg-secondary p-2 text-sm text-placeholder outline-none focus-visible:border-purple-500 focus-visible:text-primary'
value={botInviteUrl}
onChange={event => setBotInviteUrl(event.target.value)}
/>

<h2 className="mt-8 text-lg font-semibold">
<h2 className='mt-8 text-lg font-semibold'>
{t('accountPage.tabs.myBots.sections.addBot.fields.categories.label')}
</h2>

<p className="text-sm text-tertiary">
<p className='text-sm text-tertiary'>
{t('accountPage.tabs.myBots.sections.addBot.fields.categories.description')}
</p>

<div className="mt-4 flex flex-wrap gap-2">
<div className='mt-4 flex flex-wrap gap-2'>
{config.botCategories
.filter(category => category !== 'All')
.map(category => (
Expand All @@ -245,7 +245,7 @@ export default function NewBot() {
))}
</div>

<h2 className="mt-8 text-lg font-semibold">
<h2 className='mt-8 text-lg font-semibold'>
{t('accountPage.tabs.myBots.sections.addBot.fields.contentPolicy.label')}
</h2>

Expand All @@ -255,13 +255,13 @@ export default function NewBot() {
})}
</p>

<h2 className="mt-8 text-lg font-semibold">
<h2 className='mt-8 text-lg font-semibold'>
{t('accountPage.tabs.myBots.sections.addBot.fields.areYouReady.label')}
</h2>

<div className="mt-2 flex w-full flex-col gap-2 sm:flex-row">
<div className='mt-2 flex w-full flex-col gap-2 sm:flex-row'>
<button
className="flex w-full items-center justify-center gap-x-1.5 rounded-lg bg-black px-3 py-1.5 text-sm font-semibold text-white hover:bg-black/70 disabled:pointer-events-none disabled:opacity-70 dark:bg-white dark:text-black dark:hover:bg-white/70"
className='flex w-full items-center justify-center gap-x-1.5 rounded-lg bg-black px-3 py-1.5 text-sm font-semibold text-white hover:bg-black/70 disabled:pointer-events-none disabled:opacity-70 dark:bg-white dark:text-black dark:hover:bg-white/70'
disabled={
loading ||
!botId ||
Expand All @@ -272,11 +272,11 @@ export default function NewBot() {
}
onClick={addBot}
>
{loading && <TbLoader className="animate-spin"/>}
{loading && <TbLoader className='animate-spin'/>}
{t('buttons.addBot')}
</button>

<button className="flex w-full items-center justify-center rounded-lg py-2 text-sm font-medium hover:bg-quaternary disabled:pointer-events-none disabled:opacity-70"
<button className='flex w-full items-center justify-center rounded-lg py-2 text-sm font-medium hover:bg-quaternary disabled:pointer-events-none disabled:opacity-70'
onClick={() => {
setBotId('');
setBotShortDescription('');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ export default function CreateLinkModal() {
</p>

<input
type="text"
type='text'
placeholder={t('accountPage.tabs.myLinks.createLinkModal.inputs.name.placeholder')}
className="mt-3 w-full rounded-xl bg-secondary px-3 py-2 text-sm text-secondary outline-none ring-purple-500 transition-all placeholder:text-placeholder hover:bg-background hover:ring-2 focus-visible:bg-background"
className='mt-3 w-full rounded-xl bg-secondary px-3 py-2 text-sm text-secondary outline-none ring-purple-500 transition-all placeholder:text-placeholder hover:bg-background hover:ring-2 focus-visible:bg-background'
value={name}
onChange={event => setName(event.target.value)}
/>
Expand All @@ -42,9 +42,9 @@ export default function CreateLinkModal() {
</p>

<input
type="text"
type='text'
placeholder={t('accountPage.tabs.myLinks.createLinkModal.inputs.destinationUrl.placeholder')}
className="mt-3 w-full rounded-xl bg-secondary px-3 py-2 text-sm text-secondary outline-none ring-purple-500 transition-all placeholder:text-placeholder hover:bg-background hover:ring-2 focus-visible:bg-background"
className='mt-3 w-full rounded-xl bg-secondary px-3 py-2 text-sm text-secondary outline-none ring-purple-500 transition-all placeholder:text-placeholder hover:bg-background hover:ring-2 focus-visible:bg-background'
value={destinationURL}
onChange={event => setDestinationURL(event.target.value)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ export default function NewServer() {
<Lottie options={{ loop: false, autoplay: false, animationData: confetti }} isStopped={!renderConfetti} height='100%' width='100%' />
</div>

<div className="flex w-full max-w-[800px] flex-col justify-center gap-y-4">
<div className='flex w-full max-w-[800px] flex-col justify-center gap-y-4'>
<div className='flex items-center gap-x-4'>
<button className="rounded-xl bg-secondary p-1.5 hover:bg-quaternary" onClick={() => {
<button className='rounded-xl bg-secondary p-1.5 hover:bg-quaternary' onClick={() => {
setCurrentlyAddingServer(null);
setServerDescription('');
setServerInviteLink('');
Expand All @@ -86,7 +86,7 @@ export default function NewServer() {
<MdChevronLeft size={24} />
</button>

<h1 className="flex flex-wrap items-center gap-x-1 text-lg font-bold sm:text-3xl">
<h1 className='flex flex-wrap items-center gap-x-1 text-lg font-bold sm:text-3xl'>
{t('accountPage.tabs.myServers.sections.newServer.title', {
serverName: <span className='truncate'>{currentlyAddingServer.name}</span>,
serverIcon: (
Expand Down
Loading

0 comments on commit 554bb22

Please sign in to comment.