Skip to content

Commit

Permalink
[editor] Add MantineProvider to Unblock Styling Work
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Holinshead committed Dec 27, 2023
1 parent e2d893f commit 14dfa12
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
28 changes: 15 additions & 13 deletions python/src/aiconfig/editor/client/src/Editor.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import EditorContainer from "./components/EditorContainer";
import { ClientAIConfig } from "./shared/types";
import { Flex, Loader } from "@mantine/core";
import { Flex, Loader, MantineProvider } from "@mantine/core";
import { AIConfig, Prompt } from "aiconfig";
import { useCallback, useEffect, useState } from "react";
import { ufetch } from "ufetch";
Expand Down Expand Up @@ -51,18 +51,20 @@ export default function Editor() {

return (
<div>
{!aiconfig ? (
<Flex justify="center" mt="xl">
<Loader size="xl" />
</Flex>
) : (
<EditorContainer
aiconfig={aiconfig}
onSave={onSave}
getModels={getModels}
addPrompt={addPrompt}
/>
)}
<MantineProvider withGlobalStyles withNormalizeCSS>
{!aiconfig ? (
<Flex justify="center" mt="xl">
<Loader size="xl" />
</Flex>
) : (
<EditorContainer
aiconfig={aiconfig}
onSave={onSave}
getModels={getModels}
addPrompt={addPrompt}
/>
)}
</MantineProvider>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,6 @@ export default memo(function ParametersRenderer(props: {
});
}, [onUpdateParameters]);

// TODO: saqadri - add MantineProvider wrapper inside EditorContainer in order for this to pick up context
const theme = useMantineTheme();

return (
<div
style={{
Expand Down

0 comments on commit 14dfa12

Please sign in to comment.