Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some UI fine tuning for the dependency manager #2054

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 51 additions & 9 deletions src/renderer/contexts/DependencyContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
AccordionIcon,
AccordionItem,
AccordionPanel,
Box,
Button,
Center,
Collapse,
Expand Down Expand Up @@ -155,8 +156,47 @@
textAlign="left"
w="full"
>
{dep.name} ({dep.dependencies.length} package
{dep.dependencies.length === 1 ? '' : 's'})
{outdatedPackages.length > 0 ||
missingPackages.length > 0 ? (
<>
{outdatedPackages.length > 0
? `${dep.name} (${
outdatedPackages.length
} package${
outdatedPackages.length === 1 ? '' : 's'
} outdated)`
: `${dep.name} (${
dep.dependencies.length
} package${
dep.dependencies.length === 1 ? '' : 's'
})`}
{outdatedPackages.length > 0 ||
missingPackages.length > 0 ? (
<Box
backgroundColor="transparent"
borderRadius={25}
borderColor="white"

Check failure on line 178 in src/renderer/contexts/DependencyContext.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Props should be sorted alphabetically
borderWidth={1}
color="white"
display="inline-block"
fontSize="xs"
ml={3}
px={2}
>
{formatSizeEstimate([
...missingPackages,
...outdatedPackages,
])}
</Box>
) : (
[]
)}
</>
) : (
`${dep.name} (${dep.dependencies.length} package${
dep.dependencies.length === 1 ? '' : 's'
})`
)}
</Text>
<Tooltip
closeOnClick
Expand All @@ -181,18 +221,22 @@
disabled={isRunningShell}
isLoading={isRunningShell}
leftIcon={<DownloadIcon />}
maxW="100%"
size="sm"
width="7em"
onClick={onUpdate}
>
Update ({formatSizeEstimate(outdatedPackages)})
Update
</Button>
)}

<Button
colorScheme="red"
disabled={isRunningShell}
leftIcon={<DeleteIcon />}
maxW="100%"
size="sm"
width="7em"
onClick={onUninstall}
>
Uninstall
Expand All @@ -208,15 +252,12 @@
disabled={isRunningShell}
isLoading={isRunningShell}
leftIcon={<DownloadIcon />}
maxW="100%"
size="sm"
width="7em"
onClick={onInstall}
>
Install (
{formatSizeEstimate([
...missingPackages,
...outdatedPackages,
])}
)
Install
</Button>
</HStack>
)}
Expand Down Expand Up @@ -491,6 +532,7 @@
aria-label={isConsoleOpen ? 'Hide Console' : 'View Console'}
leftIcon={<BsTerminalFill />}
size="sm"
width="9.9em"
onClick={() => setIsConsoleOpen(!isConsoleOpen)}
>
{isConsoleOpen ? 'Hide Console' : 'View Console'}
Expand Down
Loading