|
|
|
@ -1,14 +1,18 @@ |
|
|
|
|
|
|
|
|
|
import React, { useState } from "react"; |
|
|
|
|
import { Alert, Form, FormControl, InputGroup } from "react-bootstrap"; |
|
|
|
|
import { useLocalStorage } from "../../hooks/useLocalStorage"; |
|
|
|
|
import { gitActionsContext } from "../../state/context"; |
|
|
|
|
import { gitPluginContext } from "../gitui"; |
|
|
|
|
import { SelectAndCloneRepositories } from "../github/selectandclonerepositories"; |
|
|
|
|
import { RemixUiCheckbox } from "@remix-ui/checkbox"; |
|
|
|
|
import GitUIButton from "../buttons/gituibutton"; |
|
|
|
|
|
|
|
|
|
export const Clone = () => { |
|
|
|
|
import React, { useState } from "react" |
|
|
|
|
import { Alert, Form, FormControl, InputGroup } from "react-bootstrap" |
|
|
|
|
import { useLocalStorage } from "../../hooks/useLocalStorage" |
|
|
|
|
import { gitActionsContext } from "../../state/context" |
|
|
|
|
import { gitPluginContext } from "../gitui" |
|
|
|
|
import { SelectAndCloneRepositories } from "../github/selectandclonerepositories" |
|
|
|
|
import { RemixUiCheckbox } from "@remix-ui/checkbox" |
|
|
|
|
import GitUIButton from "../buttons/gituibutton" |
|
|
|
|
|
|
|
|
|
export interface CloneProps { |
|
|
|
|
plugin: any |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const Clone = ({ plugin }: CloneProps) => { |
|
|
|
|
const context = React.useContext(gitPluginContext) |
|
|
|
|
const actions = React.useContext(gitActionsContext) |
|
|
|
|
const [cloneUrl, setCloneUrl] = useLocalStorage( |
|
|
|
@ -64,20 +68,20 @@ export const Clone = () => { |
|
|
|
|
return ( |
|
|
|
|
<> |
|
|
|
|
<div data-id="clone-panel-content" className="px-3 py-2"> |
|
|
|
|
<InputGroup className="mb-1"> |
|
|
|
|
<InputGroup className="mb-2 pb-1"> |
|
|
|
|
<FormControl data-id="clone-url" id="cloneulr" placeholder="url" name='cloneurl' value={cloneUrl} onChange={e => onGitHubCloneUrlChange(e.target.value)} aria-describedby="urlprepend" /> |
|
|
|
|
</InputGroup> |
|
|
|
|
|
|
|
|
|
<input name='clonebranch' onChange={e => onCloneBranchChange(e.target.value)} value={cloneBranch} className="form-control mb-1 mt-2" placeholder="branch" type="text" id="clonebranch" /> |
|
|
|
|
<input name='clonebranch' onChange={e => onCloneBranchChange(e.target.value)} value={cloneBranch} className="form-control mb-2 mt-2" placeholder="branch" type="text" id="clonebranch" /> |
|
|
|
|
<GitUIButton disabledCondition={!cloneUrl} data-id='clone-btn' className='btn btn-primary mt-1 w-100' onClick={async () => { |
|
|
|
|
clone() |
|
|
|
|
}}>clone</GitUIButton> |
|
|
|
|
<hr /> |
|
|
|
|
<SelectAndCloneRepositories cloneAllBranches={cloneAllBranches} cloneDepth={cloneDepth} /> |
|
|
|
|
<SelectAndCloneRepositories cloneAllBranches={cloneAllBranches} cloneDepth={cloneDepth} plugin={plugin} /> |
|
|
|
|
<hr /> |
|
|
|
|
<label>options</label> |
|
|
|
|
<label>Options</label> |
|
|
|
|
<InputGroup className="mt-1 mb-1"> |
|
|
|
|
<InputGroup.Prepend> |
|
|
|
|
<InputGroup.Prepend className="bg-secondary"> |
|
|
|
|
<InputGroup.Text id="clonedepthprepend"> |
|
|
|
|
--depth |
|
|
|
|
</InputGroup.Text> |
|
|
|
|