Preview.tsx 2.12 KB
Newer Older
Yoon, Daeki's avatar
Yoon, Daeki committed
1
import React from "react";
Yoon, Daeki's avatar
Yoon, Daeki committed
2
3
import { NavLink } from "react-router-dom";
import { Outlet, useNavigate, useParams } from "react-router-dom";
Yoon, Daeki's avatar
Yoon, Daeki committed
4
5

export const Preview = () => {
Yoon, Daeki's avatar
Yoon, Daeki committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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
  let { surveyId } = useParams<{ surveyId: string }>();
  const navigate = useNavigate();

  return (
    <div>
      <div className="flex place-content-center mt-6">
        <NavLink
          to={`/surveys/${surveyId}/edit`}
          style={({ isActive }) =>
            isActive
              ? {
                  width: "140px",
                  color: "white",
                  backgroundColor: "#008080",
                  borderTopLeftRadius: "25px",
                  borderBottomLeftRadius: "25px",
                  textAlign: "center",
                  fontWeight: "bold",
                  fontSize: "20px",
                }
              : {
                  width: "140px",
                  borderWidth: "1px",
                  borderColor: "#008080",
                  borderTopLeftRadius: "25px",
                  borderBottomLeftRadius: "25px",
                  textAlign: "center",
                  fontSize: "18px",
                }
          }
        >
          <div className="m-3 ">설문지 수정</div>
        </NavLink>
        <NavLink
          to={`/surveys/${surveyId}/result`}
          style={({ isActive }) =>
            isActive
              ? {
                  width: "140px",
                  color: "white",
                  backgroundColor: "#008080",
                  borderTopRightRadius: "25px",
                  borderBottomRightRadius: "25px",
                  textAlign: "center",
                  fontWeight: "bold",
                  fontSize: "20px",
                }
              : {
                  width: "140px",
                  borderWidth: "1px",
                  borderColor: "#008080",
                  borderTopRightRadius: "25px",
                  borderBottomRightRadius: "25px",
                  textAlign: "center",
                  fontSize: "18px",
                }
          }
        >
          <div className="m-3">응답결과</div>
        </NavLink>
      </div>
      <Outlet />
    </div>
  );
Yoon, Daeki's avatar
Yoon, Daeki committed
70
};