remote select

pull/5026/head
bunsenstraat 4 months ago committed by Aniket
parent 2a60d77f65
commit f608e51ebd
  1. 2
      libs/remix-ui/git/src/components/panels/remotes.tsx
  2. 8
      libs/remix-ui/git/src/components/panels/remoteselect.tsx

@ -33,7 +33,7 @@ export const Remotes = () => {
{context.remotes && context.remotes.map((remote, index) => {
return (
<Remoteselect key={index} openDefault={index===0} remote={remote}></Remoteselect>
<Remoteselect key={index} openDefault={(context.upstream && context.upstream.name === remote.url) || index===0} remote={remote}></Remoteselect>
);
})}
</div> : <div>

@ -17,14 +17,18 @@ export interface RemoteSelectProps {
}
export const Remoteselect = (props: RemoteSelectProps) => {
const { remote } = props;
const { remote, openDefault } = props;
const context = React.useContext(gitPluginContext)
const actions = React.useContext(gitActionsContext)
const [activePanel, setActivePanel] = useState<string>("");
useEffect(() => {
setActivePanel(openDefault ? "0" : "")
}, [openDefault])
return (
<>
<Accordion activeKey={activePanel ? activePanel : props.openDefault ? '0' : ''} defaultActiveKey=''>
<Accordion activeKey={activePanel} defaultActiveKey=''>
<RemotesDetailsNavigation callback={setActivePanel} eventKey="0" activePanel={activePanel} remote={remote} />
<Accordion.Collapse className="pl-2 border-left ml-1" eventKey="0">
<>

Loading…
Cancel
Save