Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion resources/js/components/follow-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ export function FollowButton({
<Button
variant={isFollowing ? 'outline' : 'default'}
size={size}
className={cn('group/follow', className)}
className={cn(
'group/follow disabled:pointer-events-auto',
className,
)}
asChild
>
<Link
Expand Down
12 changes: 12 additions & 0 deletions tests/Unit/FollowState.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,18 @@ test('a suggestion who follows you offers to follow back, at a width that fits i
assert.equal(suggestionLabel(suggestion('jess')), 'Follow @jess');
});

test('a pending follow keeps the pointer on it, so it says Following under it instead of Unfollow', () => {
const button = FollowButton({
user: suggestion('taylor'),
isFollowing: false,
}) as ReactElement<Props>;

assert.match(
String(button.props.className),
/\bdisabled:pointer-events-auto\b/,
);
});

test('a follow from their profile shows in who to follow', () => {
const user = suggestion('taylor');

Expand Down
Loading