Skip to content

Commit

Permalink
chore: reduced .git folder size
Browse files Browse the repository at this point in the history
  • Loading branch information
gearonix committed Sep 2, 2023
1 parent 2076155 commit 5ee9392
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 18 deletions.
2 changes: 1 addition & 1 deletion apps/client/src/widgets/sign-in-modal/ui/sign-in-modal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SignInForm } from '$/common-types'
import { SignInForm } from '@code-gear/api/common'
import { Modal } from '@code-gear/web/ui'
import { observer } from 'mobx-react-lite'
import { useNavigate } from 'react-router-dom'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const HtmlPreview = () => {
<PreviewEditor lang="css" />
<PreviewEditor lang="javascript" />
</EditorBlock>

<PreviewBlock>
<IFrame />
</PreviewBlock>
Expand Down
3 changes: 2 additions & 1 deletion packages/web/shared/src/hooks/use-notifications.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { NotificationsPayload } from '@/providers/notifications/notifications-provider'
import { useContext } from 'react'

import { NotificationsContext } from '@/providers'

export const useNotifications = () => {
return useContext(NotificationsContext)
return useContext(NotificationsContext) as NotificationsPayload
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface UserMessage {
message: string
}

interface NotificationsPayload {
export interface NotificationsPayload {
open: (args: UserMessage) => void
}

Expand Down
15 changes: 1 addition & 14 deletions packages/web/shared/src/types/common/common.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
import { KeyboardEvent, MouseEvent, ReactElement, ReactNode } from 'react'
import { ComponentChildren } from 'preact'
import { KeyboardEvent, MouseEvent } from 'react'

export type AnyObject = Record<string, unknown>

export type AnyFunction<T = void> = (...args: any[]) => T

export type VoidFunction = () => void

export type WithPreactChildren<T extends AnyObject = AnyObject> = T & {
children: ComponentChildren
}

export type WithChildren<T> = T & {
children: ReactElement | ReactNode
}

export type TargetKey = MouseEvent | KeyboardEvent | string

export type Nullable<T> = T | null
Expand All @@ -26,7 +17,3 @@ export type ValueOf<T> = T[keyof T]
export type Keys<T extends readonly unknown[]> = T[number]

export type Hex = `#${string}`

export type CustomArguments<F> = F extends (...args: infer A) => unknown
? A
: never
24 changes: 24 additions & 0 deletions packages/web/shared/src/types/common/react.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { AnyObject } from '@/types'
import { ComponentChildren } from 'preact'
import { Component } from 'preact'
import { ReactElement } from 'react'
import { ReactNode } from 'react'

export type WithFeatures<
T extends AnyObject,
B extends Record<string, Component | ReactNode>
> = T & {
features: B
}

export type WithPreactChildren<T extends AnyObject = AnyObject> = T & {
children: ComponentChildren
}

export type WithChildren<T> = T & {
children: ReactElement | ReactNode
}

export type CustomArguments<F> = F extends (...args: infer A) => unknown
? A
: never
1 change: 1 addition & 0 deletions packages/web/shared/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './common/common'
export * from './common/react'
export * from './common/graphql'
export * from './common/type-guards'
export * from './lib/animations'
Expand Down

0 comments on commit 5ee9392

Please sign in to comment.