Skip to content

Commit

Permalink
section component
Browse files Browse the repository at this point in the history
  • Loading branch information
eltonlazzarin committed Aug 19, 2020
1 parent 998455a commit 9217bac
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions src/components/Section/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React from 'react';

import {
Container,
HeaderWrapper,
Header,
DropboxLogo,
Content,
} from './styles';

interface Props {
variant: 'blue' | 'beige' | 'white' | 'black';
title: string;
description: string;
}

const Section: React.FC<Props> = ({ variant, title, description }) => {
const buttonVariant = Math.round(Math.random());

function handleToggle() {
if (window.toggleActiveMenu) window.toggleActiveMenu();
}

return (
<Container className={variant}>
<HeaderWrapper>
<Header>
<h1>
<DropboxLogo />
<span>Dropbox</span>
</h1>

<button onClick={handleToggle}>
{buttonVariant === 0 ? 'Sign in' : 'Sign up'}
</button>
</Header>
</HeaderWrapper>

<Content>
<h2>{title}</h2>
<p>{description}</p>
</Content>
</Container>
);
};

export default Section;

0 comments on commit 9217bac

Please sign in to comment.