Admin.js 6.66 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';
kusang96's avatar
kusang96 committed
6
import { Row, Form, FormControl, Button, Card, Container } from 'react-bootstrap';
Kim, Subin's avatar
Kim, Subin committed
7
8

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

    function handleSubmit(e) {
        e.preventDefault()
17
    }
Kim, Subin's avatar
Kim, Subin committed
18
19
20

    return (
        <div>
21
22
23
24
25
26
27
28
29
30
31
32
33
            <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
34
35
            <MainNav />
            <SubNav />
Jiwon Yoon's avatar
Jiwon Yoon committed
36
            <Container>
kusang96's avatar
kusang96 committed
37
38
                <Row as={Form} onSubmit={handleSubmit} className="justify-content-end mx-0 my-5">
                    <FormControl type="text" placeholder="Search" style={{ width: "13rem" }} />
39
                    <Button type="submit" className="px-2">
40
                        <img src={search} width="20" height="20" />
Kim, Subin's avatar
Kim, Subin committed
41
                    </Button>
Jiwon Yoon's avatar
Jiwon Yoon committed
42
                    <Button sm={2} xs={6} type="button" href="/regist" className="ml-1">상품 등록</Button>
kusang96's avatar
kusang96 committed
43
44
45
46
47
48
49
50
                </Row>
                <Row className="justify-content-start m-5">
                    <Card className="mt-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" }} />
                        <Card.Body>
                            <Card.Title>케이시앵글부츠(SH)</Card.Title>
                            <Card.Text>
                                재고: 8<br />
51
                            구매자 : 10
52
                        </Card.Text>
kusang96's avatar
kusang96 committed
53
54
55
56
57
58
59
60
61
                            <Button className="float-right" onClick={(e) => handleClick(e)}>삭제</Button>
                        </Card.Body>
                    </Card>
                    <Card className="mt-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" }} />
                        <Card.Body>
                            <Card.Title>메리제인플랫(SH)</Card.Title>
                            <Card.Text>
                                재고: 20<br />
62
                            구매자 : 60
63
                        </Card.Text>
kusang96's avatar
kusang96 committed
64
65
66
67
68
69
70
71
72
                            <Button className="float-right" onClick={(e) => handleClick(e)}>삭제</Button>
                        </Card.Body>
                    </Card>
                    <Card className="mt-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" }} />
                        <Card.Body>
                            <Card.Title>솔티드스니커즈(SH)</Card.Title>
                            <Card.Text>
                                재고: 34<br />
73
                            구매자 : 5
74
                        </Card.Text>
kusang96's avatar
kusang96 committed
75
76
77
78
79
80
81
82
83
                            <Button className="float-right" onClick={(e) => handleClick(e)}>삭제</Button>
                        </Card.Body>
                    </Card>
                    <Card className="mt-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" }} />
                        <Card.Body>
                            <Card.Title>버켄슬리퍼(SH)</Card.Title>
                            <Card.Text>
                                재고: 50<br />
84
85
                            구매자 : 18
                        </Card.Text>
kusang96's avatar
kusang96 committed
86
87
88
89
90
91
92
93
94
                            <Button className="float-right" onClick={(e) => handleClick(e)}>삭제</Button>
                        </Card.Body>
                    </Card>
                    <Card className="mt-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" }} />
                        <Card.Body>
                            <Card.Title>크레센도 하이힐펌프스</Card.Title>
                            <Card.Text>
                                재고: 35<br />
95
                            구매자 : 70
96
                        </Card.Text>
kusang96's avatar
kusang96 committed
97
98
99
100
101
102
103
104
105
                            <Button className="float-right" onClick={(e) => handleClick(e)}>삭제</Button>
                        </Card.Body>
                    </Card>
                    <Card className="mt-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" }} />
                        <Card.Body>
                            <Card.Title>어텀솔져1cm 스웨이드로퍼</Card.Title>
                            <Card.Text>
                                재고: 40<br />
106
                            구매자 : 30
107
                        </Card.Text>
kusang96's avatar
kusang96 committed
108
109
110
111
112
113
114
115
116
                            <Button className="float-right" onClick={(e) => handleClick(e)}>삭제</Button>
                        </Card.Body>
                    </Card>
                    <Card className="mt-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" }} />
                        <Card.Body>
                            <Card.Title>포웰3.5cm 스니커즈</Card.Title>
                            <Card.Text>
                                재고: 15<br />
117
                            구매자 : 50
118
                        </Card.Text>
kusang96's avatar
kusang96 committed
119
120
121
122
123
                            <Button className="float-right" onClick={(e) => handleClick(e)}>삭제</Button>
                        </Card.Body>
                    </Card>
                </Row>
                <Pagination />
Jiwon Yoon's avatar
Jiwon Yoon committed
124
            </Container>
Kim, Subin's avatar
Kim, Subin committed
125
        </div>
Kim, Subin's avatar
Kim, Subin committed
126

Kim, Subin's avatar
Kim, Subin committed
127
128
129
130
    )
}

export default Admin