Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes ellipsis in the about dialog that could hide the module's version. #324

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 39 additions & 22 deletions src/components/TopBar/AboutDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
Fade,
Grid,
Stack,
Tooltip,
Typography,
useMediaQuery,
useTheme,
Expand Down Expand Up @@ -358,10 +359,24 @@ AboutDialog.propTypes = {
getAdditionalModules: PropTypes.func,
};

const style = {
icons: {
flexGrow: 0,
position: 'relative',
top: '4px',
flexShrink: 0,
},
version: {
flexGrow: 0,
alignSelf: 'flex-end',
flexShrink: 0,
},
};

const ModuleTypesIcons = {
app: <WidgetsOutlined fontSize="small" color="primary" />,
server: <DnsOutlined fontSize="small" color="secondary" />,
other: <QuestionMark fontSize="small" />,
app: <WidgetsOutlined sx={style.icons} fontSize="small" color="primary" />,
server: <DnsOutlined sx={style.icons} fontSize="small" color="secondary" />,
other: <QuestionMark sx={style.icons} fontSize="small" />,
};

const Module = ({ type, name, version, license }) => {
Expand All @@ -377,26 +392,28 @@ const Module = ({ type, name, version, license }) => {
},
}}
>
<Stack
direction="row"
justifyContent="flex-start"
alignItems="baseline"
spacing={1}
>
{ModuleTypesIcons[type] || ModuleTypesIcons['other']}
<Typography display="inline-block" noWrap>
{name || '<?>'}
</Typography>
<Typography
variant="caption"
color={(theme) => theme.palette.text.secondary}
display="inline"
marginLeft={1}
noWrap
<Tooltip title={(name || '<?>') + ' ' + (version || '')}>
<Stack
direction="row"
justifyContent="flex-start"
alignItems="baseline"
spacing={1}
>
{version || null}
</Typography>
</Stack>
{ModuleTypesIcons[type] || ModuleTypesIcons['other']}
<Typography display="inline" noWrap>
{name || '<?>'}
</Typography>
<Typography
variant="caption"
color={(theme) => theme.palette.text.secondary}
display="inline"
noWrap
sx={style.version}
>
{version || null}
</Typography>
</Stack>
</Tooltip>
</Grid>
);
};
Expand Down
Loading