Skip to content

Commit

Permalink
fix: overflow of long names of users in top users card
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Jan 22, 2024
1 parent 514e8a6 commit 0e46b52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/components/creators/TopUsersCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ function UserInfo({
</div>
<div className='d-flex flex-column' style={{ minWidth: 0 }}>
<ViewSpaceLink
containerClassName='d-flex'
className='d-flex'
style={{ minWidth: 0 }}
title={
<span
className='FontWeightMedium FontNormal'
Expand Down
9 changes: 6 additions & 3 deletions src/components/spaces/ViewSpaceLink.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Link from 'next/link'
import React from 'react'
import React, { CSSProperties } from 'react'
import { SpaceStruct } from 'src/types'
import { spaceUrl } from '../urls'

Expand All @@ -9,22 +9,25 @@ type Props = {
hint?: string
className?: string
containerClassName?: string
style?: CSSProperties
containerStyle?: CSSProperties
}

export const ViewSpaceLink = React.memo(
({ space, title, hint, className, containerClassName }: Props) => {
({ space, title, hint, className, containerClassName, containerStyle, style }: Props) => {
if (!space.id || !title) return null

return (
<span
className={containerClassName}
style={containerStyle}
onClick={e => {
e.stopPropagation()
e.preventDefault()
}}
>
<Link href='/[spaceId]' as={spaceUrl(space)}>
<a className={'DfBlackLink ' + className} title={hint}>
<a className={'DfBlackLink ' + className} style={style} title={hint}>
{title}
</a>
</Link>
Expand Down

0 comments on commit 0e46b52

Please sign in to comment.