Skip to content

Commit

Permalink
Changes to be committed:
Browse files Browse the repository at this point in the history
	modified:   client/src/components/Image.tsx
	modified:   client/src/pages/products/details.tsx
  • Loading branch information
Thith-thith committed Aug 7, 2023
1 parent 64a816c commit 3e11bb6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
21 changes: 12 additions & 9 deletions client/src/components/Image.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import { Component } from "solid-js";

export type Image = {
image: String;
name: String;
width: String;
heigh: String;
is_scale: Boolean;
image: string;
name: string;
width: string;
heigh: string;
is_scale: boolean;
};

const Image: Component<Image> = (props) => {
const { image, name, width, heigh, is_scale } = props;
return (
<div class="aspect-h-4 aspect-w-3 hidden overflow-hidden rounded-lg lg:block">
<div class="aspect-h-4 aspect-w-3 hidden overflow-hidden rounded-lg lg:block border mx-auto">
<img
src="https://tailwindui.com/img/ecommerce-images/product-page-02-tertiary-product-shot-01.jpg"
alt="Two each of gray, white, and black shirts laying flat."
class="h-full w-full object-cover object-center hover:scale-125 duration-150"
src={image}
alt={name}
class={` mx-auto h-auto w-2/3 object-cover object-center ${
is_scale && " hover:scale-125 duration-150"
}`}
/>
</div>
);
Expand Down
8 changes: 4 additions & 4 deletions client/src/pages/products/details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,30 +95,30 @@ const ProductDetail: Component<{}> = (props) => {

<div class="mx-auto mt-6 max-w-2xl sm:px-6 lg:grid lg:max-w-7xl lg:grid-cols-3 lg:gap-x-4 lg:px-8">
<Image
image="https://tailwindui.com/img/ecommerce-images/product-page-02-tertiary-product-shot-01.jpg"
image="/products/product1.png"
name="undefined"
width="undefined"
heigh="undefined"
is_scale={true}
/>
<div class="hidden lg:grid lg:grid-cols-1 lg:gap-y-4">
<Image
image="https://tailwindui.com/img/ecommerce-images/product-page-02-tertiary-product-shot-01.jpg"
image="/products/product1.png"
name="undefined"
width="undefined"
heigh="undefined"
is_scale={true}
/>
<Image
image="https://tailwindui.com/img/ecommerce-images/product-page-02-tertiary-product-shot-01.jpg"
image="/products/product1.png"
name="undefined"
width="undefined"
heigh="undefined"
is_scale={true}
/>
</div>
<Image
image="https://tailwindui.com/img/ecommerce-images/product-page-02-tertiary-product-shot-01.jpg"
image="/products/product1.png"
name="undefined"
width="undefined"
heigh="undefined"
Expand Down

0 comments on commit 3e11bb6

Please sign in to comment.