Skip to content

Commit

Permalink
chore(deps): Remove @discretize/globals dependency (#849)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcustyphoon authored Dec 28, 2024
1 parent a6f242d commit 592d15b
Show file tree
Hide file tree
Showing 9 changed files with 354 additions and 148 deletions.
2 changes: 1 addition & 1 deletion build/main.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { globals } from '@discretize/globals';
import '@discretize/gw2-ui-new/dist/default_style.css';
import '@discretize/gw2-ui-new/dist/index.css';
import '@discretize/react-discretize-components/dist/index.css';
Expand All @@ -7,6 +6,7 @@ import { CssBaseline, ThemeProvider } from '@mui/material';
import React from 'react';
import { createRoot } from 'react-dom/client';
import { Provider } from 'react-redux';
import { globals } from '../src/utils/globals';
import IndexPage from '../src/pages/build/index';
import store from '../src/state/store';
import muiTheme from '../src/utils/placeholder-unused-theme';
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"[email protected]": "^0.29.0"
},
"dependencies": {
"@discretize/globals": "^0.0.4",
"@discretize/gw2-ui-new": "^0.1.7",
"@discretize/object-compression": "^1.0.3",
"@discretize/react-discretize-components": "^3.0.3",
Expand Down
144 changes: 0 additions & 144 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/pages/build/index.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Layout } from '@discretize/globals';
import { APILanguageProvider } from '@discretize/gw2-ui-new';
import { Box, Chip, Typography } from '@mui/material';
import { Trans, useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
import { Layout } from '../../utils/globals';
import BuildPage from '../../components/BuildPage';
import BackgroundImage from '../../components/baseComponents/BackgroundImage';
import ErrorBoundary from '../../components/baseComponents/ErrorBoundary';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index/main.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { globals } from '@discretize/globals';
import '@discretize/gw2-ui-new/dist/default_style.css';
import '@discretize/gw2-ui-new/dist/index.css';
import '@discretize/react-discretize-components/dist/index.css';
Expand All @@ -8,6 +7,7 @@ import { CssBaseline, ThemeProvider } from '@mui/material';
import React from 'react';
import { createRoot } from 'react-dom/client';
import { Provider } from 'react-redux';
import { globals } from '../../utils/globals';
import 'typeface-fira-mono';
import 'typeface-muli';
import 'typeface-raleway';
Expand Down
4 changes: 4 additions & 0 deletions src/utils/globals/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import globals from './styles/globals';
import Layout from './styles/Layout';

export { globals, Layout };
23 changes: 23 additions & 0 deletions src/utils/globals/styles/Layout.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Box, Container, useMediaQuery, useTheme } from '@mui/material';

const Layout = ({ children, ContainerProps, disableContainer = false }) => {
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down('lg'));
return (
(!disableContainer && !isMobile && (
<Container maxWidth="lg" {...ContainerProps}>
<Box
sx={{
padding: 2,
backgroundColor: 'background.default',
boxShadow: 5,
}}
>
{children}
</Box>
</Container>
)) || <Box sx={{ p: 2 }}>{children}</Box>
);
};

export default Layout;
Loading

0 comments on commit 592d15b

Please sign in to comment.