Skip to content

Commit

Permalink
😠 Regen lock and resolve issues (#40)
Browse files Browse the repository at this point in the history
* Regen lock and resolve issues

* Linter

* Remove caret for comlink
  • Loading branch information
WRadoslaw committed May 6, 2024
1 parent 006f49c commit f32a505
Show file tree
Hide file tree
Showing 15 changed files with 4,705 additions and 7,055 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"stylelint": "^14.16.0",
"stylelint-config-prettier": "^9.0.4",
"stylelint-config-standard": "^29.0.0",
"typescript": "^5.1.6"
"typescript": "5.1.6"
},
"resolutions": {
"@polkadot/api": "10.7.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/atlas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"blake3": "2.1.7",
"bn.js": "^5.2.1",
"buffer": "^6.0.3",
"comlink": "^4.3.1",
"comlink": "4.3.1",
"cropperjs": "^1.5.13",
"crypto-js": "^4.1.1",
"date-fns": "^2.29.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/atlas/src/api/hooks/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export const useFollowChannel = (opts?: MutationHookOptions<FollowChannelMutatio
id,
}),
fields: {
followsNum: () => mutationResult.data?.followChannel.follows,
followsNum: () => mutationResult.data?.followChannel.follows ?? 0,
},
})
},
Expand Down Expand Up @@ -195,7 +195,7 @@ export const useUnfollowChannel = (opts?: MutationHookOptions<UnfollowChannelMut
id,
}),
fields: {
followsNum: () => mutationResult.data?.unfollowChannel.follows,
followsNum: () => mutationResult.data?.unfollowChannel.follows ?? 0,
},
})
},
Expand Down
2 changes: 1 addition & 1 deletion packages/atlas/src/api/hooks/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const useAddVideoView = (opts?: Omit<MutationHookOptions<AddVideoViewMuta
id: mutationResult.data?.addVideoView.videoId,
}),
fields: {
viewsNum: () => mutationResult.data?.addVideoView.viewsNum,
viewsNum: () => mutationResult.data?.addVideoView.viewsNum ?? 0,
},
})
},
Expand Down
1 change: 1 addition & 0 deletions packages/atlas/src/components/Searchbar/Searchbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type SearchbarProps = {
controlled?: boolean
onClick?: () => void
onClose: () => void
placeholder?: string
} & DetailedHTMLProps<HTMLAttributes<HTMLInputElement>, HTMLInputElement>

export const Searchbar: FC<SearchbarProps> = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const schema = z.object({
message: 'Password address has to match.',
}
),
[ForgotPasswordStep.LoadingStep]: z.any(),
})

export const ForgotPasswordModal = () => {
Expand All @@ -64,7 +65,9 @@ export const ForgotPasswordModal = () => {
const [lazyCurrentAccountQuery] = useGetCurrentAccountLazyQuery()

const form = useForm<ForgotPasswordModalForm>({
resolver: zodResolver(isLastStep ? schema : schema.pick({ [currentStep]: true })),
resolver: zodResolver(
isLastStep ? schema : schema.pick({ [currentStep]: true } as Record<ForgotPasswordStep, true | never>)
),
})
const { authModalOpenName, setAuthModalOpenName } = useAuthStore(
(state) => ({
Expand Down
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
Loading

0 comments on commit f32a505

Please sign in to comment.