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

Fix tab navigation for InputWithCopy #18009

Merged
merged 3 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
12 changes: 5 additions & 7 deletions components/dashboard/src/components/InputWithCopy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ export function InputWithCopy(props: { value: string; tip?: string; className?:
type="text"
value={props.value}
/>
<div className="cursor-pointer" onClick={() => handleCopyToClipboard(props.value)}>
<div className="absolute top-1/3 right-3">
<Tooltip content={copied ? "Copied" : tip}>
<img src={copy} alt="copy icon" title={tip} />
</Tooltip>
</div>
</div>
<button className="reset absolute top-1/3 right-3" onClick={() => handleCopyToClipboard(props.value)}>
<Tooltip content={copied ? "Copied" : tip}>
<img src={copy} alt="copy icon" title={tip} />
</Tooltip>
</button>
</div>
);
}
5 changes: 5 additions & 0 deletions components/dashboard/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
button {
@apply cursor-pointer px-4 py-2 my-auto bg-green-600 dark:bg-green-700 hover:bg-green-700 dark:hover:bg-green-600 text-gray-100 dark:text-green-100 text-sm font-medium rounded-md focus:outline-none focus:ring transition ease-in-out;
}
button.reset {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class will be useful in scenarios like this where we use buttons purely for semantics and a11y

@apply bg-transparent hover:bg-transparent font-normal rounded-none;
padding: unset;
text-align: start;
}
button.secondary {
@apply bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 text-gray-500 dark:text-gray-100 hover:text-gray-600;
}
Expand Down