Skip to content

Commit

Permalink
perf(components): avoid Container unmount (#343)
Browse files Browse the repository at this point in the history
  • Loading branch information
JalilArfaoui authored Aug 29, 2019
1 parent 0874c63 commit e21c6e7
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/components/organisms/Contributor/ContributorButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@ interface Props {
followed?: boolean;
}

const ContributorButton = ({ followed }: Props) =>
followed ? (
<Container>
<BackgroundButton>Abonné</BackgroundButton>
</Container>
) : (
<Container>
<BorderButton>S&apos;abonner</BorderButton>
</Container>
);
const ContributorButton = ({ followed }: Props) => (
<Container>
{followed && <BackgroundButton>Abonné</BackgroundButton>}
{!followed && <BorderButton>S&apos;abonner</BorderButton>}
</Container>
);

export default ContributorButton;

0 comments on commit e21c6e7

Please sign in to comment.