chore: better Prettier config for easier reviews
This commit is contained in:
@ -1,13 +1,13 @@
|
||||
import { memo } from 'react'
|
||||
import classNames from 'clsx'
|
||||
import Link from 'next/link'
|
||||
import { useRouter } from 'next/router'
|
||||
import { CogIcon } from '@heroicons/react/solid'
|
||||
import { memo } from "react"
|
||||
import classNames from "clsx"
|
||||
import Link from "next/link"
|
||||
import { useRouter } from "next/router"
|
||||
import { CogIcon } from "@heroicons/react/solid"
|
||||
|
||||
import type { GuildsChannelsPath } from '../Application'
|
||||
import type { Channel as ChannelType } from '../../../models/Channel'
|
||||
import { useGuildMember } from '../../../contexts/GuildMember'
|
||||
import { IconButton } from '../../design/IconButton'
|
||||
import type { GuildsChannelsPath } from "../Application"
|
||||
import type { Channel as ChannelType } from "../../../models/Channel"
|
||||
import { useGuildMember } from "../../../contexts/GuildMember"
|
||||
import { IconButton } from "../../design/IconButton"
|
||||
|
||||
export interface ChannelProps {
|
||||
path: GuildsChannelsPath
|
||||
@ -25,24 +25,24 @@ const ChannelMemo: React.FC<ChannelProps> = (props) => {
|
||||
<Link
|
||||
href={`/application/${path.guildId}/${channel.id}`}
|
||||
className={classNames(
|
||||
'group relative mx-3 my-3 flex items-center justify-between overflow-hidden rounded-lg py-2 text-sm transition-all duration-200 hover:bg-gray-100 dark:hover:bg-gray-600',
|
||||
"group relative mx-3 my-3 flex items-center justify-between overflow-hidden rounded-lg py-2 text-sm transition-all duration-200 hover:bg-gray-100 dark:hover:bg-gray-600",
|
||||
{
|
||||
'font-semibold text-green-800 dark:text-green-400': selected
|
||||
}
|
||||
"font-semibold text-green-800 dark:text-green-400": selected,
|
||||
},
|
||||
)}
|
||||
>
|
||||
<span className='max-[315px] ml-2 mr-4 break-all' data-cy='channel-name'>
|
||||
<span className="max-[315px] ml-2 mr-4 break-all" data-cy="channel-name">
|
||||
# {channel.name}
|
||||
</span>
|
||||
{member.isOwner && (
|
||||
<IconButton
|
||||
onClick={async () => {
|
||||
await router.push(
|
||||
`/application/${channel.guildId}/${channel.id}/settings`
|
||||
`/application/${channel.guildId}/${channel.id}/settings`,
|
||||
)
|
||||
}}
|
||||
className='bg-unherit absolute -right-10 h-full w-8 transition-all group-hover:right-0 group-hover:shadow-lg dark:group-hover:bg-gray-600'
|
||||
title='Settings'
|
||||
className="bg-unherit absolute -right-10 h-full w-8 transition-all group-hover:right-0 group-hover:shadow-lg dark:group-hover:bg-gray-600"
|
||||
title="Settings"
|
||||
>
|
||||
<CogIcon height={20} width={20} />
|
||||
</IconButton>
|
||||
|
@ -1,9 +1,9 @@
|
||||
import InfiniteScroll from 'react-infinite-scroll-component'
|
||||
import InfiniteScroll from "react-infinite-scroll-component"
|
||||
|
||||
import { useChannels } from '../../../contexts/Channels'
|
||||
import type { GuildsChannelsPath } from '../Application'
|
||||
import { Loader } from '../../design/Loader'
|
||||
import { Channel } from './Channel'
|
||||
import { useChannels } from "../../../contexts/Channels"
|
||||
import type { GuildsChannelsPath } from "../Application"
|
||||
import { Loader } from "../../design/Loader"
|
||||
import { Channel } from "./Channel"
|
||||
|
||||
export interface ChannelsProps {
|
||||
path: GuildsChannelsPath
|
||||
@ -16,12 +16,12 @@ export const Channels: React.FC<ChannelsProps> = (props) => {
|
||||
|
||||
return (
|
||||
<div
|
||||
id='channels'
|
||||
className='scrollbar-firefox-support flex flex-1 flex-col overflow-y-auto'
|
||||
id="channels"
|
||||
className="scrollbar-firefox-support flex flex-1 flex-col overflow-y-auto"
|
||||
>
|
||||
<InfiniteScroll
|
||||
className='channels-list w-full'
|
||||
scrollableTarget='channels'
|
||||
className="channels-list w-full"
|
||||
scrollableTarget="channels"
|
||||
dataLength={channels.length}
|
||||
next={nextPage}
|
||||
hasMore={hasMore}
|
||||
|
@ -1 +1 @@
|
||||
export * from './Channels'
|
||||
export * from "./Channels"
|
||||
|
Reference in New Issue
Block a user