@@ -44,21 +44,15 @@ export default function TopBar({ octoprintState }: TopBarProps) {
4444 useEffect ( ( ) => {
4545 let color = "bg-green-500" ;
4646 let message = "" ;
47- if (
48- ! backendStatus . connected &&
49- octoprintState . connectionInfos . connected === false
50- ) {
47+ if ( ! backendStatus . connected && octoprintState . connectionInfos . connected === false ) {
5148 color = "bg-red-600" ;
5249 message = "Backend is not connected and printer is disconnected." ;
5350 setGlobalStatus ( {
5451 color,
5552 message,
5653 } ) ;
5754 return ;
58- } else if (
59- ! backendStatus . connected ||
60- octoprintState . connectionInfos . connected === false
61- ) {
55+ } else if ( ! backendStatus . connected || octoprintState . connectionInfos . connected === false ) {
6256 color = "bg-orange-400" ;
6357 }
6458 if ( ! backendStatus . connected ) {
@@ -74,7 +68,7 @@ export default function TopBar({ octoprintState }: TopBarProps) {
7468 } ) ;
7569 } , [ backendStatus , octoprintState . connectionInfos ] ) ;
7670 return (
77- < div className = "relative flex items-center justify-between bg-slate-800 sm:h-10 md:h-20" >
71+ < div className = "relative flex items-center justify-between bg-slate-800 sm:h-10 md:h-15 lg:h- 20" >
7872 < div className = "flex flex-row items-center" >
7973 { octoprintState . toolTemp . current !== 0 && (
8074 < >
@@ -83,9 +77,7 @@ export default function TopBar({ octoprintState }: TopBarProps) {
8377 </ div >
8478 < p className = "text-lg" >
8579 { String ( Math . round ( octoprintState . toolTemp . current ) ) +
86- ( octoprintState . toolTemp . target !== 0
87- ? `/${ octoprintState . toolTemp . target } `
88- : "" ) }
80+ ( octoprintState . toolTemp . target !== 0 ? `/${ octoprintState . toolTemp . target } ` : "" ) }
8981 </ p >
9082 </ >
9183 ) }
@@ -96,9 +88,7 @@ export default function TopBar({ octoprintState }: TopBarProps) {
9688 </ div >
9789 < p className = "text-lg" >
9890 { String ( Math . round ( octoprintState . bedTemp . current ) ) +
99- ( octoprintState . bedTemp . target !== 0
100- ? `/${ octoprintState . bedTemp . target } `
101- : "" ) }
91+ ( octoprintState . bedTemp . target !== 0 ? `/${ octoprintState . bedTemp . target } ` : "" ) }
10292 </ p >
10393 </ >
10494 ) }
@@ -112,7 +102,7 @@ export default function TopBar({ octoprintState }: TopBarProps) {
112102 < div
113103 className = { cn (
114104 "flex items-center justify-center rounded-lg bg-slate-700 hover:cursor-pointer md:h-8 md:w-8 md:rounded-md lg:h-12 lg:w-12" ,
115- loading && "!cursor-not-allowed" ,
105+ loading && "!cursor-not-allowed"
116106 ) }
117107 onClick = { async ( ) => {
118108 if ( loading ) return ;
@@ -122,8 +112,7 @@ export default function TopBar({ octoprintState }: TopBarProps) {
122112 message : "Refreshing status and trying to connect to printer..." ,
123113 } ) ;
124114 try {
125- const response =
126- await octoprintState . node . local . getBackendStatus ( ) ;
115+ const response = await octoprintState . node . local . getBackendStatus ( ) ;
127116 await octoprintState . node . printer . connectPrinter ( ) ;
128117 setBackendStatus ( response ) ;
129118 } catch ( error ) {
@@ -135,12 +124,7 @@ export default function TopBar({ octoprintState }: TopBarProps) {
135124 }
136125 } }
137126 >
138- < RefreshCw
139- className = { cn (
140- "md:h-6 md:w-6 lg:h-8 lg:w-8" ,
141- loading && "animate-spin" ,
142- ) }
143- />
127+ < RefreshCw className = { cn ( "md:h-6 md:w-6 lg:h-8 lg:w-8" , loading && "animate-spin" ) } />
144128 </ div >
145129 </ div >
146130 </ div >
0 commit comments