Skip to content

Commit

Permalink
Merge pull request #1816 from GMOD/remove_animations
Browse files Browse the repository at this point in the history
Remove some animation effects
  • Loading branch information
rbuels authored Mar 19, 2021
2 parents dd5c1c6 + ca53eb5 commit e2594e3
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 78 deletions.
22 changes: 9 additions & 13 deletions packages/core/ui/Drawer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Paper from '@material-ui/core/Paper'
import Slide from '@material-ui/core/Slide'
import { makeStyles } from '@material-ui/core/styles'
import { observer, PropTypes as MobxPropTypes } from 'mobx-react'
import PropTypes from 'prop-types'
Expand All @@ -22,26 +21,23 @@ const useStyles = makeStyles(theme => ({
},
}))

function Drawer({ children, open, session }) {
function Drawer({ children, session }) {
const classes = useStyles()

return (
<Slide in={open} direction="left">
<Paper className={classes.paper} elevation={16} square>
<ResizeHandle
onDrag={session.resizeDrawer}
className={classes.resizeHandle}
vertical
/>
{children}
</Paper>
</Slide>
<Paper className={classes.paper} elevation={16} square>
<ResizeHandle
onDrag={session.resizeDrawer}
className={classes.resizeHandle}
vertical
/>
{children}
</Paper>
)
}

Drawer.propTypes = {
children: PropTypes.node,
open: PropTypes.bool.isRequired,
session: MobxPropTypes.observableObject.isRequired,
}

Expand Down
30 changes: 18 additions & 12 deletions packages/core/ui/Menu.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import Divider from '@material-ui/core/Divider'
import Grow from '@material-ui/core/Grow'
import ListItemIcon from '@material-ui/core/ListItemIcon'
import ListItemText from '@material-ui/core/ListItemText'
import ListSubheader from '@material-ui/core/ListSubheader'
import { MenuProps as MUIMenuProps } from '@material-ui/core/Menu'
import MenuItem, { MenuItemProps } from '@material-ui/core/MenuItem'
import MenuList from '@material-ui/core/MenuList'
import Paper from '@material-ui/core/Paper'
import Popover, { PopoverProps } from '@material-ui/core/Popover'
import { SvgIconProps } from '@material-ui/core/SvgIcon'
import { makeStyles } from '@material-ui/core/styles'
import {
Divider,
Grow,
ListItemIcon,
ListItemText,
ListSubheader,
MenuProps as MUIMenuProps,
MenuItem,
MenuItemProps,
MenuList,
Paper,
Popover,
PopoverProps,
SvgIconProps,
makeStyles,
} from '@material-ui/core'
import ArrowRightIcon from '@material-ui/icons/ArrowRight'
import CheckBoxIcon from '@material-ui/icons/CheckBox'
import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank'
Expand Down Expand Up @@ -408,8 +412,10 @@ interface MenuProps extends PopoverProps {

function Menu(props: MenuProps) {
const { open, onClose, menuItems, onMenuItemClick, ...other } = props

return (
<Popover
transitionDuration={0}
open={open}
onClose={onClose}
BackdropProps={{ invisible: true }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { readConfObject } from '@jbrowse/core/configuration'
import { getSession } from '@jbrowse/core/util'
import { Menu } from '@jbrowse/core/ui'
import Checkbox from '@material-ui/core/Checkbox'
import Fade from '@material-ui/core/Fade'
import FormControlLabel from '@material-ui/core/FormControlLabel'
import IconButton from '@material-ui/core/IconButton'
import { makeStyles } from '@material-ui/core/styles'
Expand Down Expand Up @@ -59,53 +58,51 @@ function TrackEntry({ model, disabled, trackConf, assemblyName }) {
: []

return (
<Fade in>
<div className={classes.track}>
<Tooltip title={titleText} placement="left" enterDelay={500}>
<FormControlLabel
className={classes.formControlLabel}
control={
<Checkbox
inputProps={{
'data-testid': `htsTrackEntry-${trackId}`,
}}
className={classes.checkbox}
/>
}
label={
assemblyName ? `Reference Sequence (${assemblyName})` : trackName
}
checked={model.view.tracks.some(t => t.configuration === trackConf)}
onChange={() => model.view.toggleTrack(trackConf.trackId)}
disabled={disabled || unsupported}
/>
</Tooltip>
{menuItems.length ? (
<IconButton
className={classes.configureButton}
onClick={event => {
setAnchorEl(event.currentTarget)
}}
color="secondary"
data-testid={`htsTrackEntryMenu-${trackId}`}
>
<HorizontalDots />
</IconButton>
) : null}
<Menu
anchorEl={anchorEl}
onMenuItemClick={(_, callback) => {
callback()
setAnchorEl(null)
}}
open={Boolean(anchorEl)}
onClose={() => {
setAnchorEl(null)
}}
menuItems={menuItems}
<div className={classes.track}>
<Tooltip title={titleText} placement="left" enterDelay={500}>
<FormControlLabel
className={classes.formControlLabel}
control={
<Checkbox
inputProps={{
'data-testid': `htsTrackEntry-${trackId}`,
}}
className={classes.checkbox}
/>
}
label={
assemblyName ? `Reference Sequence (${assemblyName})` : trackName
}
checked={model.view.tracks.some(t => t.configuration === trackConf)}
onChange={() => model.view.toggleTrack(trackConf.trackId)}
disabled={disabled || unsupported}
/>
</div>
</Fade>
</Tooltip>
{menuItems.length ? (
<IconButton
className={classes.configureButton}
onClick={event => {
setAnchorEl(event.currentTarget)
}}
color="secondary"
data-testid={`htsTrackEntryMenu-${trackId}`}
>
<HorizontalDots />
</IconButton>
) : null}
<Menu
anchorEl={anchorEl}
onMenuItemClick={(_, callback) => {
callback()
setAnchorEl(null)
}}
open={Boolean(anchorEl)}
onClose={() => {
setAnchorEl(null)
}}
menuItems={menuItems}
/>
</div>
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ exports[`HierarchicalTrackSelector widget renders with a couple of categorized t
>
<div
class="makeStyles-track"
style="opacity: 1; webkit-transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
>
<label
class="MuiFormControlLabel-root makeStyles-formControlLabel"
Expand Down Expand Up @@ -197,7 +196,6 @@ exports[`HierarchicalTrackSelector widget renders with a couple of categorized t
>
<div
class="makeStyles-track"
style="opacity: 1; webkit-transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
>
<label
class="MuiFormControlLabel-root makeStyles-formControlLabel"
Expand Down Expand Up @@ -329,7 +327,6 @@ exports[`HierarchicalTrackSelector widget renders with a couple of categorized t
>
<div
class="makeStyles-track"
style="opacity: 1; webkit-transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
>
<label
class="MuiFormControlLabel-root makeStyles-formControlLabel"
Expand Down Expand Up @@ -496,7 +493,6 @@ exports[`HierarchicalTrackSelector widget renders with a couple of uncategorized
>
<div
class="makeStyles-track"
style="opacity: 1; webkit-transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
>
<label
class="MuiFormControlLabel-root makeStyles-formControlLabel"
Expand Down Expand Up @@ -571,7 +567,6 @@ exports[`HierarchicalTrackSelector widget renders with a couple of uncategorized
>
<div
class="makeStyles-track"
style="opacity: 1; webkit-transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
>
<label
class="MuiFormControlLabel-root makeStyles-formControlLabel"
Expand Down Expand Up @@ -640,7 +635,6 @@ exports[`HierarchicalTrackSelector widget renders with a couple of uncategorized
</div>
<div
class="makeStyles-track"
style="opacity: 1; webkit-transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; transition: opacity 225ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;"
>
<label
class="MuiFormControlLabel-root makeStyles-formControlLabel"
Expand Down

0 comments on commit e2594e3

Please sign in to comment.