Browse Source

bug-fixes

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

28
src/components/Explore/index.tsx

@ -30,7 +30,7 @@ export default function Explore() {
} }
return ( return (
<div className="space-y-6"> <div className="min-w-0 w-full overflow-x-hidden space-y-6">
{collections.map((collection) => ( {collections.map((collection) => (
<RelayCollection key={collection.id} collection={collection} /> <RelayCollection key={collection.id} collection={collection} />
))} ))}
@ -41,16 +41,16 @@ export default function Explore() {
function RelayCollection({ collection }: { collection: TAwesomeRelayCollection }) { function RelayCollection({ collection }: { collection: TAwesomeRelayCollection }) {
const { deepBrowsing } = useDeepBrowsing() const { deepBrowsing } = useDeepBrowsing()
return ( return (
<div> <div className="min-w-0">
<div <div
className={cn( 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' deepBrowsing ? 'top-12' : 'top-24'
)} )}
> >
{collection.name} {collection.name}
</div> </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) => ( {collection.relays.map((url) => (
<RelayItem key={url} url={url} /> <RelayItem key={url} url={url} />
))} ))}
@ -72,14 +72,16 @@ function RelayItem({ url }: { url: string }) {
} }
return ( return (
<RelaySimpleInfo <div className="min-w-0">
key={relayInfo.url} <RelaySimpleInfo
className="clickable h-auto px-4 py-3 border-b md:rounded-lg md:border" key={relayInfo.url}
relayInfo={relayInfo} className="clickable h-auto px-4 py-3 border-b md:rounded-lg md:border min-w-0"
onClick={(e) => { relayInfo={relayInfo}
e.stopPropagation() onClick={(e) => {
navigateToRelay(toRelay(relayInfo.url)) e.stopPropagation()
}} navigateToRelay(toRelay(relayInfo.url))
/> }}
/>
</div>
) )
} }

4
src/components/RelaySimpleInfo/index.tsx

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

1
src/layouts/PrimaryPageLayout/index.tsx

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

14
src/lib/error-suppression.ts

@ -136,7 +136,12 @@ export function suppressExpectedErrors() {
if (message.includes('unrecognised filter item') || message.includes('unrecognized filter item')) { if (message.includes('unrecognised filter item') || message.includes('unrecognized filter item')) {
return 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 // Call original console.error for unexpected errors
originalConsoleError.apply(console, args) originalConsoleError.apply(console, args)
} }
@ -220,7 +225,12 @@ export function suppressExpectedErrors() {
message.includes('too many concurrent REQs')) { message.includes('too many concurrent REQs')) {
return 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 // Call original console.warn for unexpected warnings
originalConsoleWarn.apply(console, args) originalConsoleWarn.apply(console, args)
} }

Loading…
Cancel
Save