-
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
6 changed files
with
86 additions
and
41 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,26 @@ | ||
import { Product } from "src/types/product"; | ||
|
||
export const stylePrice: React.CSSProperties = { | ||
borderRadius: 50, | ||
backgroundColor: "white", | ||
fontSize: "12px", | ||
display: "flex", | ||
alignItems: "center", | ||
padding: "5px", | ||
border: "grey 1px solid", | ||
}; | ||
|
||
const imageSize = 218; | ||
|
||
export const getImageStyle = (product: Product, tiny: boolean) => { | ||
const style: React.CSSProperties = { | ||
height: imageSize, | ||
width: tiny ? "" : imageSize, | ||
backgroundImage: `url(${product.previewImageUrl})`, | ||
backgroundSize: "cover", | ||
display: "flex", | ||
alignItems: "flex-end", | ||
justifyContent: "center", | ||
}; | ||
return style; | ||
}; |
26 changes: 10 additions & 16 deletions
26
src/components/ui/Cards/ProductCardImage/ProductCardImage.tsx
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
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