Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
manojVivek committed Sep 22, 2020
2 parents 661fbc4 + ae6da5c commit 6023966
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,15 @@
"contributions": [
"code"
]
},
{
"login": "JLambertazzo",
"name": "Julien Bertazzo Lambert",
"avatar_url": "https://avatars0.githubusercontent.com/u/42924425?v=4",
"profile": "https://github.com/JLambertazzo",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 5,
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ Thanks go to these wonderful people ([emoji key](https://allcontributors.org/doc
<tr>
<td align="center"><a href="http://ruisaraiva.dev"><img src="https://avatars2.githubusercontent.com/u/7356098?v=4" width="100px;" alt=""/><br /><sub><b>Rui Saraiva</b></sub></a><br /><a href="https://github.com/responsively-org/responsively-app/commits?author=ruisaraiva19" title="Code">💻</a></td>
<td align="center"><a href="http://www.bakirci.nl"><img src="https://avatars2.githubusercontent.com/u/9880089?v=4" width="100px;" alt=""/><br /><sub><b>Mehmet Bakirci</b></sub></a><br /><a href="https://github.com/responsively-org/responsively-app/commits?author=MBakirci" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/JLambertazzo"><img src="https://avatars0.githubusercontent.com/u/42924425?v=4" width="100px;" alt=""/><br /><sub><b>Julien Bertazzo Lambert</b></sub></a><br /><a href="https://github.com/responsively-org/responsively-app/commits?author=JLambertazzo" title="Code">💻</a></td>
</tr>
</table>

Expand Down
8 changes: 6 additions & 2 deletions desktop-app/app/components/ToggleTouch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default function ToggleTouch({iconProps}) {
const [isTouchMode, setIsTouchMode] = useState(false);
const [isHover, setHover] = useState(false);
const [hasPendingState, setPendingState] = useState(false);
const [hasTooltip, setTooltip] = useState(false);
const commonClasses = useCommonStyles();

useEffect(() => {
Expand All @@ -25,6 +26,7 @@ export default function ToggleTouch({iconProps}) {

const handleToggleTouch = () => {
setIsTouchMode(!isTouchMode);
setTooltip(!isTouchMode);
if (isHover) {
return setPendingState(true);
}
Expand All @@ -50,16 +52,18 @@ export default function ToggleTouch({iconProps}) {
[commonClasses.iconSelected]: isTouchMode,
})}
onMouseEnter={() => setHover(true)}
onMouseLeave={() => {
onPointerLeave={() => {
setHover(false);
}}
onPointerMove={() => {
if (!hasPendingState) {
return;
}
syncState(isTouchMode);
setPendingState(false);
}}
>
<Tooltip title="Toggle Touch Mode">
<Tooltip title={hasTooltip ? '' : 'Toggle Touch Mode'}>
<div onClick={handleToggleTouch}>
<ToggleTouchIcon {...iconProps} />
</div>
Expand Down

0 comments on commit 6023966

Please sign in to comment.