Skip to content

Commit

Permalink
feat: adds UI for the subscription form
Browse files Browse the repository at this point in the history
  • Loading branch information
jongomez committed Oct 23, 2023
1 parent 0e141c6 commit 4944e7b
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions src/components/EmailSubscribe/EmailSubscribe.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { Button, Typography } from '@acid-info/lsd-react'
import styled from '@emotion/styled'

type EmailSubscribeProps = React.HTMLAttributes<HTMLDivElement> & {
onSubmit?: (e: React.FormEvent<HTMLFormElement>) => void
}

export const EmailSubscribe = ({ onSubmit, ...props }: EmailSubscribeProps) => {
return (
<EmailSubscribeContainer {...props}>
<Typography
variant="h6"
component="label"
htmlFor="email"
style={{
marginBottom: '24px',
}}
>
Subscribe for updates
</Typography>

<EmailSubscribeForm onSubmit={onSubmit}>
<EmailSubscribeInput
type="email"
id="email"
name="email"
placeholder="Email address"
/>

<Button
variant="filled"
type="submit"
style={{ height: '40px', width: '162px' }}
>
Subscribe
</Button>
</EmailSubscribeForm>
</EmailSubscribeContainer>
)
}

const EmailSubscribeContainer = styled.div`
display: flex;
flex-direction: column;
border-block: 1px solid rgb(var(--lsd-border-primary));
padding: 24px 0px;
margin-top: 24px;
`

const EmailSubscribeForm = styled.form`
display: flex;
gap: 16px;
width: 100%;
`

const EmailSubscribeInput = styled.input`
padding: 0;
padding-left: 18px;
box-sizing: border-box;
border: 1px solid rgb(var(--lsd-border-primary));
height: 40px;
width: 100%;
&:focus {
outline: none;
}
`

0 comments on commit 4944e7b

Please sign in to comment.