Skip to content

Commit

Permalink
fix version display and prettier
Browse files Browse the repository at this point in the history
Signed-off-by: BOUTIER Charly <charly.boutier@rte-france.com>
  • Loading branch information
BOUTIER Charly committed Dec 19, 2023
1 parent c0ea485 commit 533a871
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 53 deletions.
2 changes: 1 addition & 1 deletion demo/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ import {
treeview_finder_en,
treeview_finder_fr,
} from '../../src/index';
import translations from "./demo_intl";
import translations from './demo_intl';

import PowsyblLogo from '-!@svgr/webpack!../images/powsybl_logo.svg';
import AppPackage from '../../package.json';
Expand Down
4 changes: 2 additions & 2 deletions demo/src/demo_intl.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

const translations = {
fr: {
'close': 'Fermer',
close: 'Fermer',
},
en: {
'close': 'Close',
close: 'Close',
},
};
export default translations;
81 changes: 31 additions & 50 deletions src/components/TopBar/AboutDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
DialogActions,
DialogContent,
DialogTitle,
Fade,
Grid,
Stack,
Tooltip,
Expand Down Expand Up @@ -245,62 +244,44 @@ const AboutDialog = ({
appColor={theme.palette.grey['500']}
/>
</Box>
<Box
<Grid
container
component="dl"
sx={{
textAlign: 'center',
marginTop: 0,
'dt, dd': {
display: 'inline',
margin: 0,
},
dt: {
marginRight: '0.5em',
'&:after': {
content: '" :"',
},
'&:before': {
content: "'\\A'",
whiteSpace: 'pre',
},
'&:first-child': {
'&:before': {
content: "''",
},
},
},
}}
columnSpacing={1}
justifyContent="center"
alignItems="center"
>
{loadingGlobalVersion ? (
<CircularProgress />
{!actualGlobalVersion ? (
<CircularProgress size="1.2rem" />
) : (
<>
<Box component="dt">
<FormattedMessage id="about-dialog/version" />
</Box>
<Grid
item
sx={{
display: 'flex',
alignItems: 'baseline',
}}
>
<FormattedMessage
id="about-dialog/version"
sx={{
display: 'inline-block',
lineHeight: '1',
fontSize: '1em',
}}
/>
<Box
component="dd"
fontSize={
!loadingGlobalVersion &&
actualGlobalVersion &&
'1.5em'
}
fontWeight={
!loadingGlobalVersion &&
actualGlobalVersion &&
'bold'
}
fontStyle={
!loadingGlobalVersion &&
!actualGlobalVersion &&
'italic'
}
sx={{
display: 'inline-block',
lineHeight: '1',
fontSize: '1.3em',
fontWeight: 'bold',
}}
>
{actualGlobalVersion || 'unknown'}
&nbsp;{actualGlobalVersion}
</Box>
</>
</Grid>
)}
</Box>
</Grid>
</Box>
</DialogTitle>
<DialogContent id="alert-dialog-description">
Expand Down

0 comments on commit 533a871

Please sign in to comment.