Skip to content

Commit

Permalink
build: remove sample page and unused packages
Browse files Browse the repository at this point in the history
  • Loading branch information
amirfefer committed Aug 7, 2023
1 parent d3918a8 commit 67cb0c4
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 290 deletions.
103 changes: 48 additions & 55 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@
"react": "17.0.2",
"react-dom": "17.0.2",
"react-query": "^3.39.2",
"react-redux": "8.0.2",
"react-router-dom": "5.2.0",
"react-tracked": "^1.7.10",
"redux": "4.2.0",
"redux-logger": "3.0.6",
"redux-promise-middleware": "6.1.2",
"uuid": "^9.0.0"
},
"devDependencies": {
Expand Down
31 changes: 3 additions & 28 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,8 @@
import React, { Fragment, useEffect } from 'react';
import { useHistory } from 'react-router-dom';
import { Routes } from './Routes';
import React, { Fragment } from 'react';
import './App.scss';

import { getRegistry } from '@redhat-cloud-services/frontend-components-utilities/Registry';
import NotificationsPortal from '@redhat-cloud-services/frontend-components-notifications/NotificationPortal';
import { notificationsReducer } from '@redhat-cloud-services/frontend-components-notifications/redux';
import { useChrome } from '@redhat-cloud-services/frontend-components/useChrome';

const App = (props) => {
const history = useHistory();
const { on: onChromeEvent } = useChrome();

useEffect(() => {
const registry = getRegistry();
const unregister = onChromeEvent('APP_NAVIGATION', (event) => history.push(`/${event.navId}`));
registry.register({ notifications: notificationsReducer });

return () => {
unregister?.();
};
}, []);

return (
<Fragment>
<NotificationsPortal />
<Routes childProps={props} />
</Fragment>
);
const App = () => {
return <Fragment></Fragment>;
};

export default App;
13 changes: 1 addition & 12 deletions src/AppEntry.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import { Provider } from 'react-redux';
import { init } from './store';
import App from './App';
import { getBaseName } from '@redhat-cloud-services/frontend-components-utilities/helpers';
import logger from 'redux-logger';

const AppEntry = () => (
<Provider store={init(...(process.env.NODE_ENV !== 'production' ? [logger] : [])).getStore()}>
<Router basename={getBaseName(window.location.pathname)}>
<App />
</Router>
</Provider>
);
const AppEntry = () => <App />;

export default AppEntry;
32 changes: 0 additions & 32 deletions src/Routes.js

This file was deleted.

124 changes: 0 additions & 124 deletions src/Routes/SamplePage/SamplePage.js

This file was deleted.

14 changes: 0 additions & 14 deletions src/Routes/SamplePage/SamplePage.test.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/Routes/SamplePage/sample-page.scss

This file was deleted.

18 changes: 0 additions & 18 deletions src/store/index.js

This file was deleted.

0 comments on commit 67cb0c4

Please sign in to comment.