Skip to content

Commit

Permalink
Fix PropsWithChildren<unknown>
Browse files Browse the repository at this point in the history
  • Loading branch information
TURMEL Kevin committed Aug 4, 2022
1 parent 81a1b6e commit d859cf4
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/renderer/components/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react'
import type { PropsWithChildren } from 'react'

function Alert({ children }: PropsWithChildren<unknown>) {
function Alert({ children }: PropsWithChildren) {
return (
<div className="mt-3 flex items-center gap-2 p-2 text-sm text-red-700 dark:text-red-400">
{children}
Expand Down
14 changes: 7 additions & 7 deletions src/renderer/components/dialog/dialog-changelog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,39 +50,39 @@ function Img({ src, alt, ...props }: ImgHTMLAttributes<HTMLImageElement>) {
)
}

function HeadingOne({ children }: PropsWithChildren<unknown>) {
function HeadingOne({ children }: PropsWithChildren) {
return (
<Typography component="h1" gutterBottom variant="h3">
{children}
</Typography>
)
}

function HeadingTwo({ children }: PropsWithChildren<unknown>) {
function HeadingTwo({ children }: PropsWithChildren) {
return (
<Typography component="h2" gutterBottom variant="h4">
{children}
</Typography>
)
}

function HeadingThree({ children }: PropsWithChildren<unknown>) {
function HeadingThree({ children }: PropsWithChildren) {
return (
<Typography className="mt-2" component="h3" gutterBottom variant="h5">
{children}
</Typography>
)
}

function HeadingFive({ children }: PropsWithChildren<unknown>) {
function HeadingFive({ children }: PropsWithChildren) {
return (
<Typography component="h5" gutterBottom variant="h6">
{children}
</Typography>
)
}

function Paragraph({ children }: PropsWithChildren<unknown>) {
function Paragraph({ children }: PropsWithChildren) {
return <Typography>{children}</Typography>
}

Expand All @@ -94,11 +94,11 @@ function Code({ children }: { children: ReactNode[] }) {
)
}

function UnorderedList({ children }: PropsWithChildren<unknown>) {
function UnorderedList({ children }: PropsWithChildren) {
return <List disablePadding>{children}</List>
}

function HtmlListItem({ children }: PropsWithChildren<unknown>) {
function HtmlListItem({ children }: PropsWithChildren) {
return (
<ListItem disablePadding>
<ListItemText primary={children} />
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/hooks/use-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const Context = React.createContext({} as AppContext)
const _refresh$ = new Subject<Config>()
const _onRefreshConfig = _refresh$.asObservable()

function AppProvider({ children }: React.PropsWithChildren<unknown>) {
function AppProvider({ children }: React.PropsWithChildren) {
const [config, setConfig] = useState<Config>({} as Config)
const [groups, setGroups] = useState<Group[]>([])
const [isShowChangelogs, setShowChangelogs] = useState(false)
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/hooks/use-compilation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const whenCompileScriptFinish = (
})
}

function CompilationProvider({ children }: React.PropsWithChildren<unknown>) {
function CompilationProvider({ children }: React.PropsWithChildren) {
const [compilationScripts, setCompilationScripts] = useState<
ScriptRenderer[]
>([])
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/hooks/use-drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type DrawerContext = [boolean, Dispatch<SetStateAction<boolean>>]

const Context = createContext([true, () => true] as DrawerContext)

function DrawerProvider({ children }: React.PropsWithChildren<unknown>) {
function DrawerProvider({ children }: React.PropsWithChildren) {
const [isDrawerExpandLS, setDrawerExpandLS] = useLocalStorage(
LocalStorage.drawerExpand,
'false',
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/hooks/use-focus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Context = createContext<boolean>(true)

const hasFocus = () => document.hasFocus()

function FocusProvider({ children }: PropsWithChildren<unknown>) {
function FocusProvider({ children }: PropsWithChildren) {
const [isFocus, setFocus] = useState(hasFocus)

useEffect(() => {
Expand Down
4 changes: 1 addition & 3 deletions src/renderer/hooks/use-initialization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ type CheckUpdateReturn =

const Context = createContext({} as InitializationContext)

function InitializationProvider({
children,
}: React.PropsWithChildren<unknown>) {
function InitializationProvider({ children }: React.PropsWithChildren) {
const [done, setDone] = useState(false)
const [latestVersion, setLatestVersion] = useState<string | undefined>()
const {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/hooks/use-recent-files.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Context = createContext({} as RecentFilesContext)
const recentFiles$ = new Subject<Script[]>()
const onRecentFilesChanges = recentFiles$.asObservable()

function RecentFilesProvider({ children }: React.PropsWithChildren<unknown>) {
function RecentFilesProvider({ children }: React.PropsWithChildren) {
const { send } = useTelemetry()
const [recentFiles, setRecentFilesMemory] = useState<Script[]>([])
const [isMoreDetails, setMoreDetails] = useLocalStorage(
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/hooks/use-telemetry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface TelemetryContext {

const Context = createContext({} as TelemetryContext)

function TelemetryProvider({ children }: React.PropsWithChildren<unknown>) {
function TelemetryProvider({ children }: React.PropsWithChildren) {
const { config } = useApp()

const sendTelemetry = (
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/hooks/use-version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type VersionContext = [string, Dispatch<SetStateAction<string>>]

const Context = createContext(['', () => ''] as VersionContext)

function VersionProvider({ children }: React.PropsWithChildren<unknown>) {
function VersionProvider({ children }: React.PropsWithChildren) {
const [version, setVersion] = useState('')

return (
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/mui-theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useIsDarkTheme } from './hooks/use-is-dark-theme'
import { usePlatform } from './hooks/use-platform'
import type { PaletteMode, PaletteOptions } from '@mui/material'

function MuiTheme({ children }: React.PropsWithChildren<unknown>) {
function MuiTheme({ children }: React.PropsWithChildren) {
const isDarkTheme = useIsDarkTheme()
const platform = usePlatform()
const mode: PaletteMode = isDarkTheme ? 'dark' : 'light'
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/pages/settings/use-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface SettingsContext {

const Context = createContext({} as SettingsContext)

function SettingsProvider({ children }: React.PropsWithChildren<unknown>) {
function SettingsProvider({ children }: React.PropsWithChildren) {
const [configError, setConfigError] = useState<BadError>(false)

const checkConfig: SettingsContext['checkConfig'] = useCallback(
Expand Down

0 comments on commit d859cf4

Please sign in to comment.