From e28d6090131875b37237ccc6ba86714d3ca62e87 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 2 May 2020 19:32:38 +0200 Subject: [PATCH] Client - minor style change --- .../src/components/Admin/AdminApplication.jsx | 8 +- .../src/components/Admin/AdminDashboard.jsx | 108 +++++++++--------- .../src/components/Admin/AdminSports.jsx | 8 +- .../src/components/Admin/AdminUsers.jsx | 8 +- fittrackee_client/src/components/App.css | 87 +++++++------- .../src/components/Dashboard/index.jsx | 1 + .../src/components/NavBar/index.jsx | 23 ++-- .../src/components/User/ProfileDetail.jsx | 90 +++++++++------ fittrackee_client/src/locales/en/common.json | 1 + fittrackee_client/src/locales/en/user.json | 1 + fittrackee_client/src/locales/fr/common.json | 1 + fittrackee_client/src/locales/fr/user.json | 1 + 12 files changed, 179 insertions(+), 158 deletions(-) diff --git a/fittrackee_client/src/components/Admin/AdminApplication.jsx b/fittrackee_client/src/components/Admin/AdminApplication.jsx index 56298031..9160047c 100644 --- a/fittrackee_client/src/components/Admin/AdminApplication.jsx +++ b/fittrackee_client/src/components/Admin/AdminApplication.jsx @@ -1,6 +1,5 @@ import React from 'react' import { connect } from 'react-redux' -import { Helmet } from 'react-helmet' import Message from '../Common/Message' import { updateAppConfig } from '../../actions/application' @@ -56,16 +55,15 @@ class AdminApplication extends React.Component { const { formData, isInEdition } = this.state return (
- - FitTrackee - {t('administration:Application configuration')} - {message && } {Object.keys(formData).length > 0 && (
- {t('administration:Application configuration')} + + {t('administration:Application configuration')} +
- - {t('administration:FitTrackee administration')} - -
-
{t('administration:Administration')}
-
- -
-
-
- - {t('administration:Application')} - -
-
- {t( - 'administration:Update application configuration ' + - '(maximum number of registered users, maximum files size).' - )}{' '} -
-
-
- - {t('administration:Sports')} - -
-
{t('administration:Enable/disable sports.')}
-
-
- - {t('administration:Users')} - -
-
- {t( - 'administration:Add/remove admin rigths, ' + - 'delete user account.' - )} -
-
-
+
+
+ {t('administration:Administration')}
- +
+ +
+
+
+ + {t('administration:Application')} + +
+
+ {t( + 'administration:Update application configuration ' + + '(maximum number of registered users, maximum files size).' + )}{' '} +
+
+
+ + {t('administration:Sports')} + +
+
{t('administration:Enable/disable sports.')}
+
+
+ + {t('administration:Users')} + +
+
+ {t( + 'administration:Add/remove admin rigths, ' + + 'delete user account.' + )} +
+
+
+
) } diff --git a/fittrackee_client/src/components/Admin/AdminSports.jsx b/fittrackee_client/src/components/Admin/AdminSports.jsx index 7083cf80..9d4dd0df 100644 --- a/fittrackee_client/src/components/Admin/AdminSports.jsx +++ b/fittrackee_client/src/components/Admin/AdminSports.jsx @@ -1,6 +1,5 @@ import React from 'react' import { connect } from 'react-redux' -import { Helmet } from 'react-helmet' import Message from '../Common/Message' import { getOrUpdateData } from '../../actions' @@ -15,14 +14,13 @@ class AdminSports extends React.Component { const { message, sports, t, updateSport } = this.props return (
- - FitTrackee - {t('administration:Administration')} - {message && }
-
{t('administration:Sports')}
+
+ {t('administration:Sports')} +
{sports.length > 0 && ( diff --git a/fittrackee_client/src/components/Admin/AdminUsers.jsx b/fittrackee_client/src/components/Admin/AdminUsers.jsx index 52348e98..483a43d5 100644 --- a/fittrackee_client/src/components/Admin/AdminUsers.jsx +++ b/fittrackee_client/src/components/Admin/AdminUsers.jsx @@ -1,7 +1,6 @@ import { format } from 'date-fns' import React from 'react' import { connect } from 'react-redux' -import { Helmet } from 'react-helmet' import { Link } from 'react-router-dom' import Message from '../Common/Message' @@ -70,15 +69,14 @@ class AdminUsers extends React.Component { const translatedSortOrders = translateValues(t, sortOrders) return (
- - FitTrackee - {t('administration:Administration')} - {message && }
-
{t('administration:Users')}
+
+ {t('administration:Users')} +
diff --git a/fittrackee_client/src/components/App.css b/fittrackee_client/src/components/App.css index d7a82f24..f4e52a86 100644 --- a/fittrackee_client/src/components/App.css +++ b/fittrackee_client/src/components/App.css @@ -428,7 +428,7 @@ label { } .no-picture { - color: #40578a; + color: #405976; } .page-title { @@ -524,49 +524,11 @@ label { .user-filters { font-size: 0.9em; - margin-bottom: 5px; + margin-bottom: 10px; } - - -/* adapted from https://uglyduck.ca/making-tables-responsive-with-minimal-css/ */ -.heading-span { - background: #eee; - color: dimgrey; - display: none; - font-size: 10px; - font-weight: bold; - padding: 5px; - position: absolute; - text-transform: uppercase; - top: 0; - left: 0; -} - -@media(max-width: 1024px) { - table thead { - left: -9999px; - position: absolute; - visibility: hidden; - } - table tr { - border-bottom: 0; - display: flex; - flex-direction: row; - flex-wrap: wrap; - margin-bottom: 40px; - } - table td { - border: 1px solid lightgrey; - margin: 0 -1px -1px 0; - padding-top: 35px !important; - position: relative; - text-align: center; - width: 50%; - } - .heading-span { - display: block; - } +.user-label { + font-weight: bold; } .weather-img { @@ -588,8 +550,45 @@ label { padding: 0.1em; } -.user-table { - font-size: 0.9em; +/* responsive table */ +/* adapted from https://uglyduck.ca/making-tables-responsive-with-minimal-css/ */ +.heading-span { + background: #eee; + color: dimgrey; + display: none; + font-size: 10px; + font-weight: bold; + padding: 5px; + position: absolute; + text-transform: uppercase; + top: 0; + left: 0; +} + +@media(max-width: 1024px) { + table thead { + left: -9999px; + position: absolute; + visibility: hidden; + } + table tr { + border-bottom: 0; + display: flex; + flex-direction: row; + flex-wrap: wrap; + margin-bottom: 40px; + } + table td { + border: 1px solid lightgrey; + margin: 0 -1px -1px 0; + padding-top: 35px !important; + position: relative; + text-align: center; + width: 50%; + } + .heading-span { + display: block; + } } /* calendar */ diff --git a/fittrackee_client/src/components/Dashboard/index.jsx b/fittrackee_client/src/components/Dashboard/index.jsx index 4ff840c3..c2732f63 100644 --- a/fittrackee_client/src/components/Dashboard/index.jsx +++ b/fittrackee_client/src/components/Dashboard/index.jsx @@ -49,6 +49,7 @@ class DashBoard extends React.Component { ) : ( activities && + user.total_duration && sports.length > 0 && (
diff --git a/fittrackee_client/src/components/NavBar/index.jsx b/fittrackee_client/src/components/NavBar/index.jsx index dc89aa68..5dcec83a 100644 --- a/fittrackee_client/src/components/NavBar/index.jsx +++ b/fittrackee_client/src/components/NavBar/index.jsx @@ -117,14 +117,20 @@ class NavBar extends React.PureComponent { )} - {picture === true && ( - Avatar - )} {isAuthenticated && ( + <> + {picture === true ? ( + Avatar + ) : ( +