fix: folded sidebar text overflow

This commit is contained in:
DIYgod
2023-02-06 18:27:31 +00:00
parent d97c571ed4
commit 52b84b1d28
2 changed files with 30 additions and 25 deletions
+29 -25
View File
@@ -32,12 +32,14 @@ export const ConnectButton: React.FC<{
size?: "base" | "sm"
hideNotification?: boolean
mobileSimplification?: boolean
hideName?: boolean
}> = ({
left,
variant,
size = "sm",
hideNotification,
mobileSimplification,
hideName,
}) => {
let avatarSize
let sizeDecrease
@@ -167,37 +169,39 @@ export const ConnectButton: React.FC<{
name={userSites.data?.[0]?.name}
size={avatarSize}
/>
<div
className={`flex-1 flex-col min-w-0 ${
mobileSimplification ? "hidden sm:flex" : "flex"
}`}
>
<span
className={`text-left leading-none font-medium truncate ${
InsufficientBalance
? "text-red-600"
: "text-gray-600"
} ${size === "base" ? "text-base" : "text-sm"}`}
style={{ marginBottom: "0.15rem" }}
{!hideName && (
<div
className={`flex-1 flex-col min-w-0 ${
mobileSimplification ? "hidden sm:flex" : "flex"
}`}
>
{userSites.data?.[0]?.name ||
getAccountDisplayName(account)}
</span>
{userSites.data?.[0]?.username && (
<span
className={`text-left leading-none ${
sizeDecrease === "sm" ? "text-sm" : "text-xs"
} truncate ${
className={`text-left leading-none font-medium truncate ${
InsufficientBalance
? "text-red-400"
: "text-gray-400"
}`}
? "text-red-600"
: "text-gray-600"
} ${size === "base" ? "text-base" : "text-sm"}`}
style={{ marginBottom: "0.15rem" }}
>
{"@" + userSites.data?.[0]?.username ||
{userSites.data?.[0]?.name ||
getAccountDisplayName(account)}
</span>
)}
</div>
{userSites.data?.[0]?.username && (
<span
className={`text-left leading-none ${
sizeDecrease === "sm" ? "text-sm" : "text-xs"
} truncate ${
InsufficientBalance
? "text-red-400"
: "text-gray-400"
}`}
>
{"@" + userSites.data?.[0]?.username ||
getAccountDisplayName(account)}
</span>
)}
</div>
)}
</button>
}
dropdown={
@@ -121,6 +121,7 @@ export function DashboardLayout({
left={true}
size="base"
hideNotification={true}
hideName={!isOpen}
/>
</div>