Skip to content

Commit

Permalink
happy charly??
Browse files Browse the repository at this point in the history
Less CSS but more code
  • Loading branch information
Tristan-WorkGH committed Dec 21, 2023
1 parent 0ad870c commit ba9e690
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 44 deletions.
63 changes: 23 additions & 40 deletions src/components/TopBar/AboutDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,8 @@ const styles = {
justifyContent: 'center',
},
mainInfos: {
//dl section contains dt (key) + dd (value) tuples
textAlign: 'center',
marginTop: 0,
'dt, dd': {
display: 'inline',
margin: 0,
},
dt: {
//we want keys formatted as "key: " shown
marginRight: '0.5em',
'&:after': {
content: '" :"',
},
'&:before': {
//return line before each key...
content: "'\\A'",
whiteSpace: 'pre',
},
'&:first-of-type': {
//...but not for the first line
'&:before': {
content: "''",
},
},
},
},
versionField: (isUnknown) =>
isUnknown
Expand Down Expand Up @@ -289,7 +266,7 @@ const AboutDialog = ({
appColor={theme.palette.grey['500']}
/>
</Box>
<Box component="dl" sx={styles.mainInfos}>
<Box sx={styles.mainInfos}>
<Fade
in={loadingGlobalVersion}
appear
Expand All @@ -303,20 +280,26 @@ const AboutDialog = ({
<CircularProgress />
</Fade>
{showGlobalVersion && (
<>
<Box component="dt">
<FormattedMessage id="about-dialog/version" />
</Box>
<Box
component="dd"
sx={styles.versionField(
!loadingGlobalVersion &&
actualGlobalVersion
)}
>
{actualGlobalVersion || 'unknown'}
</Box>
</>
<Typography>
<FormattedMessage
id="about-dialog/version"
defaultMessage="Version {version}"
values={{
version: (
<Typography
component="span"
sx={styles.versionField(
!loadingGlobalVersion &&
actualGlobalVersion
)}
>
{actualGlobalVersion ||
'unknown'}
</Typography>
),
}}
/>
</Typography>
)}
</Box>
</Box>
Expand Down Expand Up @@ -527,7 +510,7 @@ const Module = ({ type, name, version, gitTag, license }) => {
{version && (
<>
<Typography variant="body2" component="dt">
<FormattedMessage id="about-dialog/version" />
<FormattedMessage id="about-dialog/label-version" />
</Typography>
<Typography variant="body2" component="dd">
{version}
Expand All @@ -537,7 +520,7 @@ const Module = ({ type, name, version, gitTag, license }) => {
{gitTag && (
<>
<Typography variant="body2" component="dt">
<FormattedMessage id="about-dialog/git-version" />
<FormattedMessage id="about-dialog/label-git-version" />
</Typography>
<Typography variant="body2" component="dd">
{gitTag}
Expand Down
5 changes: 3 additions & 2 deletions src/components/translations/top-bar-en.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ const top_bar_en = {
'top-bar/customTheme': 'Custom theme',

'about-dialog/title': 'About',
'about-dialog/version': 'Version',
'about-dialog/version': 'Version {version}',
'about-dialog/alert-running-old-version-msg':
'Running old version.\nSave your work and refresh the application to load the latest version.',
'about-dialog/license': 'License',
'about-dialog/modules-section': 'Modules details',
'about-dialog/git-version': 'Tag',
'about-dialog/label-version': 'Version',
'about-dialog/label-git-version': 'Tag',
'about-dialog/label-type': 'Type',
'about-dialog/module-tooltip-app': 'application',
'about-dialog/module-tooltip-server': 'server',
Expand Down
5 changes: 3 additions & 2 deletions src/components/translations/top-bar-fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ const top_bar_fr = {
'top-bar/customTheme': 'Choix de theme',

'about-dialog/title': 'À propos',
'about-dialog/version': 'Version',
'about-dialog/version': 'Version {version}',
'about-dialog/alert-running-old-version-msg':
"Ancienne version de l'application.\nVeuillez sauvegarder votre travail et rafraîchir l'application pour charger la dernière version",
'about-dialog/license': 'Licence',
'about-dialog/modules-section': 'Détails des modules',
'about-dialog/git-version': 'Tag',
'about-dialog/label-version': 'Version',
'about-dialog/label-git-version': 'Tag',
'about-dialog/label-type': 'Type',
'about-dialog/module-tooltip-app': 'application',
'about-dialog/module-tooltip-server': 'serveur',
Expand Down

0 comments on commit ba9e690

Please sign in to comment.