fix: inline card server name overflow

This commit is contained in:
hamster1963
2024-12-06 09:49:02 +08:00
parent 8261bd841e
commit 560bcea0b8
5 changed files with 52 additions and 49 deletions

View File

@@ -1,22 +1,24 @@
import { useRegisterSW } from 'virtual:pwa-register/react';
import { useTranslation } from 'react-i18next';
import { toast } from 'sonner';
import { useRegisterSW } from "virtual:pwa-register/react";
import { useTranslation } from "react-i18next";
import { toast } from "sonner";
function ReloadPrompt() {
const { t } = useTranslation();
const {
needRefresh: [needRefresh, setNeedRefresh],
updateServiceWorker,
} = useRegisterSW({
onRegisteredSW(swUrl) {
console.log(`SW Registered: ${swUrl} (Version: ${import.meta.env.VITE_GIT_HASH})`);
console.log(
`SW Registered: ${swUrl} (Version: ${import.meta.env.VITE_GIT_HASH})`,
);
},
onRegisterError(error) {
console.log('SW registration error', error);
console.log("SW registration error", error);
},
onOfflineReady() {
toast.success(t('pwa.offlineReady'));
toast.success(t("pwa.offlineReady"));
},
});
@@ -32,19 +34,14 @@ function ReloadPrompt() {
return null;
}
toast.message(
`${t('pwa.newContent')} (${import.meta.env.VITE_GIT_HASH})`,
{
action: {
label: t('pwa.reload'),
onClick: () => update(),
},
onDismiss: close,
duration: Infinity,
}
);
toast.message(`${t("pwa.newContent")} (${import.meta.env.VITE_GIT_HASH})`, {
action: {
label: t("pwa.reload"),
onClick: () => update(),
},
onDismiss: close,
duration: Infinity,
});
return null;
}

View File

@@ -82,7 +82,7 @@ export default function ServerCardInline({
>
{showFlag ? <ServerFlag country_code={country_code} /> : null}
</div>
<div className="relative flex flex-col">
<div className="relative w-24 flex flex-col">
<p
className={cn(
"break-all font-bold tracking-tight",
@@ -226,7 +226,7 @@ export default function ServerCardInline({
<div className="relative">
<p
className={cn(
"break-all font-bold tracking-tight",
"break-all font-bold w-24 tracking-tight",
showFlag ? "text-xs" : "text-sm",
)}
>