Truncate group name in panels
This commit is contained in:
parent
5c069b8b93
commit
c8ff9db879
|
@ -22,17 +22,18 @@ const GroupListItem = (props: IGroup) => {
|
||||||
justifyContent='between'
|
justifyContent='between'
|
||||||
data-testid='group-list-item'
|
data-testid='group-list-item'
|
||||||
>
|
>
|
||||||
<Link key={group.id} to={`/group/${group.slug}`}>
|
<Link key={group.id} to={`/group/${group.slug}`} className='overflow-hidden'>
|
||||||
<HStack alignItems='center' space={2}>
|
<HStack alignItems='center' space={2}>
|
||||||
<GroupAvatar
|
<GroupAvatar
|
||||||
group={group}
|
group={group}
|
||||||
size={44}
|
size={44}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack>
|
<Stack className='overflow-hidden'>
|
||||||
<Text
|
<Text
|
||||||
weight='bold'
|
weight='bold'
|
||||||
dangerouslySetInnerHTML={{ __html: group.display_name_html }}
|
dangerouslySetInnerHTML={{ __html: group.display_name_html }}
|
||||||
|
truncate
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<HStack className='text-gray-700 dark:text-gray-600' space={1} alignItems='center'>
|
<HStack className='text-gray-700 dark:text-gray-600' space={1} alignItems='center'>
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { HStack, Stack, Text } from 'soapbox/components/ui';
|
||||||
|
|
||||||
import { generateText, randomIntFromInterval } from '../utils';
|
import { generateText, randomIntFromInterval } from '../utils';
|
||||||
|
|
||||||
export default () => {
|
export default ({ withJoinAction = true }: { withJoinAction?: boolean }) => {
|
||||||
const groupNameLength = randomIntFromInterval(12, 20);
|
const groupNameLength = randomIntFromInterval(12, 20);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -13,7 +13,7 @@ export default () => {
|
||||||
justifyContent='between'
|
justifyContent='between'
|
||||||
className='animate-pulse'
|
className='animate-pulse'
|
||||||
>
|
>
|
||||||
<HStack alignItems='center' space={2}>
|
<HStack alignItems='center' space={2} className='overflow-hidden'>
|
||||||
{/* Group Avatar */}
|
{/* Group Avatar */}
|
||||||
<div className='h-11 w-11 rounded-full bg-gray-500 dark:bg-gray-700 dark:ring-primary-900' />
|
<div className='h-11 w-11 rounded-full bg-gray-500 dark:bg-gray-700 dark:ring-primary-900' />
|
||||||
|
|
||||||
|
@ -37,7 +37,9 @@ export default () => {
|
||||||
</HStack>
|
</HStack>
|
||||||
|
|
||||||
{/* Join Group Button */}
|
{/* Join Group Button */}
|
||||||
<div className='h-10 w-36 rounded-full bg-gray-300 dark:bg-gray-800' />
|
{withJoinAction && (
|
||||||
|
<div className='h-10 w-36 rounded-full bg-gray-300 dark:bg-gray-800' />
|
||||||
|
)}
|
||||||
</HStack>
|
</HStack>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,7 +19,7 @@ const MyGroupsPanel = () => {
|
||||||
>
|
>
|
||||||
{isFetching ? (
|
{isFetching ? (
|
||||||
new Array(3).fill(0).map((_, idx) => (
|
new Array(3).fill(0).map((_, idx) => (
|
||||||
<PlaceholderGroupSearch key={idx} />
|
<PlaceholderGroupSearch key={idx} withJoinAction={false} />
|
||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
groups.slice(0, 3).map((group) => (
|
groups.slice(0, 3).map((group) => (
|
||||||
|
|
|
@ -19,7 +19,7 @@ const SuggestedGroupsPanel = () => {
|
||||||
>
|
>
|
||||||
{isFetching ? (
|
{isFetching ? (
|
||||||
new Array(3).fill(0).map((_, idx) => (
|
new Array(3).fill(0).map((_, idx) => (
|
||||||
<PlaceholderGroupSearch key={idx} />
|
<PlaceholderGroupSearch key={idx} withJoinAction={false} />
|
||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
groups.slice(0, 3).map((group) => (
|
groups.slice(0, 3).map((group) => (
|
||||||
|
|
Loading…
Reference in New Issue