From 2abc0c923917adebbe82b52bc49933f33c535788 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sat, 6 Jun 2020 00:06:08 +0300 Subject: [PATCH] Server.Thoughts --- public/locales/en/translations.json | 4 +- public/locales/ro/translations.json | 4 +- .../server/components/ServerComponent.js | 133 +++++++++++------- .../server/components/ServerSummary.js | 10 +- 4 files changed, 91 insertions(+), 60 deletions(-) diff --git a/public/locales/en/translations.json b/public/locales/en/translations.json index 9d76ebf..85457ce 100644 --- a/public/locales/en/translations.json +++ b/public/locales/en/translations.json @@ -55,6 +55,7 @@ "Server": { "Title": "Server", "Subtitle": "Expand to see details", + "Thoughts": "This reverse proxy is the only open gate to a secret creation land. There any impulse or thought can fly free and can be materialized without limits.", "ServerHostName": "Server host", "ApiHostName": "API host", "Domain": "Domain", @@ -64,7 +65,8 @@ "Actions": { "SendMessageToAuthor": "Send message to author" }, - "MessageForAuthor": "Message for author" + "MessageForAuthor": "Message for author", + "Details": "Details" }, "Charts": { "Server": { diff --git a/public/locales/ro/translations.json b/public/locales/ro/translations.json index 72e3bfb..d22362b 100644 --- a/public/locales/ro/translations.json +++ b/public/locales/ro/translations.json @@ -46,6 +46,7 @@ "Server": { "Title": "Server", "Subtitle": "Extindeţi pentru a vedea detalii", + "Thoughts": "Acest reverse proxy este singura poartă deschisă către un teren secret al creației. Acolo orice impuls sau gând poate zbura liber și poate fi materializat fără limite.", "ServerHostName": "Gazdă server", "ApiHostName": "Gazdă API", "Domain": "Domeniu", @@ -55,7 +56,8 @@ "Actions": { "SendMessageToAuthor": "Trimite mesaj către autor" }, - "MessageForAuthor": "Mesaj pentru autor" + "MessageForAuthor": "Mesaj pentru autor", + "Details": "Detalii" }, "Charts": { "Server": { diff --git a/src/features/server/components/ServerComponent.js b/src/features/server/components/ServerComponent.js index 5642d4a..b12c1ed 100644 --- a/src/features/server/components/ServerComponent.js +++ b/src/features/server/components/ServerComponent.js @@ -10,7 +10,9 @@ import { Collapse, Avatar, IconButton, - Tooltip + Tooltip, + Menu, + MenuItem } from "@material-ui/core"; import ShareIcon from "@material-ui/icons/Share"; import ExpandMoreIcon from "@material-ui/icons/ExpandMore"; @@ -35,63 +37,94 @@ const ServerComponent = ({ const { t } = useTranslation(); const [expanded, setExpanded] = React.useState(false); + const [anchorEl, setAnchorEl] = React.useState(null); const handleExpandClick = () => { setExpanded(!expanded); }; + const handleClick = (event) => { + setAnchorEl(event.currentTarget); + }; + + const handleClose = () => { + setAnchorEl(null); + }; + + const handleDetailsClick = () => { + openAbout(); + handleClose(); + }; + return ( - - - - - } - action={ - - - - } - title={{t("Server.Title")}} - subheader={t("Server.Subtitle")} - /> - - {data.loaded && ( - - )} - - - - - - - - - - - - - - - + <> + + {t("Server.Details")} + + + + + + } + action={ + + + + } + title={{t("Server.Title")}} + subheader={t("Server.Subtitle")} + /> - + {data.loaded && ( + + )} - - + + + + + + + + + + + + + + + + + + + + ); }; diff --git a/src/features/server/components/ServerSummary.js b/src/features/server/components/ServerSummary.js index 624ac5b..248d453 100644 --- a/src/features/server/components/ServerSummary.js +++ b/src/features/server/components/ServerSummary.js @@ -7,7 +7,7 @@ import styles from "../../../components/common/styles/gridStyles"; const useStyles = makeStyles(styles); -const ServerSummary = ({ data, serverHost, openAbout, handleOpenInNewTab }) => { +const ServerSummary = ({ data, serverHost, handleOpenInNewTab }) => { const classes = useStyles(); const { t } = useTranslation(); @@ -41,12 +41,7 @@ const ServerSummary = ({ data, serverHost, openAbout, handleOpenInNewTab }) => { - { - "Bla bla bla, bla bla bla, bla bla bla, Bla bla bla, bla bla bla, bla bla bla, Bla bla bla, bla bla bla. Pentru mai multe detalii click " - } - - {"aici"} - + {t("Server.Thoughts")} @@ -56,7 +51,6 @@ const ServerSummary = ({ data, serverHost, openAbout, handleOpenInNewTab }) => { ServerSummary.propTypes = { data: PropTypes.object.isRequired, serverHost: PropTypes.string, - openAbout: PropTypes.func.isRequired, handleOpenInNewTab: PropTypes.func.isRequired };