add utility class for word-break: break-word
This commit is contained in:
parent
7773234138
commit
bc53f099bd
|
@ -104,10 +104,7 @@ export function ContractCard(props: {
|
||||||
contract={contract}
|
contract={contract}
|
||||||
className={'hidden md:inline-flex'}
|
className={'hidden md:inline-flex'}
|
||||||
/>
|
/>
|
||||||
<p
|
<p className="break-anywhere font-semibold text-indigo-700 group-hover:underline group-hover:decoration-indigo-400 group-hover:decoration-2">
|
||||||
className="break-words font-semibold text-indigo-700 group-hover:underline group-hover:decoration-indigo-400 group-hover:decoration-2"
|
|
||||||
style={{ /* For iOS safari */ wordBreak: 'break-word' }}
|
|
||||||
>
|
|
||||||
{question}
|
{question}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ export function Leaderboard(props: {
|
||||||
{users.map((user, index) => (
|
{users.map((user, index) => (
|
||||||
<tr key={user.id}>
|
<tr key={user.id}>
|
||||||
<td>{index + 1}</td>
|
<td>{index + 1}</td>
|
||||||
<td style={{ maxWidth: 190 }}>
|
<td className="max-w-[190px]">
|
||||||
<SiteLink className="relative" href={`/${user.username}`}>
|
<SiteLink className="relative" href={`/${user.username}`}>
|
||||||
<Row className="items-center gap-4">
|
<Row className="items-center gap-4">
|
||||||
<Avatar avatarUrl={user.avatarUrl} size={8} />
|
<Avatar avatarUrl={user.avatarUrl} size={8} />
|
||||||
|
|
|
@ -38,10 +38,7 @@ export function Linkify(props: { text: string; gray?: boolean }) {
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
return (
|
return (
|
||||||
<span
|
<span className="break-anywhere">
|
||||||
className="break-words"
|
|
||||||
style={{ /* For iOS safari */ wordBreak: 'break-word' }}
|
|
||||||
>
|
|
||||||
{text.split(regex).map((part, i) => (
|
{text.split(regex).map((part, i) => (
|
||||||
<Fragment key={i}>
|
<Fragment key={i}>
|
||||||
{part}
|
{part}
|
||||||
|
|
|
@ -164,10 +164,7 @@ export function AnswerLabel(props: {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tooltip text={truncated === text ? false : text}>
|
<Tooltip text={truncated === text ? false : text}>
|
||||||
<span
|
<span className={clsx('break-anywhere whitespace-pre-line', className)}>
|
||||||
style={{ wordBreak: 'break-word' }}
|
|
||||||
className={clsx('whitespace-pre-line break-words', className)}
|
|
||||||
>
|
|
||||||
{truncated}
|
{truncated}
|
||||||
</span>
|
</span>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { ReactNode } from 'react'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
|
|
||||||
export const linkClass =
|
export const linkClass =
|
||||||
'z-10 break-words hover:underline hover:decoration-indigo-400 hover:decoration-2'
|
'z-10 break-anywhere hover:underline hover:decoration-indigo-400 hover:decoration-2'
|
||||||
|
|
||||||
export const SiteLink = (props: {
|
export const SiteLink = (props: {
|
||||||
href: string
|
href: string
|
||||||
|
@ -19,7 +19,6 @@ export const SiteLink = (props: {
|
||||||
className={clsx(linkClass, className)}
|
className={clsx(linkClass, className)}
|
||||||
href={href}
|
href={href}
|
||||||
target={href.startsWith('http') ? '_blank' : undefined}
|
target={href.startsWith('http') ? '_blank' : undefined}
|
||||||
style={{ /* For iOS safari */ wordBreak: 'break-word' }}
|
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
if (onClick) onClick()
|
if (onClick) onClick()
|
||||||
|
|
|
@ -148,10 +148,7 @@ export function UserPage(props: { user: User }) {
|
||||||
<Col className="mx-4 -mt-6">
|
<Col className="mx-4 -mt-6">
|
||||||
<Row className={'flex-wrap justify-between gap-y-2'}>
|
<Row className={'flex-wrap justify-between gap-y-2'}>
|
||||||
<Col>
|
<Col>
|
||||||
<span
|
<span className="break-anywhere text-2xl font-bold">
|
||||||
className="text-2xl font-bold"
|
|
||||||
style={{ wordBreak: 'break-word' }}
|
|
||||||
>
|
|
||||||
{user.name}
|
{user.name}
|
||||||
</span>
|
</span>
|
||||||
<span className="text-gray-500">@{user.username}</span>
|
<span className="text-gray-500">@{user.username}</span>
|
||||||
|
|
|
@ -56,6 +56,10 @@ module.exports = {
|
||||||
display: 'none',
|
display: 'none',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
'.break-anywhere': {
|
||||||
|
'overflow-wrap': 'anywhere',
|
||||||
|
'word-break': 'break-word', // for Safari
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user