parent
7f24aec663
commit
ebd1f3660c
@ -1,4 +1,6 @@ |
||||
{ |
||||
"electron.openFolder": "Open Folder", |
||||
"electron.recentFolders": "Recent Folders" |
||||
"electron.recentFolders": "Recent Folders", |
||||
"electron.gitClone": "Clone a Git Repository", |
||||
"electron.openFolderMessage": "In order to use Git features, you can open a folder or clone a repository." |
||||
} |
@ -0,0 +1,3 @@ |
||||
{ |
||||
"gitui.openFolderMessage": "In order to use Git features, you can open a folder or clone a repository." |
||||
} |
@ -1,12 +1,30 @@ |
||||
import React, { useEffect, useState } from 'react' |
||||
import { appPlatformTypes, platformContext } from '@remix-ui/app' |
||||
import React, { useEffect, useState, useContext } from 'react' |
||||
import { FormattedMessage } from "react-intl" |
||||
import { pluginActionsContext } from '../state/context' |
||||
import { openCloneDialog, openFolderInSameWindow } from '../lib/pluginActions' |
||||
|
||||
export const Disabled = () => { |
||||
const platform = useContext(platformContext) |
||||
|
||||
const openFolderElectron = async (path: string) => { |
||||
await openFolderInSameWindow(path) |
||||
} |
||||
|
||||
const clone = async () => { |
||||
openCloneDialog() |
||||
} |
||||
|
||||
return ( |
||||
(platform === appPlatformTypes.desktop) ? |
||||
<div className='p-1'> |
||||
<div><FormattedMessage id="gitui.openFolderMessage"/></div> |
||||
<div data-id="openFolderButton" onClick={async () => { await openFolderElectron(null) }} className='btn btn-primary w-100 my-1'><FormattedMessage id="electron.openFolder" /></div>
|
||||
<div data-id="cloneButton" onClick={async () => { await clone() }} className='btn btn-primary w-100'><FormattedMessage id="electron.gitClone" /></div>
|
||||
</div> |
||||
: |
||||
<div data-id='disabled' className='text-sm w-100 alert alert-warning'> |
||||
Git is currently disabled.<br></br> |
||||
If you are using RemixD you can use git on the terminal.<br></br> |
||||
</div> |
||||
) |
||||
|
||||
</div>) |
||||
} |
Loading…
Reference in new issue