Skip to content

Commit

Permalink
remove single entry point, use only direct paths for utils
Browse files Browse the repository at this point in the history
  • Loading branch information
suren-atoyan committed Dec 5, 2020
1 parent 1b32cce commit 6302edc
Show file tree
Hide file tree
Showing 22 changed files with 146 additions and 147 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
### Releases

## v1.1.0
###### *Dec 6, 2020*

- package.json: update `recoil` version to 0.1.2
- components:
- Divider: add property `withoutMargins`, change margins based on `orientation`
- Loading: add first class property `position`
- NotFound: add 404 gif from `giphy`, move from `Box` to `Fb`
- Link: fix `export default` style
- Fb: create flexbox component

## v1.0.2
###### *Sep 7, 2020*

Expand Down
6 changes: 3 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React from 'react';

import { RecoilRoot } from 'recoil';
import CssBaseline from '@material-ui/core/CssBaseline';
import Box from '@material-ui/core/Box';

import withErrorHandler from 'errorHandling';
import { App as ErrorBoundaryFallback } from 'errorHandling/Fallbacks';

import Layout from 'sections/Layout';
import Fb from 'components/Fb';
import { ThemeProvider } from 'theme';

import { BrowserRouter as Router } from 'react-router-dom';
Expand All @@ -16,12 +16,12 @@ function App() {
return (
<RecoilRoot>
<ThemeProvider>
<Box display="flex">
<Fb>
<CssBaseline />
<Router>
<Layout />
</Router>
</Box>
</Fb>
</ThemeProvider>
</RecoilRoot>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Page/styles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { makeStyles } from '@material-ui/core/styles';

import { isMobile } from 'utils';
import isMobile from 'utils/isMobile';

const useStyles = makeStyles(theme => ({
root: {
Expand Down
2 changes: 1 addition & 1 deletion src/errorHandling/Fallbacks/App/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Button from '@material-ui/core/Button';

import { FaRedo as ResetIcon } from 'react-icons/fa';

import { resetApp } from 'utils';
import resetApp from 'utils/resetApp';
import { messages, email } from 'config';

import useStyles from './styles';
Expand Down
13 changes: 13 additions & 0 deletions src/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,16 @@ body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.full-width {
width: 100%;
}

.full-height {
height: 100%;
}

.full-size {
width: 100%;
height: 100%;
}
12 changes: 6 additions & 6 deletions src/pages/Welcome/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@ import React from 'react';

import Container from '@material-ui/core/Container';
import Typography from '@material-ui/core/Typography';
import Box from '@material-ui/core/Box';
import useMediaQuery from '@material-ui/core/useMediaQuery';

import { FaReact as ReactIcon } from 'react-icons/fa';

import Fb from 'components/Fb';
import Meta from 'components/Meta';

import useStyles from './styles';

function Welcome() {
const matchSmallScreen = useMediaQuery('(max-width: 600px)');
const classes = useStyles({ isSmallScreen: matchSmallScreen });
const classes = useStyles();

return (
<>
<Meta
title="Welcome"
description="Welcome to React PWA"
/>
<Container maxWidth="sm" className={classes.root}>
<Box className={classes.wrapper}>
<Box className={classes.iconBox}><ReactIcon className={classes.icon} /></Box>
<Container maxWidth="sm" className="full-height">
<Fb justifyCenter alignCenter className={classes.wrapper}>
<Fb className={classes.iconBox}><ReactIcon className={classes.icon} /></Fb>
<Typography
variant={matchSmallScreen ? 'h4' : 'h3'}
className={classes.title}
>
React PWA
</Typography>
</Box>
</Fb>
</Container>
</>
);
Expand Down
9 changes: 1 addition & 8 deletions src/pages/Welcome/styles.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import { makeStyles } from '@material-ui/core/styles';

const useStyles = makeStyles(theme => ({
root: {
display: 'flex',
'justify-content': 'center',
'align-items': 'center',
height: '100%',
},
wrapper: {
display: 'flex',
height: '100%',
'user-select': 'none',
'align-items': ({ isSmallScreen }) => isSmallScreen ? 'center' : 'initial',
'text-align': 'center',
},
icon: {
Expand Down
2 changes: 1 addition & 1 deletion src/routes/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { asyncComponentLoader } from 'utils';
import asyncComponentLoader from 'utils/asyncComponentLoader';

const routes = [
{
Expand Down
24 changes: 8 additions & 16 deletions src/sections/AppBar/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import Toolbar from '@material-ui/core/Toolbar';
import AppBar from '@material-ui/core/AppBar';
import IconButton from '@material-ui/core/IconButton';
import Button from '@material-ui/core/Button';
import Box from '@material-ui/core/Box';
import DividerMU from '@material-ui/core/Divider';
import Tooltip from '@material-ui/core/Tooltip';
import { withStyles } from '@material-ui/core/styles';

import {
FaBrush as BrushIcon,
Expand All @@ -17,6 +14,8 @@ import {
} from 'react-icons/fa';

import Link from 'components/Link';
import Fb from 'components/Fb';
import Divider from 'components/Divider';

import useTheme from 'store/theme';
import useSW from 'store/sw';
Expand All @@ -25,13 +24,6 @@ import { title, repository } from 'config';

import useStyles from './styles';

const Divider = withStyles({
root: {
'margin-left': 7,
'margin-right': 7,
},
})(props => <DividerMU flexItem orientation="vertical" {...props} />);

function AppBar_({ onMenuOpen }) {
const classes = useStyles();
const [, themeActions] = useTheme();
Expand All @@ -53,7 +45,7 @@ function AppBar_({ onMenuOpen }) {
elevation={1}
>
<Toolbar className={classes.toolbar}>
<Box display="flex" className={classes.main}>
<Fb className={classes.main}>
<IconButton
edge="start"
aria-label="open menu"
Expand All @@ -66,8 +58,8 @@ function AppBar_({ onMenuOpen }) {
{title}
</Button>
</Link>
</Box>
<Box display="flex">
</Fb>
<Fb>
{
swState.isUpdated && (
<>
Expand All @@ -76,7 +68,7 @@ function AppBar_({ onMenuOpen }) {
<RedoIcon />
</IconButton>
</Tooltip>
<Divider />
<Divider orientation="vertical" flexItem />
</>
)
}
Expand All @@ -91,7 +83,7 @@ function AppBar_({ onMenuOpen }) {
<GithubIcon />
</IconButton>
</Tooltip>
<Divider />
<Divider orientation="vertical" flexItem />
<Tooltip title="Change theme" arrow>
<IconButton
aria-label="toggle theme"
Expand All @@ -101,7 +93,7 @@ function AppBar_({ onMenuOpen }) {
<BrushIcon />
</IconButton>
</Tooltip>
</Box>
</Fb>
</Toolbar>
</AppBar>
);
Expand Down
8 changes: 4 additions & 4 deletions src/sections/Copyright/Component.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';

import Typography from '@material-ui/core/Typography';
import Box from '@material-ui/core/Box';
import Link from '@material-ui/core/Link';

import Fb from 'components/Fb';
import { copyright, domain } from 'config';

import useStyles from './styles';
Expand All @@ -12,15 +12,15 @@ function Copyright() {
const classes = useStyles();

return (
<Box pt={2} pb={2}>
<Typography className={classes.copyright} variant="body2" color="textSecondary" align="center">
<Fb justifyCenter pt={2} pb={2}>
<Typography className={classes.copyright} variant="body2" color="textSecondary">
{copyright.title}
<Link color="inherit" href={domain}>
{copyright.link}
</Link>{' '}
{new Date().getFullYear()}
</Typography>
</Box>
</Fb>
);
}

Expand Down
13 changes: 6 additions & 7 deletions src/sections/Layout/Component.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React from 'react';

import Box from '@material-ui/core/Box';

import Content from 'sections/Content';
import Copyright from 'sections/Copyright';
import Navigation from 'sections/Navigation';
import Notifications from 'sections/Notifications';

import Fb from 'components/Fb';
import useStyles from './styles';

function Layout() {
Expand All @@ -16,13 +15,13 @@ function Layout() {
<>
<Notifications />
<Navigation />
<Box component="main" className={classes.wrapper}>
<Box className={classes.spacer} />
<Box className={classes.content}>
<Fb component="main" className={classes.wrapper}>
<Fb className={classes.spacer} />
<Fb column justifyBetween className={classes.content}>
<Content />
<Copyright />
</Box>
</Box>
</Fb>
</Fb>
</>
);
}
Expand Down
6 changes: 2 additions & 4 deletions src/sections/Layout/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ const useStyles = makeStyles(theme => ({
position: 'relative',
},
content: {
display: 'flex',
'flex-direction': 'column',
'justify-content': 'space-between',
height: `calc(100% - ${theme.mixins.toolbar.minHeight + 8}px)`,
width: '100%',
height: `calc(100% - ${theme.mixins.toolbar + theme.spacing(1)}px)`,
},
}));

Expand Down
2 changes: 1 addition & 1 deletion src/sections/Menu/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
FaBug as BugIcon,
} from 'react-icons/fa';

import { isMobile } from 'utils';
import isMobile from 'utils/isMobile';

import useStyles from './styles';

Expand Down
32 changes: 0 additions & 32 deletions src/store/effects/index.js

This file was deleted.

Loading

0 comments on commit 6302edc

Please sign in to comment.