|
|
@ -19,6 +19,7 @@ export function Workspace () { |
|
|
|
const workspaceCreateInput = useRef() |
|
|
|
const workspaceCreateInput = useRef() |
|
|
|
const workspaceCreateTemplateInput = useRef() |
|
|
|
const workspaceCreateTemplateInput = useRef() |
|
|
|
const cloneUrlRef = useRef<HTMLInputElement>() |
|
|
|
const cloneUrlRef = useRef<HTMLInputElement>() |
|
|
|
|
|
|
|
const initGitRepoRef = useRef<HTMLInputElement>() |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
setCurrentWorkspace(localStorage.getItem('currentWorkspace') ? localStorage.getItem('currentWorkspace') : '') |
|
|
|
setCurrentWorkspace(localStorage.getItem('currentWorkspace') ? localStorage.getItem('currentWorkspace') : '') |
|
|
@ -103,9 +104,10 @@ export function Workspace () { |
|
|
|
const workspaceName = workspaceCreateInput.current.value |
|
|
|
const workspaceName = workspaceCreateInput.current.value |
|
|
|
// @ts-ignore: Object is possibly 'null'.
|
|
|
|
// @ts-ignore: Object is possibly 'null'.
|
|
|
|
const workspaceTemplateName = workspaceCreateTemplateInput.current.value || 'remixDefault' |
|
|
|
const workspaceTemplateName = workspaceCreateTemplateInput.current.value || 'remixDefault' |
|
|
|
|
|
|
|
const initGitRepo = initGitRepoRef.current.checked |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
await global.dispatchCreateWorkspace(workspaceName, workspaceTemplateName) |
|
|
|
await global.dispatchCreateWorkspace(workspaceName, workspaceTemplateName, initGitRepo) |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
global.modal('Create Workspace', e.message, 'OK', () => {}, '') |
|
|
|
global.modal('Create Workspace', e.message, 'OK', () => {}, '') |
|
|
|
console.error(e) |
|
|
|
console.error(e) |
|
|
@ -168,6 +170,24 @@ export function Workspace () { |
|
|
|
<option value='zeroxErc20'>0xProject ERC20</option> |
|
|
|
<option value='zeroxErc20'>0xProject ERC20</option> |
|
|
|
<option value='ozerc721'>OpenZeppelin ERC721</option> |
|
|
|
<option value='ozerc721'>OpenZeppelin ERC721</option> |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
|
|
|
|
<div className="d-flex py-2 align-items-center custom-control custom-checkbox"> |
|
|
|
|
|
|
|
<input |
|
|
|
|
|
|
|
ref={initGitRepoRef} |
|
|
|
|
|
|
|
id="initGitRepository" |
|
|
|
|
|
|
|
data-id="initGitRepository" |
|
|
|
|
|
|
|
className="form-check-input custom-control-input" |
|
|
|
|
|
|
|
type="checkbox" |
|
|
|
|
|
|
|
onChange={() => {}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<label |
|
|
|
|
|
|
|
htmlFor="initGitRepository" |
|
|
|
|
|
|
|
data-id="initGitRepositoryLabel" |
|
|
|
|
|
|
|
className="m-0 form-check-label custom-control-label udapp_checkboxAlign" |
|
|
|
|
|
|
|
title="Check option to initialize workspace as a new git repository" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
Initialize workspace as a new git repository |
|
|
|
|
|
|
|
</label> |
|
|
|
|
|
|
|
</div> |
|
|
|
</> |
|
|
|
</> |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|