Skip to content

Commit

Permalink
Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
WRadoslaw committed May 6, 2024
1 parent f889912 commit 26ccb8b
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { transitions } from '@/styles'

import { Container, NavLink, NavTitle } from './BottomNav.styles'

const Link: FC<typeof viewerNavItems[number]> = ({ to, icon, name }) => {
const Link: FC<(typeof viewerNavItems)[number]> = ({ to, icon, name }) => {
const match = useMatch(to)
return (
<NavLink to={to} active={match}>
Expand Down
2 changes: 1 addition & 1 deletion packages/atlas/src/utils/ypp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { atlasConfig } from '@/config'
import { YppChannelStatus } from '@/views/global/YppLandingView/YppLandingView.types'

const configTiers = atlasConfig.features.ypp.tiersDefinition
type ConfigTier = typeof configTiers[number]['tier']
type ConfigTier = (typeof configTiers)[number]['tier']

export const yppBackendTierToConfig = (beTier?: YppChannelStatus): ConfigTier | undefined => {
switch (beTier) {
Expand Down
4 changes: 2 additions & 2 deletions packages/atlas/src/views/studio/CrtDashboard/CrtDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ import { CrtRevenueTab } from '@/views/studio/CrtDashboard/tabs/CrtRevenueTab'

import { TABS } from './CrtDashboard.types'

type TabsNames = typeof TABS[number]
type TabsNames = (typeof TABS)[number]

const getTabIndex = (tabName: TabsNames, allTabs: { name: TabsNames }[]): number =>
allTabs.findIndex((tab) => tab.name === tabName)

export const CrtDashboard = () => {
const [searchParams, setSearchParams] = useSearchParams()
const currentTabName = searchParams.get('tab') as typeof TABS[number] | null
const currentTabName = searchParams.get('tab') as (typeof TABS)[number] | null
const { activeChannel, memberId } = useUser()
const { data } = useGetFullCreatorTokenQuery({
variables: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Header, TabsWrapper } from './YppDashboard.styles'
import { YppDashboardMainTab, YppDashboardSettingsTab } from './tabs'

const TABS = ['Dashboard', 'Referrals', 'Settings'] as const
type Tab = typeof TABS[number]
type Tab = (typeof TABS)[number]

export const YppDashboard: FC = () => {
const headTags = useHeadTags('Creator Rewards')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export const TabsWrapper = styled.div<{ isFiltersOpen: boolean }>`
`

type TabsContainerProps = {
tab: typeof TABS[number]
tab: (typeof TABS)[number]
}

const geTabsContainerGridTemplate = ({ tab }: TabsContainerProps) => {
Expand Down
6 changes: 3 additions & 3 deletions packages/atlas/src/views/viewer/ChannelView/ChannelView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const INITIAL_TILES_PER_ROW = 4
export const ChannelView: FC = () => {
const [searchParams, setSearchParams] = useSearchParams()
const [tilesPerRow, setTilesPerRow] = useState(INITIAL_TILES_PER_ROW)
const currentTabName = searchParams.get('tab') as typeof TABS[number] | null
const currentTabName = searchParams.get('tab') as (typeof TABS)[number] | null
const videoRows = useVideoGridRows('main')
const { trackPageView } = useSegmentAnalytics()
const navigate = useNavigate()
Expand Down Expand Up @@ -134,7 +134,7 @@ export const ChannelView: FC = () => {
const { channelNftCollectors } = useChannelNftCollectors({ channelId: id || '' })

const { toggleFollowing, isFollowing } = useHandleFollowChannel(id, channel?.title)
const [currentTab, setCurrentTab] = useState<typeof TABS[number]>(filteredTabs[0])
const [currentTab, setCurrentTab] = useState<(typeof TABS)[number]>(filteredTabs[0])

const { url: avatarPhotoUrl } = useGetAssetUrl(channel?.avatarPhoto?.resolvedUrls, 'avatar')

Expand Down Expand Up @@ -188,7 +188,7 @@ export const ChannelView: FC = () => {

const mappedTabs = filteredTabs.map((tab) => ({ name: tab, badgeNumber: 0 }))

const getChannelContent = (tab: typeof TABS[number]) => {
const getChannelContent = (tab: (typeof TABS)[number]) => {
switch (tab) {
case 'Videos':
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ const TABS = [
icon: <SvgActionCreatorToken />,
},
] as const
type TabsNames = typeof TABS[number]['name']
type TabsNames = (typeof TABS)[number]['name']

const getTabIndex = (tabName: TabsNames, allTabs: typeof TABS): number =>
allTabs.findIndex((tab) => tab.name === tabName)

export const MarketplaceView: FC = () => {
const smMatch = useMediaMatch('sm')
const [searchParams, setSearchParams] = useSearchParams()
const currentTabName = searchParams.get('tab') as typeof TABS[number]['name'] | null
const currentTabName = searchParams.get('tab') as (typeof TABS)[number]['name'] | null
const currentTab = currentTabName ? getTabIndex(currentTabName, TABS) : 0

useMountEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/atlas/src/views/viewer/MemberView/MemberView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const MemberView: FC = () => {
NftActivityOrderByInput.EventTimestampDesc
)
const navigate = useNavigate()
const [currentTab, setCurrentTab] = useState<typeof TABS[number] | null>(null)
const [currentTab, setCurrentTab] = useState<(typeof TABS)[number] | null>(null)
const { memberId } = useUser()
const { handle, id } = useParams()
const headTags = useHeadTags(handle)
Expand Down

0 comments on commit 26ccb8b

Please sign in to comment.