Merge branch 'master' into v0.2

This commit is contained in:
Sam 2019-01-06 21:57:26 +01:00
commit 68f0d47b2f
9 changed files with 95 additions and 19 deletions

View File

@ -8,13 +8,14 @@
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"
integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB"
crossorigin="anonymous">
href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css"
integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS"
crossorigin="anonymous"
>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/fork-awesome@1.0.11/css/fork-awesome.min.css"
integrity="sha256-MGU/JUq/40CFrfxjXb5pZjpoZmxiP2KuICN5ElLFNd8="
href="https://cdn.jsdelivr.net/npm/fork-awesome@1.1.5/css/fork-awesome.min.css"
integrity="sha256-P64qV9gULPHiZTdrS1nM59toStkgjM0dsf5mK/UwBV4="
crossorigin="anonymous"
>
<link
@ -34,5 +35,20 @@
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<script
src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"
></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"
integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut"
crossorigin="anonymous"
></script>
<script
src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"
integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k"
crossorigin="anonymous"
></script>
</body>
</html>

View File

@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "FitTrackee",
"name": "Self hosted workout/activity tracker",
"icons": [
{
"src": "favicon.ico",
@ -11,5 +11,6 @@
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
"background_color": "#ffffff",
"version": "0.2.0"
}

View File

@ -16,20 +16,22 @@ export default function ActivityCardHeader(props) {
<div className="container">
<div className="row">
<div className="col-auto">
{activity.next_activity ? (
{activity.previous_activity ? (
<Link
className="unlink"
to={`/activities/${activity.next_activity}`}
to={`/activities/${activity.previous_activity}`}
>
<i
className="fa fa-chevron-left"
aria-hidden="true"
title="See previous activity"
/>
</Link>
) : (
<i
className="fa fa-chevron-left inactive-link"
aria-hidden="true"
title="No previous activity"
/>
)}
</div>
@ -49,12 +51,14 @@ export default function ActivityCardHeader(props) {
<i
className="fa fa-edit custom-fa"
aria-hidden="true"
title="Edit activity"
/>
</Link>
<i
className="fa fa-trash custom-fa"
aria-hidden="true"
onClick={() => displayModal(true)}
title="Delete activity"
/><br />
{activityDate && (
<span className="activity-date">
@ -63,20 +67,22 @@ export default function ActivityCardHeader(props) {
)}
</div>
<div className="col-auto">
{activity.previous_activity ? (
{activity.next_activity ? (
<Link
className="unlink"
to={`/activities/${activity.previous_activity}`}
to={`/activities/${activity.next_activity}`}
>
<i
className="fa fa-chevron-right"
aria-hidden="true"
title="See next activity"
/>
</Link>
) : (
<i
className="fa fa-chevron-right inactive-link"
aria-hidden="true"
title="No next activity"
/>
)}
</div>

View File

@ -79,7 +79,7 @@ class ActivityDisplay extends React.Component {
</div>
<div className="card-body">
<div className="row">
<div className="col-8">
<div className="col-md-8">
{activity.with_gpx ? (
<ActivityMap activity={activity} />
) : (

View File

@ -1,7 +1,17 @@
.App {
html {
height: 100vh;
}
body {
background-color: #eaeaea;
padding-bottom: 20px;
margin: 0;
min-height: 100vh;
padding-bottom: 50px;
position: relative;
}
.App {
padding-bottom: 20px;
text-align: center;
}
@ -230,6 +240,17 @@ label {
color: #405976;
}
.footer {
background-color: #f8f9fa;
bottom: 0;
color: #8b8c8c;
font-size: 0.9em;
height: 50px;
line-height: 50px;
position: absolute;
width: 100%;
}
.huge {
font-size: 25px;
}

View File

@ -6,6 +6,7 @@ import './App.css'
import Activity from './Activity'
import Activities from './Activities'
import Dashboard from './Dashboard'
import Footer from './Footer'
import Logout from './User/Logout'
import NavBar from './NavBar'
import NotFound from './Others/NotFound'
@ -98,6 +99,7 @@ export default class App extends React.Component {
{/* <Route path="/admin" component={Admin} /> */}
<Route component={NotFound} />
</Switch>
<Footer />
</div>
)
}

View File

@ -12,7 +12,7 @@ export default function UserStatistics (props) {
duration = `${duration.split(':')[0]}h ${duration.split(':')[1]}min`
return (
<div className="row">
<div className="col">
<div className="col-md-3">
<div className="card activity-card">
<div className="card-body row">
<div className="col-3">
@ -25,7 +25,7 @@ export default function UserStatistics (props) {
</div>
</div>
</div>
<div className="col">
<div className="col-md-3">
<div className="card activity-card">
<div className="card-body row">
<div className="col-3">
@ -40,7 +40,7 @@ export default function UserStatistics (props) {
</div>
</div>
</div>
<div className="col">
<div className="col-md-3">
<div className="card activity-card">
<div className="card-body row">
<div className="col-3">
@ -53,7 +53,7 @@ export default function UserStatistics (props) {
</div>
</div>
</div>
<div className="col">
<div className="col-md-3">
<div className="card activity-card">
<div className="card-body row">
<div className="col-3">

View File

@ -0,0 +1,29 @@
import React from 'react'
import { version } from './../../utils'
export default function Footer() {
return (
<footer className="footer">
<div className="container">
<strong>FitTrackee</strong> v{version} -{' '}
<a
href="https://github.com/SamR1/FitTrackee"
target="_blank"
rel="noopener noreferrer"
>
source code
</a> under{' '}
<a
href="https://choosealicense.com/licenses/gpl-3.0/"
target="_blank"
rel="noopener noreferrer"
>
GPLv3
</a>{' '}
license
</div>
</footer>
)
}

View File

@ -1,6 +1,7 @@
import { format, parse } from 'date-fns'
import { DateTime } from 'luxon'
export const version = '0.2.0' // version stored in 'utils' for now
export const apiUrl = `${process.env.REACT_APP_API_URL}/api/`
export const thunderforestApiKey = `${
process.env.REACT_APP_THUNDERFOREST_API_KEY