board.tsx 2.02 KB
Newer Older
Lee Soobeom's avatar
Lee Soobeom committed
1
import React, {useState} from "react";
Lee Soobeom's avatar
Lee Soobeom committed
2
3
4
5
6
7

function range(start:number, end:number) {
    return (new Array(end - start + 1)).fill(undefined).map((_, i) => i + start);
}

export default function BoardPage() {
Lee Soobeom's avatar
Lee Soobeom committed
8
    const ords = range(0,4); //[0,1,2,3,4];
Lee Soobeom's avatar
Lee Soobeom committed
9
10
    const [count, setCount] = useState(0);

Lee Soobeom's avatar
Lee Soobeom committed
11
12
    const fakes = [['Seoul', '2022-06-30', '0'], ['Jeju', '2022-9-10', '1'], ['Busan', '2022-9-22', '2'], ['Daegu', '2022-10-1', '3'], ['Incheon', '2022-12-12','4'],];
    
백승민's avatar
theme1    
백승민 committed
13
    return (
Lee Soobeom's avatar
Lee Soobeom committed
14
15
16
17
18
19
20
21
22
        <div className="flex flex-col items-center">
            <div className="flex flex-col items-center mt-6">
                <div>
                    `Travel Report's Board`
                </div>
                <div>
                    `여행지 후기를 남겨주세요!`
                </div>
            </div>
Lee Soobeom's avatar
Lee Soobeom committed
23

Lee Soobeom's avatar
Lee Soobeom committed
24
25
            <div className="flex flex-col w-10/12 mt-16 ">
                <div>
Lee Soobeom's avatar
Lee Soobeom committed
26
27
28
29
30
                    <div className="flex flex-row divide-x-2 border-2 border-solid bg-gray-500 border-y-2 h-10 ">
                                <div className="basis-1/12">No.</div>
                                <div className="basis-full">Title</div>
                                <div className="basis-3/12">Date</div>
                                <div className="basis-2/12">Clicks</div>
Lee Soobeom's avatar
Lee Soobeom committed
31
32
                    </div>
                    <div>
Lee Soobeom's avatar
Lee Soobeom committed
33
                        {ords.map((ord, index) => (
Kim, MinGyu's avatar
Kim, MinGyu committed
34
                            <div key={index} className="flex flex-row h-16 divide-x-2 border-2 border-solid ">
Lee Soobeom's avatar
Lee Soobeom committed
35
36
37
                                <div className="basis-1/12 bg-gray-100">{ord + 1}</div>
                                <div className="basis-full"><button onClick={() => setCount(count + 1)}>{fakes[ord][0]}</button></div> {/*<Link to>title</Link> */}
                                <div className="basis-3/12">{fakes[ord][1]}</div>
Lee Soobeom's avatar
Lee Soobeom committed
38
                                <div className="basis-2/12">{count}</div>
Lee Soobeom's avatar
Lee Soobeom committed
39
40
41
42
43
44
                            </div>
                        ))}
                    </div>
                </div>
            </div>
        </div>
백승민's avatar
theme1    
백승민 committed
45
    );
Lee Soobeom's avatar
Lee Soobeom committed
46
}