Skip to content

Commit

Permalink
#16 Update material version to integrate theme
Browse files Browse the repository at this point in the history
  • Loading branch information
vidhya-metacell committed Jul 29, 2022
1 parent 162f501 commit 7f18fb3
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion example/components/widgets/CustomNodeWidget.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from "react";
import {DiagramEngine} from "@projectstorm/react-diagrams";
import {MetaNodeModel} from "../../../.";
import {Box, Typography} from "@material-ui/core";
import {Box, Typography} from "@mui/material";
import NodeSelection from "./NodeSelection";

export interface CustomNodeWidgetProps {
Expand Down
2 changes: 1 addition & 1 deletion example/components/widgets/NodeSelection.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Button } from "@material-ui/core";
import { Box, Button } from "@mui/material";
import { DiagramEngine, PortWidget } from "@projectstorm/react-diagrams";
import * as React from "react";
import PortWigetComp from "./PortWidgetComp";
Expand Down
2 changes: 1 addition & 1 deletion example/components/widgets/PortWidgetComp.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { Box } from "@material-ui/core";
import { Box } from "@mui/material";
import { PortWidget } from "@projectstorm/react-diagrams";

const PortWigetComp = (props) => {
Expand Down
9 changes: 4 additions & 5 deletions example/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import * as React from 'react';
import * as ReactDOM from 'react-dom';
import MetaDiagram, {MetaNode, Position, ComponentsMap, MetaLink} from "./..";
import {CustomNodeWidget} from "./components/widgets/CustomNodeWidget";
import {makeStyles} from "@material-ui/core";
import { makeStyles } from "@mui/styles";
import CustomLinkWidget from "./components/widgets/CustomLinkWidget";
import BG from "./components/assets/svg/bg-dotted.svg";
import { nodeIcons } from "./components/assets/styles/constants";
import { ThemeProvider } from '@material-ui/core/styles';
import CssBaseline from '@material-ui/core/CssBaseline';
import { ThemeProvider } from '@mui/material';
import CssBaseline from '@mui/material/CssBaseline';
import theme from './theme';

const useStyles = makeStyles(_ => ({
Expand Down Expand Up @@ -38,7 +37,7 @@ const App = () => {
new Map(Object.entries({'default': CustomNodeWidget})),
new Map(Object.entries({'default': CustomLinkWidget}))
)
console.log(theme)

return (
<ThemeProvider theme={theme}>
<CssBaseline />
Expand Down
12 changes: 8 additions & 4 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
"build": "parcel build index.html"
},
"dependencies": {
"@material-ui/core": "^4.12.4",
"react": "^16.8.0 || ^17.0.0",
"@emotion/react": "^11.9.3",
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.8.4",
"@mui/styles": "^5.8.4",
"react-app-polyfill": "^1.0.0",
"react-dom": "^16.8.0 || ^17.0.0",
"react-is": "^18.2.0"
"react-is": "^18.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"alias": {
"react": "../node_modules/react",
Expand Down
4 changes: 2 additions & 2 deletions example/theme.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import vars from './components/assets/styles/variables';
import { createTheme } from '@material-ui/core/styles';
import { createTheme } from '@mui/material/styles';

const {
nodeRedBackgroundColor,
Expand All @@ -15,7 +15,7 @@ const {
nodeGrayBorderColor,
nodeGrayTextColor,
} = vars;
declare module '@material-ui/core/styles' {
declare module '@mui/styles' {
interface Theme {
components: {
MuiCssBaseline: any;
Expand Down

0 comments on commit 7f18fb3

Please sign in to comment.