From 8a5bd3526d3b4e9c2b891443cec6db0d845d73ef Mon Sep 17 00:00:00 2001 From: Thomas Nordquist Date: Wed, 10 Apr 2019 11:00:25 +0200 Subject: [PATCH] Fix cursor color based on theme --- app/src/components/Demo/Mouse.tsx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/src/components/Demo/Mouse.tsx b/app/src/components/Demo/Mouse.tsx index 3847ecd..acaea1b 100644 --- a/app/src/components/Demo/Mouse.tsx +++ b/app/src/components/Demo/Mouse.tsx @@ -9,7 +9,7 @@ interface State { stepSizeY: number, } -class Demo extends React.Component<{}, State> { +class Demo extends React.Component<{classes: any}, State> { private timer: any private frameInterval = 20 @@ -57,22 +57,26 @@ class Demo extends React.Component<{}, State> { if (!this.state.enabled) { return null } + const style = { - width: '32px', - height: '32px', - position: 'fixed' as 'fixed', - zIndex: 1000000, - filter: 'invert(100%)', left: this.state.position.x + 2, top: this.state.position.y + 2, } return ( - + ) } } -const style = (theme: Theme) => {} +const style = (theme: Theme) => ({ + cursor: { + width: '32px', + height: '32px', + position: 'fixed' as 'fixed', + zIndex: 1000000, + filter: theme.palette.type === 'light' ? undefined : 'invert(100%)', + } +}) export default withStyles(style)(Demo)