Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored Class Components to Functional Components #10

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions tensormap-client/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
{
"env": {
"browser": true,
"es2021": true,
"jest":true
"browser": true,
"es2021": true,
"jest": true
},
"extends": [
"react-app",
"react-app/jest",
"airbnb"
"react-app",
"react-app/jest",
"airbnb"
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"react/jsx-filename-extension": "off",
"react/prop-types": "off",
"no-unused-vars": "off",
"react/function-component-definition": "off"
}
}
}

37 changes: 20 additions & 17 deletions tensormap-client/src/App.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
import {BrowserRouter, Route, Switch, Redirect} from "react-router-dom";
import Layout from "./components/Layout/Layout";
import Home from "./containers/Home/Home";
import DataUpload from "./containers/DataUpload/DataUpload";
import DataProcess from "./containers/DataProcess/DataProcess";
import DeepLearning from "./containers/DeepLearning/DeepLearning";
import React from 'react';
import {
BrowserRouter, Route, Switch, Redirect,
} from 'react-router-dom';
import Layout from './components/Layout/Layout';
import Home from './containers/Home/Home';
import DataUpload from './containers/DataUpload/DataUpload';
import DataProcess from './containers/DataProcess/DataProcess';
import DeepLearning from './containers/DeepLearning/DeepLearning';
import * as urls from './constants/Urls';

function App() {
return (
<BrowserRouter>
<Layout>
<Switch>
<Route path={urls.HOME_URL} exact component={Home} />
<Route path={urls.DATA_UPLOAD_URL} exact component={DataUpload} />
<Route path={urls.DATA_PROCESS_URL} exact component={DataProcess} />
<Route path={urls.DEEP_LEARN_URL} exact component={DeepLearning} />
<Redirect from='/' to={urls.HOME_URL} />
</Switch>
</Layout>
</BrowserRouter>
<BrowserRouter>
<Layout>
<Switch>
<Route path={urls.HOME_URL} exact component={Home} />
<Route path={urls.DATA_UPLOAD_URL} exact component={DataUpload} />
<Route path={urls.DATA_PROCESS_URL} exact component={DataProcess} />
<Route path={urls.DEEP_LEARN_URL} exact component={DeepLearning} />
<Redirect from="/" to={urls.HOME_URL} />
</Switch>
</Layout>
</BrowserRouter>
);
}

Expand Down
2 changes: 1 addition & 1 deletion tensormap-client/src/App.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import App from './App';

test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
const linkElement = screen.getByText(/TensorMap is a web application that enables you to create deep learning models using a graphical interface without having to know how to code. It is an open-source application./i);
expect(linkElement).toBeInTheDocument();
});
Loading