SessionSummary design

master
Tudor Stanciu 2020-05-14 00:12:19 +03:00
parent 72456e3630
commit 8d2f0bb38d
4 changed files with 17 additions and 13 deletions

View File

@ -18,6 +18,7 @@
"About": "About" "About": "About"
}, },
"Session": { "Session": {
"Title": "Sessions",
"Session": "Session", "Session": "Session",
"Active": "Active", "Active": "Active",
"StartDate": "Start date", "StartDate": "Start date",

View File

@ -9,6 +9,7 @@
"About": "Despre" "About": "Despre"
}, },
"Session": { "Session": {
"Title": "Sesiuni",
"Session": "Sesiune", "Session": "Sesiune",
"Active": "Activă", "Active": "Activă",
"StartDate": "Dată pornire", "StartDate": "Dată pornire",

View File

@ -8,6 +8,7 @@ import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
import SessionSummary from "./SessionSummary"; import SessionSummary from "./SessionSummary";
import Spinner from "../../../components/common/Spinner"; import Spinner from "../../../components/common/Spinner";
import { useTranslation } from "react-i18next";
const useStyles = makeStyles((theme) => ({ const useStyles = makeStyles((theme) => ({
root: { root: {
@ -21,10 +22,11 @@ const useStyles = makeStyles((theme) => ({
const SessionListComponent = ({ sessions }) => { const SessionListComponent = ({ sessions }) => {
const classes = useStyles(); const classes = useStyles();
const { t } = useTranslation();
return ( return (
<div className={classes.root}> <div className={classes.root}>
<h2>Sessions</h2> <h2>{t("Session.Title")}</h2>
{sessions.loading ? ( {sessions.loading ? (
<Spinner /> <Spinner />
) : ( ) : (

View File

@ -25,7 +25,7 @@ const SessionSummary = ({ session }) => {
{`${t("Session.Session")}: `} {`${t("Session.Session")}: `}
<span className={classes.value}>{session.sessionId}</span> <span className={classes.value}>{session.sessionId}</span>
</Grid> </Grid>
<Grid item xs={12} sm={2} md={2}> <Grid item xs={12} sm={3} md={3}>
{`${t("Session.Active")}: `} {`${t("Session.Active")}: `}
{session.active ? ( {session.active ? (
<CheckCircleOutlineRounded color="primary" /> <CheckCircleOutlineRounded color="primary" />
@ -33,7 +33,7 @@ const SessionSummary = ({ session }) => {
<RemoveRounded /> <RemoveRounded />
)} )}
</Grid> </Grid>
<Grid item xs={12} sm={3} md={3}> <Grid item xs={12} sm={4} md={4}>
{`${t("Session.StartDate")}: `} {`${t("Session.StartDate")}: `}
<span className={classes.value}> <span className={classes.value}>
{t("DATE_FORMAT", { {t("DATE_FORMAT", {
@ -42,7 +42,17 @@ const SessionSummary = ({ session }) => {
</span> </span>
</Grid> </Grid>
<Grid item xs={12} sm={5} md={5}>
{`${t("Session.RunningTime")}: `}
<span className={classes.value}>{session.runningTime}</span>
</Grid>
<Grid item xs={12} sm={3} md={3}> <Grid item xs={12} sm={3} md={3}>
{`${t("Session.Host")}: `}
<span className={classes.value}>{session.hostName}</span>
</Grid>
<Grid item xs={12} sm={4} md={4}>
{`${t("Session.StopDate")}: `} {`${t("Session.StopDate")}: `}
<span className={classes.value}> <span className={classes.value}>
{session.stopDate {session.stopDate
@ -55,16 +65,6 @@ const SessionSummary = ({ session }) => {
: "---"} : "---"}
</span> </span>
</Grid> </Grid>
<Grid item xs={12} sm={3} md={3}>
{`${t("Session.RunningTime")}: `}
<span className={classes.value}>{session.runningTime}</span>
</Grid>
<Grid item xs={12} sm={3} md={3}>
{`${t("Session.Host")}: `}
<span className={classes.value}>{session.hostName}</span>
</Grid>
</Grid> </Grid>
</> </>
); );