-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added icon to buttons "Create package from folder" and "Push to bucket" in desktop layout * Added components/Buttons/ButtonIconized, and replace FileView.AdaptiveLayoutButton * Removed components/ButtonIcon * Fix and unify margins
- Loading branch information
Showing
18 changed files
with
163 additions
and
276 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import cx from 'classnames' | ||
import * as React from 'react' | ||
import * as M from '@material-ui/core' | ||
|
||
const useStyles = M.makeStyles({ | ||
icon: { | ||
transition: 'ease transform .15s', | ||
}, | ||
iconRotated: { | ||
transform: `rotate(180deg)`, | ||
}, | ||
}) | ||
|
||
interface ButtonIconShrinkingProps extends M.IconButtonProps { | ||
icon: string | ||
label: string | ||
rotate?: boolean | ||
variant?: 'text' | 'outlined' | 'contained' | ||
} | ||
|
||
export default function ButtonIconShrinking({ | ||
className, | ||
label, | ||
icon, | ||
rotate, | ||
variant = 'outlined', | ||
...props | ||
}: ButtonIconShrinkingProps) { | ||
const classes = useStyles() | ||
const t = M.useTheme() | ||
const sm = M.useMediaQuery(t.breakpoints.down('sm')) | ||
const iconElement = ( | ||
<M.Icon className={cx(classes.icon, { [classes.iconRotated]: rotate })}> | ||
{icon} | ||
</M.Icon> | ||
) | ||
|
||
return sm ? ( | ||
<M.IconButton className={className} edge="end" size="small" title={label} {...props}> | ||
{iconElement} | ||
</M.IconButton> | ||
) : ( | ||
<M.Button | ||
className={className} | ||
size="small" | ||
startIcon={iconElement} | ||
variant={variant} | ||
{...props} | ||
> | ||
{label} | ||
</M.Button> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.