@@ -12,6 +12,7 @@ import { UserMenu } from 'app/pages/common/UserMenu';
1212import { Notifications } from 'app/components/Notifications' ;
1313import { dashboard as dashboardUrls } from '@codesandbox/common/lib/utils/url-generator' ;
1414import { useWorkspaceLimits } from 'app/hooks/useWorkspaceLimits' ;
15+ import { useActiveTeamInfo } from 'app/hooks/useActiveTeamInfo' ;
1516import { TeamAvatar } from 'app/components/TeamAvatar' ;
1617import { WorkspaceSelect } from 'app/components/WorkspaceSelect' ;
1718import { SkeletonTextBlock } from 'app/components/Skeleton/elements' ;
@@ -25,6 +26,7 @@ export const Header: React.FC<HeaderProps> = React.memo(
2526 const history = useHistory ( ) ;
2627 const actions = useActions ( ) ;
2728 const { isFrozen } = useWorkspaceLimits ( ) ;
29+ const { sdkWorkspace } = useActiveTeamInfo ( ) ;
2830 const {
2931 activeWorkspaceAuthorization,
3032 hasLogIn,
@@ -96,31 +98,35 @@ export const Header: React.FC<HeaderProps> = React.memo(
9698
9799 < Stack align = "center" gap = { 2 } >
98100 < SearchInputGroup />
99- < Button
100- variant = "secondary"
101- disabled = { activeWorkspaceAuthorization === 'READ' || isFrozen }
102- onClick = { ( ) => {
103- track ( 'Dashboard - Topbar - Import' ) ;
104- actions . modalOpened ( { modal : 'import' } ) ;
105- } }
106- autoWidth
107- >
108- < Icon name = "github" size = { 16 } css = { { marginRight : '4px' } } />
109- Import
110- </ Button >
111-
112- < Button
113- variant = "primary"
114- disabled = { activeWorkspaceAuthorization === 'READ' }
115- onClick = { ( ) => {
116- track ( 'Dashboard - Topbar - Create' ) ;
117- actions . modalOpened ( { modal : 'create' } ) ;
118- } }
119- autoWidth
120- >
121- < Icon name = "plus" size = { 12 } css = { { marginRight : '4px' } } />
122- Create
123- </ Button >
101+ { ! sdkWorkspace && (
102+ < >
103+ < Button
104+ variant = "secondary"
105+ disabled = { activeWorkspaceAuthorization === 'READ' || isFrozen }
106+ onClick = { ( ) => {
107+ track ( 'Dashboard - Topbar - Import' ) ;
108+ actions . modalOpened ( { modal : 'import' } ) ;
109+ } }
110+ autoWidth
111+ >
112+ < Icon name = "github" size = { 16 } css = { { marginRight : '4px' } } />
113+ Import
114+ </ Button >
115+
116+ < Button
117+ variant = "primary"
118+ disabled = { activeWorkspaceAuthorization === 'READ' }
119+ onClick = { ( ) => {
120+ track ( 'Dashboard - Topbar - Create' ) ;
121+ actions . modalOpened ( { modal : 'create' } ) ;
122+ } }
123+ autoWidth
124+ >
125+ < Icon name = "plus" size = { 12 } css = { { marginRight : '4px' } } />
126+ Create
127+ </ Button >
128+ </ >
129+ ) }
124130
125131 { hasLogIn && < Notifications dashboard /> }
126132
0 commit comments