Skip to content

Commit

Permalink
theme: button svgs use theme. IssuesControl uses Buttons#TooltipIconB…
Browse files Browse the repository at this point in the history
…utton. (#146)

* projects: restore screenshots

* logo: fix missing display on mobile.

* theme: button svgs use theme.  IssuesControl uses Buttons#TooltipIconButton.
  • Loading branch information
pablo-mayrgundter committed Mar 14, 2022
1 parent f476d97 commit 7b9a731
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 53 deletions.
58 changes: 29 additions & 29 deletions docs/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "buildrs",
"version": "1.0.0-r253",
"version": "1.0.0-r256",
"main": "src/index.jsx",
"homepage": "https://github.com/buildrs/Share",
"bugs": {
Expand Down
7 changes: 3 additions & 4 deletions src/Components/Buttons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ export function TooltipIconButton({
title,
onClick,
icon,
placement='left',
placement='right',
size='medium',
}) {
assertDefined(title, icon, onClick)
const classes = useStyles(useTheme())
return (
<div className={classes.root}>
<span className={classes.root}>
<Tooltip title={title} describeChild placement={placement}>
<IconButton onClick={onClick} size={size}>
{icon}
</IconButton>
</Tooltip>
</div>
</span>
)
}

Expand Down Expand Up @@ -146,7 +146,6 @@ const useStyles = makeStyles((theme) => ({
height: '30px',
border: 'none',
borderRadius: '50%',
backgroundColor: theme.palette.primary.main,
fill: theme.palette.primary.contrastText,
},
},
Expand Down
10 changes: 5 additions & 5 deletions src/Components/Dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import MuiDialog from '@mui/material/Dialog'
import DialogContent from '@mui/material/DialogContent'
import DialogTitle from '@mui/material/DialogTitle'
import CheckIcon from '@mui/icons-material/Check'
import {makeStyles} from '@mui/styles'
import {makeStyles, useTheme} from '@mui/styles'
import {TooltipIconButton} from './Buttons'
import {assertDefined} from '../utils/assert'

Expand All @@ -27,7 +27,7 @@ export default function Dialog({
content,
}) {
assertDefined(icon, headerText, isDialogDisplayed, setIsDialogDisplayed, content)
const classes = {...useStyles(), ...clazzes}
const classes = {...useStyles(useTheme()), ...clazzes}
const close = () => setIsDialogDisplayed(false)
return (
<MuiDialog
Expand All @@ -44,7 +44,7 @@ export default function Dialog({
}


const useStyles = makeStyles({
const useStyles = makeStyles((theme) => ({
root: {
'textAlign': 'center',
'fontFamily': 'Helvetica',
Expand All @@ -60,9 +60,9 @@ const useStyles = makeStyles({
width: '30px',
height: '30px',
border: 'solid 0.5px grey',
fill: 'black',
borderRadius: '50%',
fill: theme.palette.primary.contrastText,
},
},
})
}))

22 changes: 11 additions & 11 deletions src/Components/IssuesControl.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import {useLocation, useNavigate} from 'react-router'
import DialogActions from '@mui/material/DialogActions'
import DialogTitle from '@mui/material/DialogTitle'
import DialogContent from '@mui/material/DialogContent'
import IconButton from '@mui/material/IconButton'
import MuiDialog from '@mui/material/Dialog'
import Typography from '@mui/material/Typography'
import Slide from '@mui/material/Slide'
import {makeStyles} from '@mui/styles'
import {ControlButton} from './Buttons'
import {ControlButton, TooltipIconButton} from './Buttons'
import debug from '../utils/debug'
import {
addHashParams,
Expand Down Expand Up @@ -139,23 +138,25 @@ function CommentPanel({body, title, next, navigate}) {
<DialogActions sx={{justifyContent: 'center'}}>
<div>
{count > 0 &&
<IconButton
<TooltipIconButton
title='Back'
onClick={() => {
if (count > 0) {
setCount(count - 1)
navigate(-1)
}
}}>
<NavPrevIcon/>
</IconButton>}
}}
icon={<NavPrevIcon/>}
placement='left'/>}
{next &&
<IconButton
<TooltipIconButton
title='Next'
onClick={() => {
setCount(count + 1)
window.location = next
}}>
<NavNextIcon/>
</IconButton>}
}}
icon={<NavNextIcon/>}
placement='right'/>}
</div>
</DialogActions>
</MuiDialog>
Expand Down Expand Up @@ -286,7 +287,6 @@ const useStyles = makeStyles({
width: '25px',
height: '25px',
border: 'solid 0.5px grey',
fill: 'black',
borderRadius: '50%',
},
'& h1, & p': {
Expand Down
2 changes: 1 addition & 1 deletion src/assets/2D_Icons/GitHub.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7b9a731

Please sign in to comment.