Skip to content

Commit

Permalink
Apply review
Browse files Browse the repository at this point in the history
  • Loading branch information
djhi committed May 7, 2021
1 parent 2e9f523 commit 89e8233
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import { defaultTheme } from 'ra-ui-materialui';
import FolderIcon from '@material-ui/icons/Folder';
import { Application } from './types';
import { NewApplicationForm } from './NewApplicationForm';
import {
loadApplicationsFromStorage,
storeApplicationsInStorage,
} from './applicationStorage';

export const ApplicationsDashboard = ({ onApplicationSelected }) => (
<ThemeProvider theme={createMuiTheme(defaultTheme)}>
Expand Down Expand Up @@ -85,25 +89,6 @@ const Applications = ({ onApplicationSelected }) => {
);
};

const loadApplicationsFromStorage = () => {
const storedValue = window.localStorage.getItem(
'@@ra-no-code/applications'
);

if (storedValue) {
return JSON.parse(storedValue);
}

return [];
};

const storeApplicationsInStorage = applications => {
window.localStorage.setItem(
'@@ra-no-code/applications',
JSON.stringify(applications)
);
};

const useStyles = makeStyles(theme => ({
main: {
width: '100vw',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export const loadApplicationsFromStorage = () => {
const storedValue = window.localStorage.getItem(
'@@ra-no-code/applications'
);

if (storedValue) {
return JSON.parse(storedValue);
}

return [];
};

export const storeApplicationsInStorage = applications => {
window.localStorage.setItem(
'@@ra-no-code/applications',
JSON.stringify(applications)
);
};

0 comments on commit 89e8233

Please sign in to comment.