ListCard.js 670 Bytes
Newer Older
이재연's avatar
0113    
이재연 committed
1
import React, { useState, useEffect, useRef } from 'react';
2
import { Card } from 'react-bootstrap';
이재연's avatar
0113    
이재연 committed
3

4
function ListCard({ id, name, price, main_img }) {
이재연's avatar
0113    
이재연 committed
5
6

    return (
7
8
        <Card id={id} className="mt-5" style={{ width: "18rem", margin: "auto" }}>
            <Card.Img variant="top" src={main_img && `/images/${main_img}`} style={{ objectFit: "contain", height: "22rem" }} />
이재연's avatar
0113    
이재연 committed
9
            <Card.Body>
10
11
                <Card.Title style={{ whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }}>{name}</Card.Title>
                <Card.Text>{price} </Card.Text>
이재연's avatar
0113    
이재연 committed
12
            </Card.Body>
13
        </Card>
이재연's avatar
0113    
이재연 committed
14
    )
이재연's avatar
zz    
이재연 committed
15
16
17
            }
   

이재연's avatar
0113    
이재연 committed
18
19

export default ListCard