Skip to content

Commit

Permalink
fix(VisitLinkRequirement): set break-all for links
Browse files Browse the repository at this point in the history
  • Loading branch information
BrickheadJohnny committed Nov 12, 2024
1 parent 6422907 commit 4e46feb
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/requirements/VisitLink/VisitLinkRequirement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import { Anchor } from "@/components/ui/Anchor"
import { Button, buttonVariants } from "@/components/ui/Button"
import { useErrorToast } from "@/components/ui/hooks/useErrorToast"
import { cn } from "@/lib/utils"
import { ArrowSquareOut, Link } from "@phosphor-icons/react/dist/ssr"
import { useMembershipUpdate } from "components/[guild]/JoinModal/hooks/useMembershipUpdate"
import {
Expand Down Expand Up @@ -77,24 +78,23 @@ const VisitLinkRequirement = ({ ...props }: RequirementProps) => {
})
}

const Original = () => {
const wordBreak = data.id?.startsWith("http") ? "break-all" : "break-word"

return (
<>
{"Visit link: "}
<Anchor
href={data.id}
variant="highlighted"
showExternal
target="_blank"
onClick={onVisit}
>
{data.id}
</Anchor>
</>
)
}
const Original = () => (
<>
<span>{"Visit link: "}</span>
<Anchor
href={data.id}
variant="highlighted"
showExternal
target="_blank"
onClick={onVisit}
className={cn("break-words", {
"break-all": data.id?.startsWith("http"),
})}
>
{data.id}
</Anchor>
</>
)

return (
<Requirement
Expand Down

0 comments on commit 4e46feb

Please sign in to comment.