File tree Expand file tree Collapse file tree 2 files changed +48
-45
lines changed
packages/app/src/app/pages/common/Modals/ForkServerModal Expand file tree Collapse file tree 2 files changed +48
-45
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import React , { useEffect } from 'react' ;
2+ import { useOvermind } from 'app/overmind' ;
3+ import getTemplateDefinition from '@codesandbox/common/lib/templates' ;
4+ import { SignInButton } from 'app/pages/common/SignInButton' ;
5+
6+ import { Container , Heading , Explanation } from '../elements' ;
7+
8+ export const ForkServerModal : React . FC = ( ) => {
9+ const {
10+ state : {
11+ isLoggedIn,
12+ editor : { currentSandbox } ,
13+ } ,
14+ actions : {
15+ modalClosed,
16+ editor : { forkSandboxClicked } ,
17+ } ,
18+ } = useOvermind ( ) ;
19+
20+ useEffect ( ( ) => {
21+ // Which means that the user signed in in the meantime with the intention to
22+ // fork
23+ if ( isLoggedIn ) {
24+ forkSandboxClicked ( ) ;
25+ modalClosed ( ) ;
26+ }
27+ } , [ forkSandboxClicked , isLoggedIn , modalClosed ] ) ;
28+
29+ const templateDefinition = getTemplateDefinition ( currentSandbox . template ) ;
30+ const niceName = (
31+ < span style = { { color : templateDefinition . color ( ) , fontWeight : 500 } } >
32+ { templateDefinition . niceName }
33+ </ span >
34+ ) ;
35+
36+ return (
37+ < Container >
38+ < Heading > Fork { niceName } Sandbox</ Heading >
39+ < Explanation >
40+ We execute { niceName } sandboxes in a server container. This is still in
41+ beta, so we require you to sign in before you can fork a { niceName } { ' ' }
42+ sandbox.
43+ </ Explanation >
44+
45+ < SignInButton style = { { marginTop : 12 } } />
46+ </ Container >
47+ ) ;
48+ } ;
You can’t perform that action at this time.
0 commit comments