Skip to content

Commit c628ff2

Browse files
Tighten copy button and tweak overflow style
1 parent 0ef57d6 commit c628ff2

File tree

5 files changed

+23
-19
lines changed

5 files changed

+23
-19
lines changed

app/components/ExternalIps.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@ export function ExternalIps({ project, instance }: PP.Instance) {
3838
// create a list of CopyableIp components
3939
const links = ipsToShow.map((eip) => <CopyableIp ip={eip.ip} key={eip.ip} />)
4040

41-
// if there are more than 2 ips, add a link to the instance networking page
42-
if (overflowCount > 0) {
43-
links.push(
44-
<Link
45-
to={pb.instanceNetworking({ project, instance })}
46-
className="link-with-underline text-sans-md"
47-
>
48-
+{overflowCount}
49-
</Link>
50-
)
51-
}
52-
5341
return (
54-
<div className="flex max-w-full items-center gap-1">
55-
{intersperse(links, <Slash />)}
42+
<div className="flex max-w-full items-center">
43+
{intersperse(links, <Slash className="ml-0.5 mr-1.5" />)}
44+
{/* if there are more than 2 ips, add a link to the instance networking page */}
45+
{overflowCount > 0 && (
46+
<>
47+
<Slash className="ml-0.5 mr-1.5" />
48+
<Link
49+
to={pb.instanceNetworking({ project, instance })}
50+
className="hover:link-with-underline -m-2 self-center p-2 text-tertiary"
51+
>
52+
53+
</Link>
54+
</>
55+
)}
5656
</div>
5757
)
5858
}

app/pages/settings/ProfilePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function ProfilePage() {
4545
<PropertiesTable.Row label="Display name">{me.displayName}</PropertiesTable.Row>
4646
<PropertiesTable.Row label="User ID">
4747
{me.id}
48-
<CopyToClipboard className="ml-2" text={me.id} />
48+
<CopyToClipboard className="ml-1" text={me.id} />
4949
</PropertiesTable.Row>
5050
</PropertiesTable>
5151

app/ui/lib/CopyableIp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import { CopyToClipboard } from '~/ui/lib/CopyToClipboard'
99

1010
export const CopyableIp = ({ ip, isLinked = true }: { ip: string; isLinked?: boolean }) => (
11-
<span className="flex max-w-full items-center gap-1">
11+
<span className="flex max-w-full items-center gap-0.5">
1212
{isLinked ? (
1313
<a
1414
className="link-with-underline truncate text-sans-md"

app/ui/lib/Slash.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
*
66
* Copyright Oxide Computer Company
77
*/
8-
export const Slash = () => (
9-
<span className="mx-1 text-quaternary selected:text-accent-disabled">/</span>
8+
import cn from 'classnames'
9+
10+
export const Slash = ({ className }: { className?: string }) => (
11+
<span className={cn('mx-1 text-quaternary selected:text-accent-disabled', className)}>
12+
/
13+
</span>
1014
)

app/ui/lib/Truncate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const Truncate = ({
3333
// Only use the tooltip if the text is longer than maxLength
3434
return (
3535
// overflow-hidden required to make inner truncate work
36-
<div className="flex items-center space-x-2 overflow-hidden">
36+
<div className="flex items-center gap-0.5 overflow-hidden">
3737
<Tooltip content={text} delay={tooltipDelay}>
3838
<div aria-label={text} className="truncate">
3939
{truncate(text, maxLength, position)}

0 commit comments

Comments
 (0)