Skip to content

Commit

Permalink
Subtle current drive button, improved hover #681
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Nov 7, 2023
1 parent 6b51c8a commit e72c2b6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion browser/data-browser/src/components/Parent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ const MAX_BREADCRUMB_DEPTH = 4;
/** Shows a "Set drive" button if the current drive is different from the Subject */
function DriveMismatch({ subject }: { subject: string }) {
const { drive, setDrive } = useSettings();
const resource = useResource(subject, { allowIncomplete: true });
const [title] = useTitle(resource);

const handleSetDrive = () => {
setDrive(subject);
Expand All @@ -96,7 +98,11 @@ function DriveMismatch({ subject }: { subject: string }) {

if (mismatch)
return (
<Button onClick={handleSetDrive} title='Set Drive'>
<Button
title={`Set ${title} as current drive`}
subtle
onClick={handleSetDrive}
>
Set Drive
</Button>
);
Expand Down

0 comments on commit e72c2b6

Please sign in to comment.