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

#1257 - Tooltip for downloadable types #1258

Merged
merged 2 commits into from
Nov 25, 2021
Merged
Show file tree
Hide file tree
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
12 changes: 8 additions & 4 deletions components/configuration/VFBDownloadContents/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@
"zipName" : "VFB Files.zip",
"options" :{
"obj": {
"label" : "OBJ"
"label" : "OBJ",
"tooltip" : "Download OBJ"
},
"swc": {
"label" : "SWC"
"label" : "SWC",
"tooltip" : "Download SWC"
},
"nrrd": {
"label" : "NRRD"
"label" : "NRRD",
"tooltip" : "Download NRRD"
},
"reference": {
"label" : "References"
"label" : "References",
"tooltip" : "Download References"
}
},
"text" : {
Expand Down
61 changes: 32 additions & 29 deletions components/interface/VFBDownloadContents/VFBDownloadContents.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Dialog from "@material-ui/core/Dialog";
import DialogActions from "@material-ui/core/DialogActions";
import DialogContent from "@material-ui/core/DialogContent";
import DialogTitle from "@material-ui/core/DialogTitle";
import Tooltip from "@material-ui/core/Tooltip";
import Typography from "@material-ui/core/Typography";
import FormControlLabel from "@material-ui/core/FormControlLabel";
import CircularProgress from '@material-ui/core/CircularProgress';
Expand Down Expand Up @@ -348,36 +349,38 @@ class VFBDownloadContents extends React.Component {
const labelId = `checkbox-list-secondary-label-${key}`;
return (
<Grid item xs={3}>
<Box
textAlign="center"
className={
this.state.typesChecked.indexOf(key) !== -1
? self.props.classes.checkedBox
: null
}
p={2}
border={1}
borderColor="#E5E5E5"
key={option.label}
>
<img src={iconsMap[key]} alt="" />
<Typography
align="center"
variant="h5"
id={labelId}
<Tooltip title={ <h6>{`${option.tooltip}`}</h6> } classes={ { popper: "light" } } placement="top-start" arrow>
<Box
textAlign="center"
className={
this.state.typesChecked.indexOf(key) !== -1
? self.props.classes.checkedBox
: null
}
p={2}
border={1}
borderColor="#E5E5E5"
key={option.label}
>
{`${option.label}`}
</Typography>
<Checkbox
onChange={() => self.handleTypeSelection(key)}
checked={this.state.typesChecked.indexOf(key) !== -1}
inputProps={{ "aria-labelledby": labelId }}
disabled={this.state.downloading}
disableRipple
className={self.props.classes.checked}
id={option.id}
/>
</Box>
<img src={iconsMap[key]} alt="" />
<Typography
align="center"
variant="h5"
id={labelId}
>
{`${option.label}`}
</Typography>
<Checkbox
onChange={() => self.handleTypeSelection(key)}
checked={this.state.typesChecked.indexOf(key) !== -1}
inputProps={{ "aria-labelledby": labelId }}
disabled={this.state.downloading}
disableRipple
className={self.props.classes.checked}
id={option.id}
/>
</Box>
</Tooltip>
</Grid>
);
})}
Expand Down