@@ -2,33 +2,31 @@ import { Button } from '@codesandbox/common/lib/components/Button';
22import Input from '@codesandbox/common/lib/components/Input' ;
33import Margin from '@codesandbox/common/lib/components/spacing/Margin' ;
44import track from '@codesandbox/common/lib/utils/analytics' ;
5+ import React , { ChangeEvent , FunctionComponent , HTMLAttributes } from 'react' ;
6+
57import { useOvermind } from 'app/overmind' ;
6- import React from 'react' ;
78import {
89 WorkspaceSubtitle ,
910 WorkspaceInputContainer ,
1011} from 'app/pages/Sandbox/Editor/Workspace/elements' ;
11- import { Error } from './elements' ;
1212
13- interface ICreateRepoProps {
14- style ?: React . CSSProperties ;
15- }
13+ import { Error } from './elements' ;
1614
17- export const CreateRepo : React . FC < ICreateRepoProps > = ( { style } ) => {
15+ type Props = Pick < HTMLAttributes < HTMLDivElement > , 'style' > ;
16+ export const CreateRepo : FunctionComponent < Props > = ( { style } ) => {
1817 const {
18+ actions : {
19+ git : { createRepoClicked, repoTitleChanged } ,
20+ } ,
1921 state : {
2022 editor : { isAllModulesSynced } ,
21- git : { repoTitle, error } ,
22- } ,
23- actions : {
24- git : { repoTitleChanged, createRepoClicked } ,
23+ git : { error, repoTitle } ,
2524 } ,
2625 } = useOvermind ( ) ;
2726
2827 const updateRepoTitle = ( {
2928 target : { value : title } ,
30- } : React . ChangeEvent < HTMLInputElement > ) => repoTitleChanged ( { title } ) ;
31-
29+ } : ChangeEvent < HTMLInputElement > ) => repoTitleChanged ( { title } ) ;
3230 const createRepo = ( ) => {
3331 track ( 'Export to GitHub Clicked' ) ;
3432 createRepoClicked ( ) ;
@@ -51,7 +49,7 @@ export const CreateRepo: React.FC<ICreateRepoProps> = ({ style }) => {
5149 < Margin horizontal = { 1 } bottom = { 1 } >
5250 < Button
5351 block
54- disabled = { Boolean ( error || ! repoTitle || ! isAllModulesSynced ) }
52+ disabled = { Boolean ( error ) || ! repoTitle || ! isAllModulesSynced }
5553 onClick = { createRepo }
5654 small
5755 >
0 commit comments