Skip to content

Commit

Permalink
chore: fix typings
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Jan 2, 2025
1 parent 5cbaefa commit d2ca2ed
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion packages/presentation/src/editor/ContentEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export function ContentEditor(props: {
[mainDocumentState, schema],
)

// @ts-expect-error fix later
const previewState = usePreviewState(mainDocumentState?.document?._id || '', schemaType)

const preview = useMemo(() => {
Expand Down
1 change: 0 additions & 1 deletion packages/presentation/src/editor/usePreviewState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export default function usePreviewState(documentId: string, schemaType?: SchemaT
}
const subscription = getPreviewStateObservable(
documentPreviewStore,
// @ts-expect-error fix later
schemaType,
documentId,
'',
Expand Down
7 changes: 6 additions & 1 deletion packages/presentation/src/overlays/schema/SchemaIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ export const SchemaIcon: FunctionComponent<{
return Icon ? (
<StyleSheetManager sheet={sheet.instance}>
<ThemeProvider theme={theme} scheme={scheme} tone={tone}>
{isValidElement(Icon) ? Icon : <Icon />}
{isValidElement(Icon) ? (
Icon
) : (
// @ts-expect-error -- @todo: fix typings
<Icon />
)}
</ThemeProvider>
</StyleSheetManager>
) : null
Expand Down
3 changes: 0 additions & 3 deletions packages/presentation/src/overlays/schema/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,23 +207,20 @@ export function extractSchema(workspace: Workspace, theme: ThemeContextValue): S
const inlineFields = new Set<SanitySchemaType>()
const {schema: schemaDef, basePath} = workspace

// @ts-expect-error fix later
const sortedSchemaTypeNames = sortByDependencies(schemaDef)
return sortedSchemaTypeNames
.map((typeName) => {
const schemaType = schemaDef.get(typeName)
if (schemaType === undefined) {
return
}
// @ts-expect-error fix later
const base = convertBaseType(schemaType)

if (base === null) {
return
}

if (base.type === 'type') {
// @ts-expect-error fix later
inlineFields.add(schemaType)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const InsertMenu: FunctionComponent<InsertMenuProps> = (props) => {
...type,
icon: getNodeIcon(type),
}))}
// @ts-expect-error -- @todo fix typings
onSelect={onSelect}
views={views}
/>
Expand Down

0 comments on commit d2ca2ed

Please sign in to comment.