-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#316 Fix cursor visibility on monitor fullscreen view #319
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,11 @@ export function Monitor({fullScreen, requestFullScreen}: MonitorProps): ReactEle | |
|
||
const [loaded, setLoaded] = useState(false) | ||
const [projects, setProjects] = useState<Projects>([]) | ||
const [monitorClassNames, setMonitorClassNames] = useState({ | ||
[styles.monitor]: true, | ||
[styles.inactive]: true, | ||
[styles.fullscreen]: fullScreen | ||
}) | ||
|
||
useEffect(() => { | ||
requestFullScreen(true) | ||
|
@@ -65,12 +70,14 @@ export function Monitor({fullScreen, requestFullScreen}: MonitorProps): ReactEle | |
const traysAdded = !isEmpty(trays) | ||
const success = isEmpty(projects) | ||
|
||
const monitorClassNames = cn(styles.monitor, { | ||
[styles.fullscreen]: fullScreen | ||
}) | ||
document.onmousemove = () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||
setMonitorClassNames({ | ||
...monitorClassNames, [styles.inactive]: false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nothing is ever setting the inactive style back to |
||
}) | ||
} | ||
|
||
return ( | ||
<div className={monitorClassNames}> | ||
<div className={cn({...monitorClassNames})}> | ||
<Title>Monitor</Title> | ||
{!traysAdded && ( | ||
<SuccessMessage message='Add a CI server via the tracking page to start monitoring'/> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,9 @@ | |
} | ||
|
||
.fullscreen { | ||
cursor: default; | ||
} | ||
|
||
.inactive { | ||
cursor: none; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to store all of this as state. You only really need to keep track of the inactive boolean. Also doing this means the fullscreen style will never get toggled, as the state is only initialised on the first render using the
fullscreen
boolean.