File tree Expand file tree Collapse file tree 1 file changed +23
-19
lines changed
packages/app/src/app/pages/Dashboard/Content/CreateNewSandbox Expand file tree Collapse file tree 1 file changed +23
-19
lines changed Original file line number Diff line number Diff line change @@ -82,25 +82,29 @@ export const CreateNewSandbox: FunctionComponent<Props> = ({
8282 setCreating ( true ) ;
8383 } ;
8484
85- const buttonName = `Create ${ mostUsedSandboxTemplate . niceName } Sandbox` ;
86- const mostUsedSandboxComponent = collectionId ? (
87- < Container
88- color = { mostUsedSandboxTemplate . color }
89- onClick = { ( ) => createSandbox ( mostUsedSandboxTemplate ) }
90- ref = { ref }
91- role = "button"
92- tabIndex = { 0 }
93- >
94- { buttonName }
95- </ Container >
96- ) : (
97- < ContainerLink
98- color = { mostUsedSandboxTemplate . color }
99- to = { sandboxUrl ( { id : mostUsedSandboxTemplate . shortid } ) }
100- >
101- { buttonName }
102- </ ContainerLink >
103- ) ;
85+ let mostUsedSandboxComponent = null ;
86+
87+ if ( mostUsedSandboxTemplate ) {
88+ const buttonName = `Create ${ mostUsedSandboxTemplate . niceName } Sandbox` ;
89+ mostUsedSandboxComponent = collectionId ? (
90+ < Container
91+ color = { mostUsedSandboxTemplate . color }
92+ onClick = { ( ) => createSandbox ( mostUsedSandboxTemplate ) }
93+ ref = { ref }
94+ role = "button"
95+ tabIndex = { 0 }
96+ >
97+ { buttonName }
98+ </ Container >
99+ ) : (
100+ < ContainerLink
101+ color = { mostUsedSandboxTemplate . color }
102+ to = { sandboxUrl ( { id : mostUsedSandboxTemplate . shortid } ) }
103+ >
104+ { buttonName }
105+ </ ContainerLink >
106+ ) ;
107+ }
104108
105109 const fromRectDOM = ref . current
106110 ? ref . current . getBoundingClientRect ( )
You can’t perform that action at this time.
0 commit comments