Skip to content

Commit

Permalink
🧹 Fix/lint (#3988)
Browse files Browse the repository at this point in the history
* lint

* drop unused

Co-authored-by: Joystream Stats <dev@joystreamstats.live>
  • Loading branch information
traumschule and Joystream Stats authored Dec 19, 2022
1 parent b6a5d3e commit aea293f
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 25 deletions.
2 changes: 1 addition & 1 deletion packages/ui/src/council/hooks/useCouncilRemainingPeriod.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sum } from 'lodash'
import { map, combineLatest, concatMap, EMPTY, merge, Observable, of } from 'rxjs'
import { map, combineLatest } from 'rxjs'

import { useApi } from '@/api/hooks/useApi'
import { useObservable } from '@/common/hooks/useObservable'
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/forum/components/ForumPageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import React, { useState } from 'react'
import { PageHeaderRow, PageHeaderWrapper } from '@/app/components/PageLayout'
import { ButtonsGroup } from '@/common/components/buttons'
import { SearchBox } from '@/common/components/forms/FilterBox/FilterSearchBox'
import { TextMedium } from '@/common/components/typography'
import { useModal } from '@/common/hooks/useModal'

interface ForumPageHeaderProps {
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/forum/components/category/LatestPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { memo } from 'react'
import { generatePath } from 'react-router-dom'
import styled from 'styled-components'

import { Loading } from '@/common/components/Loading'
import { GhostRouterLink } from '@/common/components/RouterLink'
import { TextInlineExtraSmall, TextMedium } from '@/common/components/typography'
import { Colors, Fonts, Overflow, Transitions } from '@/common/constants'
Expand All @@ -14,7 +13,7 @@ import { MemberInfo } from '@/memberships/components'
import { CategoryItemFieldProps } from './CategoryListItem'

export const LatestPost = memo(({ categoryId }: CategoryItemFieldProps) => {
const { post, thread, isLoading } = useCategoryLatestPost(categoryId)
const { post, thread } = useCategoryLatestPost(categoryId)

if (!post) return <TextMedium>-</TextMedium>

Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/forum/components/category/PopularThread.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { memo } from 'react'
import { generatePath } from 'react-router-dom'
import styled from 'styled-components'

import { Loading } from '@/common/components/Loading'
import { GhostRouterLink } from '@/common/components/RouterLink'
import { TextExtraSmall, TextMedium } from '@/common/components/typography'
import { Overflow, Fonts, Transitions, Colors } from '@/common/constants'
Expand All @@ -14,7 +13,7 @@ import { useForumPopularThreads } from '@/forum/hooks/useForumPopularThreads'
import { CategoryItemFieldProps } from './CategoryListItem'

export const PopularThread = memo(({ categoryId }: CategoryItemFieldProps) => {
const { isLoading, threads } = useForumPopularThreads({ categoryId })
const { threads } = useForumPopularThreads({ categoryId })

if (!threads?.[0]) return <TextMedium>-</TextMedium>

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/forum/queries/forum.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ fragment ForumPostWithoutReplyFields on ForumPost {
}
threadId
thread {
categoryId
categoryId
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const MemberRoleToggle = ({ role }: MemberRoleToggleProps) => {
data: { applicationId: role.applicationId },
})
}, [role])
const { earnings, currentDayEarnings } = useWorkerEarnings(role.id)
const { earnings } = useWorkerEarnings(role.id)
const rewardPeriod = useRewardPeriod(role.group.id)
const [isOpen, toggleOpen] = useToggle()

Expand Down
6 changes: 5 additions & 1 deletion packages/ui/src/working-groups/queries/workingGroups.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,11 @@ fragment WorkingGroupApplicationFields on WorkingGroupApplication {
roleAccount
}

query GetWorkingGroupApplications($where: WorkingGroupApplicationWhereInput, $orderBy: [WorkingGroupApplicationOrderByInput!], $limit: Int) {
query GetWorkingGroupApplications(
$where: WorkingGroupApplicationWhereInput
$orderBy: [WorkingGroupApplicationOrderByInput!]
$limit: Int
) {
workingGroupApplications(where: $where, orderBy: $orderBy, limit: $limit) {
...WorkingGroupApplicationFields
}
Expand Down
8 changes: 4 additions & 4 deletions packages/ui/test/_mocks/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ export const stubConst = <T>(api: UseApi, constSubPath: string, value: T) => {

export const stubApi = () => {
const api: UseApi = {
api: ({
api: {
isConnected: true,
} as unknown) as Api,
} as unknown as Api,
isConnected: true,
connectionState: 'connected',
setQnConnectionState: () => undefined,
Expand Down Expand Up @@ -267,7 +267,7 @@ export const stubBalances = ({ available, lockId, locked }: Balances) => {
const availableBalance = new BN(available ?? 0)
const lockedBalance = new BN(locked ?? 0)

const deriveBalances = ({
const deriveBalances = {
availableBalance: createType('Balance', availableBalance),
lockedBalance: createType('Balance', lockedBalance),
accountId: createType('AccountId', '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY'),
Expand All @@ -286,7 +286,7 @@ export const stubBalances = ({ available, lockId, locked }: Balances) => {
vestingTotal: new BN(0),
votingBalance: new BN(0),
vesting: [],
} as unknown) as DeriveBalancesAll
} as unknown as DeriveBalancesAll

const balance = toBalances(deriveBalances)
mockedBalances.mockReturnValue(balance)
Expand Down
2 changes: 0 additions & 2 deletions packages/ui/test/bounty/modals/AddBountyModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ jest.mock('@/common/hooks/useCurrentBlockNumber', () => ({
useCurrentBlockNumber: () => mockUseCurrentBlockNumber(),
}))



describe('UI: AddNewBountyModal', () => {
const api = stubApi()
const showModal = jest.fn()
Expand Down
2 changes: 0 additions & 2 deletions packages/ui/test/bounty/modals/SubmitJudgementModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ import {

configure({ testIdAttribute: 'id' })



jest.mock('@/common/components/CKEditor', () => ({
CKEditor: (props: CKEditorProps) => mockCKEditor(props),
}))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ import { mockUseModalCall } from '../../setup'

configure({ testIdAttribute: 'id' })



describe('UI: BuyMembershipModal', () => {
const api = stubApi()
let transaction: any
Expand Down
2 changes: 0 additions & 2 deletions packages/ui/test/membership/modals/InviteMemberModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ import {

configure({ testIdAttribute: 'id' })



describe('UI: InviteMemberModal', () => {
beforeAll(async () => {
await cryptoWaitReady()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ import {
import { WORKER as worker } from '../../_mocks/working-groups'
import { mockUseModalCall } from '../../setup'



describe('UI: ChangeRoleModal', () => {
const api = stubApi()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ import {
} from '../../_mocks/transactions'
import { WORKER } from '../../_mocks/working-groups'



const mockUseModal: UseModal<any> = {
modal: null,
modalData: { workerId: 'forumWorkingGroup-1' },
Expand Down

2 comments on commit aea293f

@vercel
Copy link

@vercel vercel bot commented on aea293f Dec 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

pioneer-2-storybook – ./

pioneer-2-storybook-joystream.vercel.app
pioneer-2-storybook.vercel.app
pioneer-2-storybook-git-dev-joystream.vercel.app

@vercel
Copy link

@vercel vercel bot commented on aea293f Dec 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

pioneer-2 – ./

pioneer-2-git-dev-joystream.vercel.app
pioneer-2-joystream.vercel.app
pioneer-2.vercel.app

Please sign in to comment.