Profile.tsx 4.29 KB
Newer Older
Lee SeoYeon's avatar
.    
Lee SeoYeon committed
1
import React, { useState } from "react";
2
import { useNavigate } from "react-router-dom";
Lee SeoYeon's avatar
.    
Lee SeoYeon committed
3
import { SurveyType } from "../types";
Yoon, Daeki's avatar
Yoon, Daeki committed
4
5

export const Profile = () => {
6
  const navigate = useNavigate();
Lee SeoYeon's avatar
.    
Lee SeoYeon committed
7
8
9
10
11
12
13
14
15
16
17
18
19
  // const [Ssurvey, setSsurvey] = useState<SurveyType>({
  //   title: "",
  //   comment: "",
  //   //questions 는 _id들의 배열
  //   questions: [],
  // });

  // function handleAnswer(event: React.ChangeEvent<HTMLInputElement>) {
  //   setSsurvey({
  //     ...survey,
  //     [event.currentTarget.name]: event.currentTarget.value,
  //   })
  // }
20
21
22
23
24
25

  const createSurvey = () => {
    // 먼저 서버에 survey 테이블에 새로운 survey 항목 추가 로직 필요
    navigate("/surveys/create", { replace: true });
  };

Lee SeoYeon's avatar
Lee SeoYeon committed
26
  return (
Lee SeoYeon's avatar
0708    
Lee SeoYeon committed
27
28
    <div className="flex flex-col items-center">
      <div className="m-5">나의 설문조사</div>
Lee SeoYeon's avatar
Lee SeoYeon committed
29
      <div className="flex flex-row space-x-4 mt-5">
30
31
        <button
          onClick={createSurvey}
Lee SeoYeon's avatar
Lee SeoYeon committed
32
33
34
35
36
          className="flex h-60 w-48 items-center border-2 border-themeColor font-bold bg-gray-200 hover:bg-themeColor rounded-lg "
        >
          <div className="text-center px-6 py-6 font-bold text-gray-500 place-items-center hover:text-white">
            CREATE NEW SURVEY!
          </div>
37
        </button>
Lee SeoYeon's avatar
Lee SeoYeon committed
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
        <div className="w-48 h-60 rounded overflow-hidden border-2">
          <div className="px-6 py-4">
            <p className="text-gray-700 text-base">
              Lorem ipsum dolor sit amet, consectetur adipisicing elit.
            </p>
          </div>
          <div className="flex flex-col py-6">
            <div className="px-2 py-2">
              <label>설문조사 이름</label>
            </div>
            <div className="flex justify-end dropdown-toggle">
              <select className="py-2 w-14 bg-themeColor rounded text-white">
                <option selected>옵션</option>
                <option>삭제</option>
                <option>이름 바꾸기</option>
              </select>
            </div>
          </div>
        </div>
        <div className="w-48 h-60 rounded overflow-hidden border-2">
          <div className="px-6 py-4">
            <p className="text-gray-700 text-base">
              Lorem ipsum dolor sit amet, consectetur adipisicing elit.
            </p>
          </div>
          <div className="flex flex-col py-6">
            <div className="px-2 py-2">
              <label>설문조사이름</label>
            </div>
            <div className="flex justify-end dropdown-toggle">
              <select className="py-2 w-14 bg-themeColor rounded text-white">
                <option selected>옵션</option>
                <option>삭제</option>
                <option>이름 바꾸기</option>
              </select>
            </div>
          </div>
        </div>
        <div className="w-48 h-60 rounded overflow-hidden border-2">
          <div className="px-6 py-4">
            <p className="text-gray-700 text-base">
              Lorem ipsum dolor sit amet, consectetur adipisicing elit.
            </p>
          </div>
          <div className="flex flex-col py-6">
            <div className="px-2 py-2">
              <label>설문조사 이름</label>
            </div>
            <div className="flex justify-end dropdown-toggle">
              <select className="py-2 w-14 bg-themeColor rounded text-white">
                <option selected>옵션</option>
                <option>삭제</option>
                <option>이름 바꾸기</option>
              </select>
            </div>
          </div>
        </div>
        <div className="w-48 h-60 rounded overflow-hidden border-2">
          <div className="px-6 py-4">
            <p className="text-gray-700 text-base">
              Lorem ipsum dolor sit amet, consectetur adipisicing elit.
            </p>
          </div>
          <div className="flex flex-col py-6">
            <div className="px-2 py-2">
              <label>설문조사 이름</label>
            </div>
            <div className="flex justify-end dropdown-toggle">
              <select className="py-2 w-14 bg-themeColor rounded text-white">
                <option selected>옵션</option>
                <option>삭제</option>
                <option>이름 바꾸기</option>
              </select>
            </div>
          </div>
        </div>
      </div>
    </div>
  );
Yoon, Daeki's avatar
Yoon, Daeki committed
117
};