Skip to content

Commit

Permalink
Studio: Remove connect site button when already exists a Sync connect…
Browse files Browse the repository at this point in the history
…ion (#754)

* Ensure Connect button is displayed only when there are no sites connected

* Remove unused import

---------

Co-authored-by: Kateryna Kodonenko <[email protected]>
  • Loading branch information
katinthehatsite and Kateryna Kodonenko authored Dec 20, 2024
1 parent dc7ef13 commit 7fd9d4e
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions src/components/sync-connected-sites.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { getIpcApi } from '../lib/get-ipc-api';
import { ArrowIcon } from './arrow-icon';
import { Badge } from './badge';
import Button from './button';
import { ConnectButton } from './connect-create-buttons';
import { OpenSitesSyncSelector } from './content-tab-sync';
import { CircleRedCrossIcon } from './icons/circle-red-cross';
import offlineIcon from './offline-icon';
Expand Down Expand Up @@ -444,22 +443,16 @@ export function SyncConnectedSites( {
}, [ connectedSites ] );

return (
<div className="flex flex-col h-full overflow-hidden">
<div className="flex flex-col flex-1 pt-8 overflow-y-auto">
{ siteSections.map( ( section ) => (
<SyncConnectedSitesSection
key={ section.id }
section={ section }
selectedSite={ selectedSite }
disconnectSite={ disconnectSite }
openSitesSyncSelector={ openSitesSyncSelector }
/>
) ) }
</div>

<div className="flex mt-auto gap-4 pt-5 pb-4 px-8 border-t border-a8c-gray-5 flex-shrink-0">
<ConnectButton variant="secondary" connectSite={ openSitesSyncSelector } />
</div>
<div className="flex flex-col flex-1 pt-8 overflow-y-auto">
{ siteSections.map( ( section ) => (
<SyncConnectedSitesSection
key={ section.id }
section={ section }
selectedSite={ selectedSite }
disconnectSite={ disconnectSite }
openSitesSyncSelector={ openSitesSyncSelector }
/>
) ) }
</div>
);
}

0 comments on commit 7fd9d4e

Please sign in to comment.