File tree Expand file tree Collapse file tree 2 files changed +40
-31
lines changed
packages/app/src/app/pages/common/Modals/SelectSandboxModal Expand file tree Collapse file tree 2 files changed +40
-31
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import React , { FunctionComponent } from 'react' ;
2+ import Sandbox from './Sandbox' ;
3+
4+ import { Padding } from './elements' ;
5+ import { useOvermind } from 'app/overmind' ;
6+
7+ export const SelectSandboxModal : FunctionComponent = ( ) => {
8+ const {
9+ state : {
10+ profile : {
11+ isLoadingSandboxes,
12+ showcasedSandbox,
13+ userSandboxes
14+ }
15+ } ,
16+ actions : {
17+ profile : { newSandboxShowcaseSelected }
18+ }
19+ } = useOvermind ( ) ;
20+
21+ if ( isLoadingSandboxes )
22+ return < Padding > Loading sandboxes...</ Padding > ;
23+
24+ const currentShowcasedSandboxId = showcasedSandbox && showcasedSandbox . id ;
25+
26+ return (
27+ < div >
28+ { userSandboxes
29+ . filter ( x => x )
30+ . map ( sandbox => (
31+ < Sandbox
32+ active = { sandbox . id === currentShowcasedSandboxId }
33+ key = { sandbox . id }
34+ sandbox = { sandbox }
35+ setShowcasedSandbox = { id => newSandboxShowcaseSelected ( { id } ) }
36+ />
37+ ) ) }
38+ </ div >
39+ ) ;
40+ } ;
You can’t perform that action at this time.
0 commit comments