Skip to content

Commit

Permalink
update to react 19 part II
Browse files Browse the repository at this point in the history
  • Loading branch information
YeonV committed Dec 14, 2024
1 parent 94a4d91 commit 7642251
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/components/AddButton/AddButton.props.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ReactElement } from 'react'
import type { MenuProps } from '@mui/material'

export interface MenuLineProps {
icon?: ReactElement
icon?: ReactElement<any>
name?: string
action: () => void
}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Icons/BladeIcon/BladeIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import { BladeIconProps } from './BladeIcon.interface'
import HomeAssistantLogo from '../HomeAssistant'
import NovationLogo from '../Novation'

import type { JSX } from "react";

const getStyle = (card: boolean, scene: boolean, intro: boolean, list: boolean) => ({
transform: card ? 'unset' : scene ? 'scale(1)' : intro ? 'scale(0.05)' : 'scale(0.012)',
marginTop: '3px',
Expand Down
18 changes: 8 additions & 10 deletions src/components/Integrations/QLC/DialogAddEventListener.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function ConfirmationDialogRaw(props: ConfirmationDialogRawProps) {
qlc_payload: null
})
const [qlcData, setqlcData] = React.useState([])
const radioGroupRef = React.useRef(null)
// const radioGroupRef = React.useRef(null)

const qlcInfo = useStore((state: any) => state.qlc?.qlcWidgets)
const createQlcListener = useStore((state) => state.addQLCSongTrigger)
Expand Down Expand Up @@ -87,11 +87,6 @@ function ConfirmationDialogRaw(props: ConfirmationDialogRawProps) {
}
}, [valueProp, open])

const handleEntering = () => {
if (radioGroupRef.current != null) {
/* empty */
}
}

const handleCancel = () => {
onClose()
Expand Down Expand Up @@ -304,20 +299,23 @@ function ConfirmationDialogRaw(props: ConfirmationDialogRawProps) {
{ value: 255, label: '255' }
]

delete other.deviceList
delete (other as any).deviceList

return (
<Dialog
disableBackdropClick
onClose={(event, reason) => {
if (reason !== 'backdropClick') {
handleCancel();
}
}}
disableEscapeKeyDown
maxWidth="xs"
onEntering={handleEntering}
aria-labelledby="confirmation-dialog-title"
open={open}
{...other}
>
<DialogTitle id="confirmation-dialog-title">
Event Listener Setup: {valueProp?.id}
Event Listener Setup: {valueProp}
</DialogTitle>
<DialogContent dividers>
<DialogContentText>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Integrations/Spotify/SpotifyProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createContext, useEffect, useMemo, useState } from 'react'
import { createContext, useEffect, useMemo, useState, type JSX } from 'react';

import { SpotifyState } from '../../../store/ui/SpotifyState'
import useStore from '../../../store/useStore'
Expand Down
2 changes: 2 additions & 0 deletions src/components/NoYet.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Card, CardHeader } from '@mui/material'
import { Info } from '@mui/icons-material'

import type { JSX } from "react";

interface NoYetProps {
type?: string
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Device/TroubleshootButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/indent */
import { useState, forwardRef, useEffect } from 'react'
import { useState, forwardRef, useEffect, type JSX } from 'react';
import {
Button,
Dialog,
Expand Down Expand Up @@ -233,5 +233,5 @@ export default function TroubleshootButton({
</div>
</Dialog>
</>
) : null
) : null;
}
10 changes: 3 additions & 7 deletions src/pages/Integrations/QLCplus/QLCScreen/QLCScreen.props.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { TransitionProps } from '@mui/material/transitions'
import { MenuItem, Slide } from '@mui/material'

export interface QLCScreenProps {
icon: React.ReactElement
startIcon: React.ReactElement
icon: React.ReactElement<any>
startIcon: React.ReactElement<any>
label: string
type: string
className: string
Expand All @@ -31,16 +31,12 @@ export const QLCScreenDefaultProps = {
}

export const Transition = React.forwardRef(function Transition(
props: TransitionProps & { children?: React.ReactElement },
props: TransitionProps & { children?: React.ReactElement<any> } = { children: <div>loading</div> },
ref: React.Ref<unknown>
) {
return <Slide direction="up" ref={ref} {...(props as any)} />
})

Transition.defaultProps = {
children: <div>loading</div>
}

export const MuiMenuItem = React.forwardRef(
(props: any, ref: React.Ref<unknown>) => {
return <MenuItem ref={ref} {...props} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { TransitionProps } from '@mui/material/transitions'
import { MenuItem, Slide } from '@mui/material'

export interface SpotifyScreenProps {
icon: React.ReactElement
startIcon?: React.ReactElement
icon: React.ReactElement<any>
startIcon?: React.ReactElement<any>
label?: string
type?: string
className: string
Expand All @@ -17,7 +17,7 @@ export interface SpotifyScreenProps {
}

export const Transition = React.forwardRef(function Transition(
props: TransitionProps & { children?: React.ReactElement },
props: TransitionProps & { children?: React.ReactElement<any> },
ref: React.Ref<unknown>
) {
return <Slide direction="up" ref={ref} {...(props as any)} />
Expand Down
2 changes: 1 addition & 1 deletion src/stories/Doc/Doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const MuiMenuItem = React.forwardRef<HTMLLIElement, Props>((props, ref) => {
})

function FrameWrapper() {
const ref = React.useRef<any>()
const ref = React.useRef<any>(undefined)
const [height, setHeight] = React.useState('0px')
const onLoad = () => {
setHeight(`${ref.current.contentWindow.document.body.scrollHeight}px`)
Expand Down

0 comments on commit 7642251

Please sign in to comment.