From 1f514ded1651b56a0aec2e53333c3e4f2eabdc65 Mon Sep 17 00:00:00 2001 From: James Gatz Date: Thu, 12 Oct 2023 17:35:17 +0200 Subject: [PATCH] Use Icon component and update loading animation (#6685) --- .../ui/components/dropdowns/sync-dropdown.tsx | 60 +++++-------------- 1 file changed, 16 insertions(+), 44 deletions(-) diff --git a/packages/insomnia/src/ui/components/dropdowns/sync-dropdown.tsx b/packages/insomnia/src/ui/components/dropdowns/sync-dropdown.tsx index 31aea8319..f687f2c30 100644 --- a/packages/insomnia/src/ui/components/dropdowns/sync-dropdown.tsx +++ b/packages/insomnia/src/ui/components/dropdowns/sync-dropdown.tsx @@ -26,6 +26,7 @@ import { WorkspaceLoaderData } from '../../routes/workspace'; import { Dropdown, DropdownButton, DropdownItem, DropdownSection, ItemContent } from '../base/dropdown'; import { Link } from '../base/link'; import { HelpTooltip } from '../help-tooltip'; +import { Icon } from '../icon'; import { showModal } from '../modals'; import { showError } from '../modals'; import { AlertModal } from '../modals/alert-modal'; @@ -337,7 +338,7 @@ export const SyncDropdown: FC = ({ vcs, workspace, project }) => {
- Documentation + Documentation
@@ -348,7 +349,7 @@ export const SyncDropdown: FC = ({ vcs, workspace, project }) => { return (
); @@ -430,7 +431,7 @@ export const SyncDropdown: FC = ({ vcs, workspace, project }) => { width: '100%', }} > - Setup Sync + Setup Sync } @@ -457,7 +458,7 @@ export const SyncDropdown: FC = ({ vcs, workspace, project }) => { justifyContent: 'flex-start!important', }} > - Use Git Sync + Use Git Sync @@ -504,7 +505,6 @@ export const SyncDropdown: FC = ({ vcs, workspace, project }) => { } const canPush = ahead > 0; const canPull = behind > 0; - const loadIcon = ; const pullToolTipMsg = canPull ? `There ${behind === 1 ? 'is' : 'are'} ${behind} snapshot${behind === 1 ? '' : 's'} to pull` : 'No changes to pull'; @@ -546,48 +546,25 @@ export const SyncDropdown: FC = ({ vcs, workspace, project }) => { width: '100%', }} > -
- {' '} +
+ {' '} {initializing ? 'Initializing...' : currentBranch}
-
+
- + {/* Only show cloud icons if logged in */} {session.isLoggedIn() && ( - {loadingPull ? ( - loadIcon - ) : ( - - - - )} + + + - {loadingPush ? ( - loadIcon - ) : ( - - - - )} + + + )}
@@ -618,7 +595,7 @@ export const SyncDropdown: FC = ({ vcs, workspace, project }) => { justifyContent: 'flex-start!important', }} > - Use Git Sync + Use Git Sync @@ -751,11 +728,6 @@ export const SyncDropdown: FC = ({ vcs, workspace, project }) => { onHide={() => setIsSyncStagingModalOpen(false)} /> )} - {/* {isSyncMergeModalOpen && ( - setIsSyncMergeModalOpen(false)} - /> - )} */} {isSyncHistoryModalOpen && (