Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
chore: Fixes to help monorepo builds (#1103)
Browse files Browse the repository at this point in the history
* chore: Fixes to help monorepo builds

* chore: Only required change

* chore: Move things about
  • Loading branch information
garethfuller authored Sep 18, 2024
1 parent addad87 commit 3a9acbc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 16 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Card, CardProps, HStack, Heading, IconButton, Stack } from '@chakra-ui/react'
import Link from 'next/link'
import { PropsWithChildren } from 'react'
import { ArrowLeft } from 'react-feather'

interface Props extends CardProps, PropsWithChildren {
interface Props extends CardProps {
backLink: string
title: string
}
Expand Down
3 changes: 2 additions & 1 deletion lib/shared/services/api/apollo-global-data.provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ import { getFxRates } from '../../utils/currencies'
import { getPoolCategories } from '@/lib/modules/pool/categories/getPoolCategories'
import { PoolCategoriesProvider } from '@/lib/modules/pool/categories/PoolCategoriesProvider'
import { mins } from '../../utils/time'
import { PropsWithChildren } from 'react'

export const revalidate = 60

export async function ApolloGlobalDataProvider({ children }: React.PropsWithChildren) {
export async function ApolloGlobalDataProvider({ children }: PropsWithChildren) {
const client = getApolloServerClient()

const tokensQueryVariables = {
Expand Down
11 changes: 5 additions & 6 deletions test/utils/custom-renderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ import { apolloTestClient } from './apollo-test-client'
import { AppRouterContextProviderMock } from './app-router-context-provider-mock'
import { testQueryClient } from './react-query'

export type WrapperProps = { children: ReactNode }
export type Wrapper = ({ children }: WrapperProps) => ReactNode
export type Wrapper = ({ children }: PropsWithChildren) => ReactNode

export const EmptyWrapper = ({ children }: WrapperProps) => <>{children}</>
export const EmptyWrapper = ({ children }: PropsWithChildren) => <>{children}</>

export function testHook<TResult, TProps>(
hook: (props: TProps) => TResult,
options?: RenderHookOptions<TProps> | undefined
) {
function MixedProviders({ children }: WrapperProps) {
function MixedProviders({ children }: PropsWithChildren) {
const LocalProviders = options?.wrapper || EmptyWrapper

return (
Expand All @@ -49,7 +48,7 @@ export function testHook<TResult, TProps>(

const result = renderHook<TResult, TProps>(hook, {
...options,
wrapper: MixedProviders,
wrapper: MixedProviders as React.ComponentType<{ children: React.ReactNode }>,
})

return {
Expand All @@ -58,7 +57,7 @@ export function testHook<TResult, TProps>(
}
}

function GlobalProviders({ children }: WrapperProps) {
function GlobalProviders({ children }: PropsWithChildren) {
const defaultRouterOptions = {}

return (
Expand Down
8 changes: 1 addition & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
},
"types": ["vitest/globals"]
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"types/global-ts.d.ts"
],
"include": ["global.d.ts", "next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules", ".next"]
}

0 comments on commit 3a9acbc

Please sign in to comment.