Skip to content

Commit

Permalink
Created PalleteItem Component
Browse files Browse the repository at this point in the history
  • Loading branch information
j-barreiros committed Jan 7, 2023
1 parent a21384d commit 09e6dea
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/components/PalleteDisplay/PalleteItem/PalleteItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Style
import { PalleteType } from "../../../context/PalletesContext";
import ColorStripe from "./ColorStripe/ColorStripe";
import StyledPalleteItem from "./StyledPalleteItem";

type PalleteItemProps = {
pallete: PalleteType;
}

const PalleteItem = ({pallete} : PalleteItemProps) => {
const {color1, color2, color3, color4} = pallete;
return (
<StyledPalleteItem>
<section className='color-box'>
<ColorStripe colorValue={color1} />
<ColorStripe colorValue={color2} />
<ColorStripe colorValue={color3} />
<ColorStripe colorValue={color4} />
</section>
<section className='pallete-info'>
<button className='like-btn'>
Like
</button>

<p className='pallete-date'>3 weeks ago</p>
</section>
</StyledPalleteItem>
)
}

export default PalleteItem;
14 changes: 14 additions & 0 deletions src/components/PalleteDisplay/PalleteItem/StyledPalleteItem.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import styled from "styled-components";

const StyledPalleteItem = styled.article`
width: 20vw;
height: 200px;
background-color: red;
.color-box {
overflow: auto;
display: grid;
grid-template-rows: 70px 50px 30px 30px;
}
`

export default StyledPalleteItem;

0 comments on commit 09e6dea

Please sign in to comment.