Browse Source

bug-fixes

imwald
Silberengel 2 months ago
parent
commit
4b2b6f9089
  1. 12
      src/components/Explore/index.tsx
  2. 4
      src/components/RelaySimpleInfo/index.tsx
  3. 1
      src/layouts/PrimaryPageLayout/index.tsx
  4. 10
      src/lib/error-suppression.ts

12
src/components/Explore/index.tsx

@ -30,7 +30,7 @@ export default function Explore() { @@ -30,7 +30,7 @@ export default function Explore() {
}
return (
<div className="space-y-6">
<div className="min-w-0 w-full overflow-x-hidden space-y-6">
{collections.map((collection) => (
<RelayCollection key={collection.id} collection={collection} />
))}
@ -41,16 +41,16 @@ export default function Explore() { @@ -41,16 +41,16 @@ export default function Explore() {
function RelayCollection({ collection }: { collection: TAwesomeRelayCollection }) {
const { deepBrowsing } = useDeepBrowsing()
return (
<div>
<div className="min-w-0">
<div
className={cn(
'sticky bg-background z-20 px-4 py-3 text-2xl font-semibold max-md:border-b',
'sticky bg-background z-20 px-4 py-3 text-2xl font-semibold max-md:border-b min-w-0 break-words',
deepBrowsing ? 'top-12' : 'top-24'
)}
>
{collection.name}
</div>
<div className="grid md:px-4 md:grid-cols-2 md:gap-3">
<div className="grid min-w-0 md:px-4 md:grid-cols-2 md:gap-3">
{collection.relays.map((url) => (
<RelayItem key={url} url={url} />
))}
@ -72,14 +72,16 @@ function RelayItem({ url }: { url: string }) { @@ -72,14 +72,16 @@ function RelayItem({ url }: { url: string }) {
}
return (
<div className="min-w-0">
<RelaySimpleInfo
key={relayInfo.url}
className="clickable h-auto px-4 py-3 border-b md:rounded-lg md:border"
className="clickable h-auto px-4 py-3 border-b md:rounded-lg md:border min-w-0"
relayInfo={relayInfo}
onClick={(e) => {
e.stopPropagation()
navigateToRelay(toRelay(relayInfo.url))
}}
/>
</div>
)
}

4
src/components/RelaySimpleInfo/index.tsx

@ -19,8 +19,8 @@ export default function RelaySimpleInfo({ @@ -19,8 +19,8 @@ export default function RelaySimpleInfo({
const { t } = useTranslation()
return (
<div className={cn('space-y-1', className)} {...props}>
<div className="flex items-start justify-between gap-2 w-full">
<div className={cn('min-w-0 space-y-1', className)} {...props}>
<div className="flex items-start justify-between gap-2 w-full min-w-0">
<div className="flex flex-1 w-0 items-center gap-2">
<RelayIcon url={relayInfo?.url} className="h-9 w-9" />
<div className="flex-1 w-0">

1
src/layouts/PrimaryPageLayout/index.tsx

@ -72,6 +72,7 @@ const PrimaryPageLayout = forwardRef( @@ -72,6 +72,7 @@ const PrimaryPageLayout = forwardRef(
<DeepBrowsingProvider active={current === pageName && display}>
<div
ref={smallScreenScrollAreaRef}
className="min-w-0 overflow-x-hidden"
style={{
paddingBottom: 'calc(env(safe-area-inset-bottom) + 3rem)'
}}

10
src/lib/error-suppression.ts

@ -137,6 +137,11 @@ export function suppressExpectedErrors() { @@ -137,6 +137,11 @@ export function suppressExpectedErrors() {
return
}
// Suppress "unreachable code after return" from third-party scripts (e.g. YouTube embed, bundled deps)
if (message.includes('unreachable code after return statement')) {
return
}
// Call original console.error for unexpected errors
originalConsoleError.apply(console, args)
}
@ -221,6 +226,11 @@ export function suppressExpectedErrors() { @@ -221,6 +226,11 @@ export function suppressExpectedErrors() {
return
}
// Suppress "unreachable code after return" from third-party scripts (e.g. YouTube embed, bundled deps)
if (message.includes('unreachable code after return statement')) {
return
}
// Call original console.warn for unexpected warnings
originalConsoleWarn.apply(console, args)
}

Loading…
Cancel
Save