diff --git a/libs/remix-ui/git/src/components/disabled.tsx b/libs/remix-ui/git/src/components/disabled.tsx index 3ba210dd10..fbd54d6177 100644 --- a/libs/remix-ui/git/src/components/disabled.tsx +++ b/libs/remix-ui/git/src/components/disabled.tsx @@ -2,11 +2,11 @@ import React, { useEffect, useState } from 'react' export const Disabled = () => { - return ( -
+ return ( +
Git is currently disabled.

If you are using RemixD you can use git on the terminal.

-
- ) +
+ ) } \ No newline at end of file diff --git a/libs/remix-ui/git/src/components/gitui.tsx b/libs/remix-ui/git/src/components/gitui.tsx index e7b6d2e940..7bfbc661cf 100644 --- a/libs/remix-ui/git/src/components/gitui.tsx +++ b/libs/remix-ui/git/src/components/gitui.tsx @@ -162,8 +162,6 @@ export const GitUI = (props: IGitUi) => { showAlert } - - return ( <>{(!gitState.canUseApp) ? :
diff --git a/libs/remix-ui/git/src/components/panels/commands/pushpull.tsx b/libs/remix-ui/git/src/components/panels/commands/pushpull.tsx index b65ed8f3fe..e18c0b9490 100644 --- a/libs/remix-ui/git/src/components/panels/commands/pushpull.tsx +++ b/libs/remix-ui/git/src/components/panels/commands/pushpull.tsx @@ -15,6 +15,7 @@ export const PushPull = () => { const [localBranchOptions, setLocalBranchOptions] = useState([]); const [remoteBranchOptions, setRemoteBranchOptions] = useState([]); const [localRemotesOptions, setLocalRemotesOptions] = useState([]); + const [disabled, setDisabled] = useState(false) const [force, setForce] = useState(false) useEffect(() => { @@ -25,11 +26,14 @@ export const PushPull = () => { if (!context.upstream || !currentUpstreamIsInRemotes) { if (context.currentBranch && context.currentBranch.remote && context.currentBranch.remote.name) { actions.setUpstreamRemote(context.currentBranch.remote) + setDisabled(false) } else { if (context.remotes && context.remotes.length > 0) { actions.setUpstreamRemote(context.remotes[0]) + setDisabled(false) } else { actions.setUpstreamRemote(null) + setDisabled(true) } } } @@ -136,7 +140,9 @@ export const PushPull = () => { return ( <> - + {disabled?
+ You cannot push or pull because you haven't connected to or selected a remote. +
: null}
pull()} className="btn btn-primary mr-1">Pull