Skip to content

Commit

Permalink
Tidy up things before starting to code
Browse files Browse the repository at this point in the history
  • Loading branch information
abelfodil committed Sep 19, 2020
1 parent 72c727c commit daee4dc
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 42 deletions.
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.
49 changes: 36 additions & 13 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 Home from 'views/home';
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="/" render={() => <Home />} />
<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
Expand Up @@ -2,28 +2,25 @@ 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';

const SleepAnalysis = () => {
const Home = () => {
const csvDataSleepEDF = useCSVData(hypnogramDataSleepEDFPath);

return (
<div>
<Navbar />
<Header
sizeClass={'pb-150'}
shapeQty={7}
Expand Down Expand Up @@ -123,9 +120,8 @@ const SleepAnalysis = () => {
Check out the performances
</Button>
</Container>
<Footer />
</div>
);
};

export default SleepAnalysis;
export default Home;
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
File renamed without changes.
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

0 comments on commit daee4dc

Please sign in to comment.