File tree Expand file tree Collapse file tree 5 files changed +40
-35
lines changed Expand file tree Collapse file tree 5 files changed +40
-35
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- import React from 'react' ;
1+ import React , { FunctionComponent , ReactNode } from 'react' ;
2+
23import {
34 Container ,
45 Cube ,
@@ -9,27 +10,26 @@ import {
910 Result ,
1011} from './elements' ;
1112
12- interface IGitProgressProps {
13- result : string | null ;
13+ type Props = {
1414 message : string ;
15- }
16-
17- export const GitProgress : React . FC < IGitProgressProps > = ( {
18- message,
19- result,
20- } ) => (
15+ result : ReactNode ;
16+ } ;
17+ export const GitProgress : FunctionComponent < Props > = ( { message, result } ) => (
2118 < Container >
2219 { result ? (
2320 < Result > { result } </ Result >
2421 ) : (
2522 < >
2623 < DeployAnimationContainer deploying >
27- < OpaqueLogo width = { 70 } height = { 70 } />
24+ < OpaqueLogo height = { 70 } width = { 70 } />
25+
2826 { [ 0 , 1 , 2 , 3 ] . map ( i => (
29- < Cube key = { i } delay = { i } size = { 20 } />
27+ < Cube delay = { i } key = { i } size = { 20 } />
3028 ) ) }
29+
3130 < GitHubLogo />
3231 </ DeployAnimationContainer >
32+
3333 < DeployText > { message } </ DeployText >
3434 </ >
3535 ) }
Original file line number Diff line number Diff line change 1+ import styled from 'styled-components' ;
2+
3+ export const ButtonContainer = styled . div `
4+ font-size: 0.875rem;
5+ margin-top: 1rem;
6+ ` ;
Original file line number Diff line number Diff line change 11import React , { FunctionComponent } from 'react' ;
2- import { useOvermind } from 'app/overmind' ;
2+
33import { GitProgress } from 'app/components/GitProgress' ;
4+ import { useOvermind } from 'app/overmind' ;
5+
6+ import { ButtonContainer } from './elements' ;
47
5- const PRModal : FunctionComponent = ( ) => {
8+ export const PRModal : FunctionComponent = ( ) => {
69 const {
710 state : {
8- git : { isCreatingPr, pr } ,
11+ git : {
12+ isCreatingPr,
13+ pr : { prURL } ,
14+ } ,
915 } ,
1016 } = useOvermind ( ) ;
1117
12- let result = null ;
13-
14- if ( ! isCreatingPr ) {
15- result = (
16- < div >
17- Done! We{ "'" } ll now open the new sandbox of this PR and GitHub in 3
18- seconds...
19- < div style = { { fontSize : '.875rem' , marginTop : '1rem' } } >
20- < a href = { pr . prURL } target = "_blank" rel = "noreferrer noopener" >
21- Click here if nothing happens.
22- </ a >
23- </ div >
24- </ div >
25- ) ;
26- }
27-
2818 return (
2919 < GitProgress
30- result = { result }
3120 message = "Forking Repository & Creating PR..."
21+ result = {
22+ isCreatingPr ? (
23+ < div >
24+ { `Done! We'll now open the new sandbox of this PR and GitHub in 3 seconds...` }
25+
26+ < ButtonContainer >
27+ < a href = { prURL } rel = "noreferrer noopener" target = "_blank" >
28+ Click here if nothing happens.
29+ </ a >
30+ </ ButtonContainer >
31+ </ div >
32+ ) : null
33+ }
3234 />
3335 ) ;
3436} ;
35-
36- export default PRModal ;
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ import LiveSessionVersionMismatch from './LiveSessionVersionMismatch';
2626import { NetlifyLogs } from './NetlifyLogs' ;
2727import { PickSandboxModal } from './PickSandboxModal' ;
2828import PreferencesModal from './PreferencesModal' ;
29- import PRModal from './PRModal' ;
29+ import { PRModal } from './PRModal' ;
3030import { SearchDependenciesModal } from './SearchDependenciesModal' ;
3131import { SelectSandboxModal } from './SelectSandboxModal' ;
3232import { ShareModal } from './ShareModal' ;
You can’t perform that action at this time.
0 commit comments