create logic and markup for blank workspace

pull/5370/head
Joseph Izang 3 months ago
parent 4599614138
commit 9d7a5658c5
  1. 51
      libs/remix-ui/workspace/src/lib/components/createModal.tsx
  2. 6
      libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx

@ -0,0 +1,51 @@
import React from 'react'
import { FormattedMessage } from 'react-intl'
export const createModalMessage = async (
defaultName: string,
gitConfigNotSet: boolean,
onChangeTemplateName: (name: string) => void,
onChangeInitGit: (name: string) => void) => {
return (
<>
<label id="wsName" className="form-check-label" style={{ fontWeight: 'bolder' }}>
<FormattedMessage id="filePanel.workspaceName" />
</label>
<input
type="text"
data-id="modalDialogCustomPromptTextCreate"
defaultValue={defaultName}
className="form-control"
onChange={(e) => onChangeTemplateName(e.target.value)}
onInput={(e) => onChangeTemplateName((e.target as any).value)}
/>
<div className="d-flex py-2 align-items-center custom-control custom-checkbox">
<input
id="initGitRepository"
data-id="initGitRepository"
className="form-check-input custom-control-input"
type="checkbox"
disabled={gitConfigNotSet}
onChange={(e) => onChangeInitGit(e.target.value)}
onInput={(e) => onChangeInitGit((e.target as any).value)}
/>
<label
htmlFor="initGitRepository"
data-id="initGitRepositoryLabel"
className="m-0 form-check-label custom-control-label udapp_checkboxAlign"
title={window._intl.formatMessage({ id: 'filePanel.initGitRepoTitle' })}
>
<FormattedMessage id="filePanel.initGitRepositoryLabel" />
</label>
</div>
{gitConfigNotSet ? (
<div className="text-warning">
<FormattedMessage id="filePanel.initGitRepositoryWarning" />
</div>
) : (
<></>
)}
</>
)
}

@ -335,6 +335,12 @@ export function Workspace() {
) )
} }
const createBlankWorkspace = async () => {
global.modal(
)
}
const saveSampleCodeWorkspace = () => { const saveSampleCodeWorkspace = () => {
const workspaceName = global.plugin.getAvailableWorkspaceName('code-sample') const workspaceName = global.plugin.getAvailableWorkspaceName('code-sample')
global.modal( global.modal(

Loading…
Cancel
Save