File tree Expand file tree Collapse file tree 4 files changed +34
-9
lines changed Expand file tree Collapse file tree 4 files changed +34
-9
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " jderobot-ide-interface" ,
3- "version" : " 0.2.48 " ,
3+ "version" : " 0.2.49 " ,
44 "main" : " dist/main.js" ,
55 "typings" : " dist/index.d.ts" ,
66 "files" : [
Original file line number Diff line number Diff line change @@ -268,14 +268,14 @@ export const CollapsableResizableColumn = ({
268268
269269 return (
270270 < StyledVertContiner bgColor = { theme . palette ?. background } >
271- < StyledVertFillerContiner bgColor = { theme . palette ?. background } >
272- { children [ 0 ] }
273- </ StyledVertFillerContiner >
274- { children . slice ( 1 , children . length ) . map ( ( comp , i ) => (
275- < ResizableVert key = { `v-cont${ i } ` } height = { 100 / children . length } max = { 100 } min = { 0 } snap = { [ 0 ] } top >
271+ { children . slice ( 0 , children . length - 1 ) . map ( ( comp , i ) => (
272+ < ResizableVert key = { `v-cont${ i } ` } height = { 100 / children . length } max = { 100 } min = { 0 } snap = { [ 0 ] } >
276273 { comp }
277274 </ ResizableVert >
278275 ) ) }
276+ < StyledVertFillerContiner bgColor = { theme . palette ?. background } >
277+ { children [ children . length - 1 ] }
278+ </ StyledVertFillerContiner >
279279 </ StyledVertContiner >
280280 ) ;
281281} ;
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ const handleAnimation = (p: StyledStatusBarButtonProps) => {
8181 }
8282} ;
8383
84- export const StyledStatusBarButton = styled . div < StyledStatusBarButtonProps > `
84+ export const StyledStatusBarButton = styled . button < StyledStatusBarButtonProps > `
8585 margin: 0 0 0 0;
8686 padding: 0 10px 0 10px;
8787 height: 24px;
@@ -114,5 +114,20 @@ export const StyledStatusBarButton = styled.div<StyledStatusBarButtonProps>`
114114 height: 24px;
115115 margin: 0 0 0 0;
116116 }
117+
118+ @keyframes spin {
119+ from {
120+ transform: rotate(0deg);
121+ }
122+ to {
123+ transform: rotate(360deg);
124+ }
125+ }
126+
127+ #loading-spin {
128+ animation: spin 2s linear infinite;
129+ opacity: 50%;
130+ }
131+
117132 ${ handleAnimation }
118133` ;
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ const StatusBar = ({
3030 extraComponents : StatusBarComponents ;
3131} ) => {
3232 const theme = useTheme ( ) ;
33+ const [ loading , setLoading ] = useState < boolean > ( false ) ;
3334 const [ dockerData , setDockerData ] = useState < any > (
3435 commsManager ?. getHostData ( )
3536 ) ;
@@ -54,6 +55,10 @@ const StatusBar = ({
5455 if ( e . detail . state == states . IDLE ) {
5556 setDockerData ( undefined ) ;
5657 connectWithRetry ( ) ;
58+ } else {
59+ if ( loading ) {
60+ setLoading ( false )
61+ }
5762 }
5863 } ;
5964
@@ -91,12 +96,17 @@ const StatusBar = ({
9196 id = { `connect-with-rb` }
9297 onClick = { ( ) => {
9398 if ( state === undefined || state === "idle" ) {
94- connectManager ( ) ;
99+ setLoading ( true ) ;
100+ connectManager ( states . CONNECTED , ( ) => {
101+ setLoading ( false ) ;
102+ close ( ) ;
103+ } ) ;
95104 }
96105 } }
97106 title = "Connect to the Robotics Backend"
107+ disabled = { loading }
98108 >
99- < ResetIcon viewBox = "0 0 20 20" stroke = { theme . palette . darkText } />
109+ < ResetIcon viewBox = "0 0 20 20" stroke = { theme . palette . darkText } id = { loading ? "loading-spin" : "loading" } />
100110 < label > { `Connect${ state === undefined || state === "idle" ? "" : "ing ..." } ` } </ label >
101111 </ StyledStatusBarButton >
102112 ) }
You can’t perform that action at this time.
0 commit comments