Skip to content

Commit

Permalink
docs: styles & property name fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fatihky committed May 18, 2024
1 parent ea45f36 commit 2bc484b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions docs/src/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
} from '@mantine/core';
import { Editor, useMonaco } from '@monaco-editor/react';
import {
IconFileExport,
IconHtml,
IconJson,
IconSettingsAutomation,
Expand All @@ -33,7 +34,7 @@ export function Playground() {
const [html, setHtml] = useState('');
const [htmlFileContents, setHtmlFileContents] = useState<string | null>(null);
const { configIsValid, result } = usePureHtml({
inputHTML: htmlFileContents ?? html,
inputHtml: htmlFileContents ?? html,
configYaml: config,
});
const onHtmlFileChange = useCallback(
Expand Down Expand Up @@ -124,9 +125,10 @@ export function Playground() {
<FileInput
accept="text/html"
clearable
label="Select an HTML file"
placeholder="Select a file"
m="sm"
mt="0"
mt="xs"
leftSection={<IconFileExport />}
onChange={onHtmlFileChange}
/>
</Paper>
Expand Down
8 changes: 4 additions & 4 deletions docs/src/hooks/usePureHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export interface UsePureHtml {
}

export function usePureHtml({
inputHTML,
inputHtml,
configYaml,
}: {
inputHTML: string;
inputHtml: string;
configYaml: string;
}): UsePureHtml {
const [state, setState] = useState<UsePureHtml>({
Expand All @@ -22,8 +22,8 @@ export function usePureHtml({
});
// cache cheerio.load call for handling big HTMLs
const input = useMemo<cheerio.Root | null>(
() => (inputHTML ? load(inputHTML) : null),
[inputHTML]
() => (inputHtml ? load(inputHtml) : null),
[inputHtml]
);
const [config, setConfig] = useState<unknown>(null);

Expand Down

0 comments on commit 2bc484b

Please sign in to comment.