ADD: Components
Teaser, Card
This commit is contained in:
parent
8943512328
commit
c8e4bf4a14
8 changed files with 127 additions and 48 deletions
|
@ -1,3 +1,11 @@
|
|||
type Size = '1x' | '2x' | '3x'
|
||||
const allSizes : Size[] = ['1x', '2x', '3x']
|
||||
|
||||
export const getImage =
|
||||
(path: string, img: string) => (size: "1x" | "2x" | "3x", set: boolean) =>
|
||||
`${path}${img}@${size}.webp${set ? ` ${size}` : ""}`;
|
||||
(path: string, img: string) => (size: Size, set: boolean) =>
|
||||
`${path}${img}@${size}.webp${set ? ` ${size}` : ''}`;
|
||||
|
||||
export const getImageSet = (path: string, img: string) =>
|
||||
allSizes.map((size) => getImage(path, img)(size, true))
|
||||
|
||||
export const getInitialImage = (path: string, img: string) => getImage(path, img)('1x', false)
|
Loading…
Add table
Add a link
Reference in a new issue