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

Tidy up react code #21

Merged
merged 1 commit into from
Sep 20, 2020
Merged
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
File renamed without changes.
10 changes: 5 additions & 5 deletions web/src/components/footer/partners.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { Container, Row } from 'reactstrap';

import text from './text.json';

import Polymtl from '../../assets/img/partners/polymtl.png';
import AEP from '../../assets/img/partners/aep.png';
import Protocase from '../../assets/img/partners/protocase.png';
import NTX from '../../assets/img/partners/ntx.png';
import Diptrace from '../../assets/img/partners/diptrace.png';
import Polymtl from 'assets/img/partners/polymtl.png';
import AEP from 'assets/img/partners/aep.png';
import Protocase from 'assets/img/partners/protocase.png';
import NTX from 'assets/img/partners/ntx.png';
import Diptrace from 'assets/img/partners/diptrace.png';

const Partner = ({ img, alt, width }) => {
return <img alt={alt} className="img-center img-fluid" src={img} style={{ width: `${width}px` }} />;
Expand Down
File renamed without changes.
47 changes: 35 additions & 12 deletions web/src/index.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,58 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter, Route, Switch, Redirect } from 'react-router-dom';
import { Container } from 'reactstrap';

import 'argon-design-system-react/src/assets/vendor/nucleo/css/nucleo.css';
import 'argon-design-system-react/src/assets/vendor/font-awesome/css/font-awesome.min.css';
import 'argon-design-system-react/src/assets/scss/argon-design-system-react.scss';
import 'assets/css/visualisation.css';

import SleepAnalysis from 'views/sleep_analysis/sleep_analysis';
import Performance from 'views/performance/performance';
import Header from 'components/header';
import Footer from 'components/footer';
import Navbar from 'components/navbar';
import SleepAnalysis from 'views/sleep-analysis';
import Performance from 'views/performance';
import ScrollToTop from 'components/scroll_to_top';
import Emoji from 'components/emoji';

const underConstruction = () => {
const text = {
header_title: 'Under',
header_subtitle: 'construction',
header_description: 'Please come back later',
};

return (
<div>
<Header
sizeClass={'pb-100'}
shapeQty={7}
title={text['header_title']}
subtitle={text['header_subtitle']}
description={text['header_description']}
/>
<Container className="mt-5 text-justify">
<h1 className="">
Under Construction... <Emoji symbol="🏗️" />
</h1>
</Container>
</div>
);
};

ReactDOM.render(
<BrowserRouter basename={process.env.PUBLIC_URL}>
<ScrollToTop>
<Navbar />
<Switch>
<Route exact path="/" render={() => <SleepAnalysis />} />
<Route
exact
path="/record-my-sleep"
render={() => (
<h1 className="">
Under Construction... <Emoji symbol="🏗️" />
</h1>
)}
/>
<Route exact path="/analyze-my-sleep" render={() => <SleepAnalysis />} />
<Route exact path="/record-my-sleep" render={underConstruction} />
<Route exact path="/analyze-my-sleep" render={underConstruction} />
<Route exact path="/performance" render={() => <Performance />} />
<Redirect to="/" />
</Switch>
<Footer />
</ScrollToTop>
</BrowserRouter>,
document.getElementById('root'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import React from 'react';
import { Container, Row, Table } from 'reactstrap';

import Navbar from '../../components/navbar/navbar';
import Header from '../../components/header';
import WIPWarning from '../../components/wip_warning';
import Footer from '../../components/footer/footer';
import D3Component from '../../components/d3component';
import Header from 'components/header';
import WIPWarning from 'components/wip_warning';
import D3Component from 'components/d3component';

import text from './text.json';
import { createComparativeHypnogram } from 'd3/hypnogram/hypnogram';
import { useCSVData } from '../../hooks/api_hooks';
import { useCSVData } from 'hooks/api_hooks';

import hypnogramDataSleepEDF from 'assets/data/hypnogram.csv';
import hypnogramDataPredicted from 'assets/data/hypnogram-predicted.csv';
Expand Down Expand Up @@ -52,7 +50,6 @@ const Performance = () => {

return (
<div>
<Navbar />
<Header
sizeClass={'pb-100'}
shapeQty={7}
Expand Down Expand Up @@ -134,7 +131,6 @@ const Performance = () => {
]}
/>
</Container>
<Footer />
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ import React from 'react';
import { Container, Row, Button } from 'reactstrap';
import { Link } from 'react-router-dom';

import Navbar from '../../components/navbar/navbar';
import Header from '../../components/header';
import Footer from '../../components/footer/footer';
import D3Component from '../../components/d3component';
import WIPWarning from '../../components/wip_warning';
import Header from 'components/header';
import D3Component from 'components/d3component';
import WIPWarning from 'components/wip_warning';

import { createSingleHypnogram } from '../../d3/hypnogram/hypnogram';
import { createSingleHypnogram } from 'd3/hypnogram/hypnogram';

import text from './text.json';
import createSpectrogram from '../../d3/spectrogram/spectrogram';
import createSpectrogram from 'd3/spectrogram/spectrogram';
import StackedBarChartScrollyTelling from './stacked_bar_chart_scrollytelling';
import { useCSVData } from '../../hooks/api_hooks';
import { useCSVData } from 'hooks/api_hooks';

import hypnogramDataSleepEDFPath from 'assets/data/hypnogram.csv';
import spectrogramData from 'assets/data/spectrograms.json';
Expand All @@ -23,7 +21,6 @@ const SleepAnalysis = () => {

return (
<div>
<Navbar />
<Header
sizeClass={'pb-150'}
shapeQty={7}
Expand Down Expand Up @@ -123,7 +120,6 @@ const SleepAnalysis = () => {
Check out the performances
</Button>
</Container>
<Footer />
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import { Container, Card, CardBody } from 'reactstrap';

import hypnogramCSVPath from 'assets/data/hypnogram.csv';

import D3Component from '../../components/d3component';
import WaypointDirection from '../../components/waypoint_direction';
import D3Component from 'components/d3component';
import WaypointDirection from 'components/waypoint_direction';

import createEvolvingChart, {
instanceChartCallbacks,
timelineChartCallbacks,
barChartCallbacks,
stackedBarChartCallbacks,
} from '../../d3/evolving_chart/evolving_chart';
import { useCSVData } from '../../hooks/api_hooks';
} from 'd3/evolving_chart/evolving_chart';
import { useCSVData } from 'hooks/api_hooks';

const StackedBarChartScrollyTelling = () => {
const csvData = useCSVData(hypnogramCSVPath);
Expand Down