Skip to content

Commit c9d005a

Browse files
hotfix: biome lint and toasts ui (#1486)
Co-authored-by: Dhruv Arora <100000915+Dhruv-0-Arora@users.noreply.github.com>
2 parents cb9bb89 + 45461c4 commit c9d005a

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

fission/src/ui/UIProvider.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { SnackbarKey, SnackbarMessage, VariantType } from "notistack"
33
import { useSnackbar } from "notistack"
44
import type React from "react"
55
import type { FunctionComponent, ReactNode } from "react"
6-
import { useCallback, useReducer, useState } from "react"
6+
import { Fragment, useCallback, useReducer, useState } from "react"
77
import { v4 as uuidv4 } from "uuid"
88
import type { ModalImplProps } from "./components/Modal"
99
import type { PanelImplProps } from "./components/Panel"
@@ -158,16 +158,18 @@ export const UIProvider: React.FC<UIProviderProps> = ({ children }) => {
158158
const addToast = useCallback(
159159
(variant: VariantType, ...contents: SnackbarMessage[]) => {
160160
enqueueSnackbar(
161-
contents.length <= 1
162-
? { ...contents }
163-
: {
164-
...contents.map(child => (
165-
<>
166-
{child}
167-
<br />
168-
</>
169-
)),
170-
},
161+
contents.length <= 1 ? (
162+
(contents[0] ?? "")
163+
) : (
164+
<span>
165+
{contents.map((content, index) => (
166+
<Fragment key={index}>
167+
{content}
168+
{index < contents.length - 1 && <br />}
169+
</Fragment>
170+
))}
171+
</span>
172+
),
171173
{ variant, action: snackbarAction }
172174
)
173175
},

fission/src/ui/panels/configuring/assembly-config/interfaces/cameras/CameraConfigInterface.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const CameraConfigInterface: React.FC<CameraConfigInterfaceProps> = ({ selectedR
101101
const gizmoComponent = useMemo(() => {
102102
if (!camera) {
103103
gizmoRef.current = undefined
104-
return <></>
104+
return null
105105
}
106106

107107
const postGizmoCreation = (gizmo: GizmoSceneObject) => {

0 commit comments

Comments
 (0)