-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { FiTrash2 } from 'react-icons/fi'; | ||
|
||
import Button from '../button'; | ||
|
||
import { | ||
Buttons, | ||
Container, | ||
Content, | ||
Image, | ||
Price, | ||
Prices, | ||
Title, | ||
} from './style'; | ||
|
||
interface CardProps { | ||
thumbnail?: string; | ||
} | ||
|
||
export default function Card({ thumbnail }: CardProps) { | ||
return ( | ||
<Container onClick={() => console.log('Card clicked!')}> | ||
<Image src={thumbnail} alt="" srcSet={thumbnail} /> | ||
<Content> | ||
<Title>Product</Title> | ||
<Prices> | ||
<Price>100</Price> | ||
<Price>40</Price> | ||
</Prices> | ||
</Content> | ||
<Buttons style={{ justifyContent: 'flex-end' }}> | ||
<Button color="#F80059"> | ||
<FiTrash2 color="#FFF" /> | ||
</Button> | ||
<Button | ||
onClick={(e) => { | ||
console.log('Button clicked!'); | ||
}} | ||
> | ||
Editar | ||
</Button> | ||
</Buttons> | ||
</Container> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Container = styled.div` | ||
background: #ffffff; | ||
border-radius: 8px; | ||
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.06); | ||
max-width: 360px; | ||
padding: 16px; | ||
`; | ||
export const Image = styled.img` | ||
border-radius: 8px; | ||
object-fit: cover; | ||
height: 240px; | ||
width: 100%; | ||
`; | ||
export const Title = styled.p` | ||
font-style: normal; | ||
font-weight: 600; | ||
font-size: 20px; | ||
line-height: 100%; | ||
`; | ||
export const Content = styled.div``; | ||
export const Footer = styled.div``; | ||
export const Prices = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: flex-end; | ||
`; | ||
export const Price = styled.span` | ||
&::before { | ||
content: 'R$ '; | ||
color: 'green'; | ||
font-weight: 600; | ||
} | ||
`; | ||
export const Buttons = styled.div` | ||
display: flex; | ||
gap: 8px; | ||
`; |