Admin.js 6.31 KB
Newer Older
Kim, Subin's avatar
Kim, Subin committed
1
import React, { useState, useEffect, useRef } from 'react';
Kim, Subin's avatar
Kim, Subin committed
2
3
import MainNav from '../Components/MainNav';
import SubNav from '../Components/SubNav';
Kim, Subin's avatar
Kim, Subin committed
4
5
import Pagination from '../Components/Pagination';
import search from '../search.svg';
6
import { Row, Col, Form, FormControl, Button, Card } from 'react-bootstrap';
Kim, Subin's avatar
Kim, Subin committed
7
8

function Admin() {
Kim, Subin's avatar
Kim, Subin committed
9
10
11
12
13
    function handleClick(e) {
        const card = e.target.parentNode.parentNode
        console.log(card)
        alert('해당 상품을 성공적으로 삭제하였습니다.')
    }
Kim, Subin's avatar
Kim, Subin committed
14
15
16

    return (
        <div>
Kim, Subin's avatar
Kim, Subin committed
17
18
19
20
21
22
23
24
25
26
27
28
29
            <style type="text/css">
                {`
                .btn {
                    background-color: #CDC5C2;
                    border-color: #CDC5C2;
                }

                .btn:hover, .btn:active, .btn:focus {
                    background-color: #91877F;
                    border-color: #91877F;
                }
                `}
            </style>
Kim, Subin's avatar
Kim, Subin committed
30
31
            <MainNav />
            <SubNav />
Kim, Subin's avatar
Kim, Subin committed
32
33
            <Row className="justify-content-end mt-5 mr-3 mb-5">
                <Col as={Form} inline className="justify-content-end">
Kim, Subin's avatar
Kim, Subin committed
34
                    <FormControl type="text" placeholder="Search" className="mr-1" />
Kim, Subin's avatar
Kim, Subin committed
35
                    <Button type="submit" className="px-2">
36
                        <img src={search} width="20" height="20" />
Kim, Subin's avatar
Kim, Subin committed
37
38
                    </Button>
                </Col>
Kim, Subin's avatar
Kim, Subin committed
39
                <Col sm={2} xs={3} as={Button} type="button" href="/regist">상품 등록</Col>
Kim, Subin's avatar
Kim, Subin committed
40
            </Row>
Kim, Subin's avatar
Kim, Subin committed
41
42
43
            <Row className="justify-content-start m-5">
                <Card className="my-5" style={{ width: "18rem", margin: "auto"}}>
                    <Card.Img variant="top" src="https://img.sonyunara.com/files/goods/67460/1607053816_0.jpg" style={{ objectFit: "contain", height: "22rem" }} />
Kim, Subin's avatar
Kim, Subin committed
44
                    <Card.Body>
45
                        <Card.Title>케이시앵글부츠(SH)</Card.Title>
Kim, Subin's avatar
Kim, Subin committed
46
                        <Card.Text>
Kim, Subin's avatar
Kim, Subin committed
47
                            재고: 8<br />
48
                            구매자 : 10
Kim, Subin's avatar
Kim, Subin committed
49
50
                        </Card.Text>
                        <Button className="float-right" onClick={(e) => handleClick(e)}>삭제</Button>
Kim, Subin's avatar
Kim, Subin committed
51
52
                    </Card.Body>
                </Card>
Kim, Subin's avatar
Kim, Subin committed
53
54
                <Card className="my-5" style={{ width: "18rem", margin: "auto"}}>
                    <Card.Img variant="top" src="https://img.sonyunara.com/files/goods/48705/1552562469_0.jpg" style={{ objectFit: "contain", height: "22rem" }} />
Kim, Subin's avatar
Kim, Subin committed
55
                    <Card.Body>
56
                        <Card.Title>메리제인플랫(SH)</Card.Title>
Kim, Subin's avatar
Kim, Subin committed
57
                        <Card.Text>
Kim, Subin's avatar
Kim, Subin committed
58
                            재고: 20<br />
59
                            구매자 : 60
Kim, Subin's avatar
Kim, Subin committed
60
61
                        </Card.Text>
                        <Button className="float-right" onClick={(e) => handleClick(e)}>삭제</Button>
Kim, Subin's avatar
Kim, Subin committed
62
63
                    </Card.Body>
                </Card>
Kim, Subin's avatar
Kim, Subin committed
64
65
                <Card className="my-5" style={{ width: "18rem", margin: "auto"}}>
                    <Card.Img variant="top" src="https://img.sonyunara.com/files/goods/53386/1567390097_2.jpg" style={{ objectFit: "contain", height: "22rem" }} />
Kim, Subin's avatar
Kim, Subin committed
66
                    <Card.Body>
67
                        <Card.Title>솔티드스니커즈(SH)</Card.Title>
Kim, Subin's avatar
Kim, Subin committed
68
                        <Card.Text>
Kim, Subin's avatar
Kim, Subin committed
69
                            재고: 34<br />
70
                            구매자 : 5
Kim, Subin's avatar
Kim, Subin committed
71
72
                        </Card.Text>
                        <Button className="float-right" onClick={(e) => handleClick(e)}>삭제</Button>
Kim, Subin's avatar
Kim, Subin committed
73
74
                    </Card.Body>
                </Card>
Kim, Subin's avatar
Kim, Subin committed
75
76
                <Card className="my-5" style={{ width: "18rem", margin: "auto"}}>
                    <Card.Img variant="top" src="https://img.sonyunara.com/files/goods/61286/1587540563_0.jpg" style={{ objectFit: "contain", height: "22rem" }} />
Kim, Subin's avatar
Kim, Subin committed
77
                    <Card.Body>
78
                        <Card.Title>버켄슬리퍼(SH)</Card.Title>
Kim, Subin's avatar
Kim, Subin committed
79
                        <Card.Text>
Kim, Subin's avatar
Kim, Subin committed
80
81
82
83
                            재고: 50<br />
                            구매자 : 18
                        </Card.Text>
                        <Button className="float-right" onClick={(e) => handleClick(e)}>삭제</Button>
Kim, Subin's avatar
Kim, Subin committed
84
85
                    </Card.Body>
                </Card>
Kim, Subin's avatar
Kim, Subin committed
86
87
                <Card className="my-5" style={{ width: "18rem", margin: "auto"}}>
                    <Card.Img variant="top" src="https://hotping.co.kr/web/product/big/202011/b8f4c6471955b80fc3991b7d6df8926a.jpg" style={{ objectFit: "contain", height: "22rem" }} />
Kim, Subin's avatar
Kim, Subin committed
88
                    <Card.Body>
89
                        <Card.Title>크레센도 하이힐펌프스</Card.Title>
Kim, Subin's avatar
Kim, Subin committed
90
                        <Card.Text>
Kim, Subin's avatar
Kim, Subin committed
91
                            재고: 35<br />
92
                            구매자 : 70
Kim, Subin's avatar
Kim, Subin committed
93
94
                        </Card.Text>
                        <Button className="float-right" onClick={(e) => handleClick(e)}>삭제</Button>
Kim, Subin's avatar
Kim, Subin committed
95
96
                    </Card.Body>
                </Card>
Kim, Subin's avatar
Kim, Subin committed
97
98
                <Card className="my-5" style={{ width: "18rem", margin: "auto"}}>
                    <Card.Img variant="top" src="https://hotping.co.kr/web/product/big/202011/888e4e8d6a2c2e7da385b079151fcba2.jpg" style={{ objectFit: "contain", height: "22rem" }} />
Kim, Subin's avatar
Kim, Subin committed
99
                    <Card.Body>
100
                        <Card.Title>어텀솔져1cm 스웨이드로퍼</Card.Title>
Kim, Subin's avatar
Kim, Subin committed
101
                        <Card.Text>
Kim, Subin's avatar
Kim, Subin committed
102
                            재고: 40<br />
103
                            구매자 : 30
Kim, Subin's avatar
Kim, Subin committed
104
105
                        </Card.Text>
                        <Button className="float-right" onClick={(e) => handleClick(e)}>삭제</Button>
Kim, Subin's avatar
Kim, Subin committed
106
107
                    </Card.Body>
                </Card>
Kim, Subin's avatar
Kim, Subin committed
108
109
                <Card className="my-5" style={{ width: "18rem", margin: "auto"}}>
                    <Card.Img variant="top" src="https://hotping.co.kr/web/product/big/202007/3308564012eb14e6c11ed621fa7555fb.jpg" style={{ objectFit: "contain", height: "22rem" }} />
Kim, Subin's avatar
Kim, Subin committed
110
                    <Card.Body>
111
                        <Card.Title>포웰3.5cm 스니커즈</Card.Title>
Kim, Subin's avatar
Kim, Subin committed
112
                        <Card.Text>
Kim, Subin's avatar
Kim, Subin committed
113
                            재고: 15<br />
114
                            구매자 : 50
Kim, Subin's avatar
Kim, Subin committed
115
116
                        </Card.Text>
                        <Button className="float-right" onClick={(e) => handleClick(e)}>삭제</Button>
Kim, Subin's avatar
Kim, Subin committed
117
118
119
120
                    </Card.Body>
                </Card>
            </Row>
            <Pagination />
Kim, Subin's avatar
Kim, Subin committed
121
        </div>
Kim, Subin's avatar
Kim, Subin committed
122

Kim, Subin's avatar
Kim, Subin committed
123
124
125
126
    )
}

export default Admin