From f0649ffa888f9d89ac6c83feda8dff457ebcafe7 Mon Sep 17 00:00:00 2001 From: James Gatz Date: Wed, 6 Nov 2024 16:45:28 +0200 Subject: [PATCH] feat(Git Staging modal): Update the discard change icon and add tooltips for the utility buttons (#8147) * Update the discard icon and add tooltips for the utility buttons * Hide icons from readers and pointer events --- packages/insomnia/src/ui/components/icon.tsx | 2 +- .../components/modals/git-staging-modal.tsx | 188 ++++++++++++------ 2 files changed, 126 insertions(+), 64 deletions(-) diff --git a/packages/insomnia/src/ui/components/icon.tsx b/packages/insomnia/src/ui/components/icon.tsx index 3c50a3f90e..1a52d63ac6 100644 --- a/packages/insomnia/src/ui/components/icon.tsx +++ b/packages/insomnia/src/ui/components/icon.tsx @@ -11,5 +11,5 @@ import React from 'react'; library.add(fas, far, fab); export const Icon = (props: FontAwesomeIconProps) => ( - + ); diff --git a/packages/insomnia/src/ui/components/modals/git-staging-modal.tsx b/packages/insomnia/src/ui/components/modals/git-staging-modal.tsx index 307820c09f..f00436791f 100644 --- a/packages/insomnia/src/ui/components/modals/git-staging-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/git-staging-modal.tsx @@ -1,6 +1,6 @@ import { Differ, Viewer } from 'json-diff-kit'; import React, { type FC, useEffect } from 'react'; -import { Button, Dialog, GridList, GridListItem, Heading, Label, Modal, ModalOverlay, TextArea, TextField } from 'react-aria-components'; +import { Button, Dialog, GridList, GridListItem, Heading, Label, Modal, ModalOverlay, TextArea, TextField, Tooltip, TooltipTrigger } from 'react-aria-components'; import { useFetcher, useParams } from 'react-router-dom'; import type { CommitToGitRepoResult, GitChangesLoaderData, GitDiffResult } from '../../routes/git-actions'; @@ -263,17 +263,25 @@ export const GitStagingModal: FC<{ onClose: () => void }> = ({
Staged changes - - {changes.staged.length} + + + + Unstage all changes + + + {changes.staged.length}
void }> = ({ {item.entry.name}
- + + + + Unstage change + + {/* - - {changes.unstaged.length} + + + + Discard all changes + + + + + + Stage all changes + + + {changes.unstaged.length}
@@ -378,26 +417,49 @@ export const GitStagingModal: FC<{ onClose: () => void }> = ({ {item.entry.name}
- - + + + + Discard change + + + + + + Stage change + + {/*