EditResultButton.tsx 2.13 KB
Newer Older
1
import React from "react";
jang dong hyeok's avatar
.    
jang dong hyeok committed
2
import { NavLink } from "react-router-dom";
3
4
import { Outlet, useNavigate, useParams } from "react-router-dom";

5
export const EditResultButton = () => {
6
7
8
9
10
  let { surveyId } = useParams<{ surveyId: string }>();
  const navigate = useNavigate();

  return (
    <div>
jang dong hyeok's avatar
jang dong hyeok committed
11
      <div className="flex place-content-center mt-6">
jang dong hyeok's avatar
.    
jang dong hyeok committed
12
        <NavLink
Jiwon Yoon's avatar
Jiwon Yoon committed
13
          to={`/surveys/${surveyId}/edit`}
jang dong hyeok's avatar
.    
jang dong hyeok committed
14
          style={({ isActive }) =>
jang dong hyeok's avatar
jang dong hyeok committed
15
16
            isActive
              ? {
jang dong hyeok's avatar
jang dong hyeok committed
17
                  width: "140px",
jang dong hyeok's avatar
jang dong hyeok committed
18
                  color: "white",
jang dong hyeok's avatar
jang dong hyeok committed
19
                  backgroundColor: "#008080",
jang dong hyeok's avatar
jang dong hyeok committed
20
21
22
23
24
                  borderTopLeftRadius: "25px",
                  borderBottomLeftRadius: "25px",
                  textAlign: "center",
                  fontWeight: "bold",
                  fontSize: "20px",
jang dong hyeok's avatar
jang dong hyeok committed
25
26
                }
              : {
jang dong hyeok's avatar
jang dong hyeok committed
27
28
                  width: "140px",
                  borderWidth: "1px",
jang dong hyeok's avatar
jang dong hyeok committed
29
                  borderColor: "#008080",
jang dong hyeok's avatar
jang dong hyeok committed
30
31
32
33
                  borderTopLeftRadius: "25px",
                  borderBottomLeftRadius: "25px",
                  textAlign: "center",
                  fontSize: "18px",
jang dong hyeok's avatar
jang dong hyeok committed
34
                }
jang dong hyeok's avatar
.    
jang dong hyeok committed
35
          }
36
        >
jang dong hyeok's avatar
jang dong hyeok committed
37
          <div className="m-3 ">설문지 수정</div>
jang dong hyeok's avatar
.    
jang dong hyeok committed
38
39
        </NavLink>
        <NavLink
Jiwon Yoon's avatar
Jiwon Yoon committed
40
          to={`/surveys/${surveyId}/result`}
jang dong hyeok's avatar
.    
jang dong hyeok committed
41
          style={({ isActive }) =>
jang dong hyeok's avatar
jang dong hyeok committed
42
43
            isActive
              ? {
jang dong hyeok's avatar
jang dong hyeok committed
44
                  width: "140px",
jang dong hyeok's avatar
jang dong hyeok committed
45
                  color: "white",
jang dong hyeok's avatar
jang dong hyeok committed
46
                  backgroundColor: "#008080",
jang dong hyeok's avatar
jang dong hyeok committed
47
48
49
50
51
                  borderTopRightRadius: "25px",
                  borderBottomRightRadius: "25px",
                  textAlign: "center",
                  fontWeight: "bold",
                  fontSize: "20px",
jang dong hyeok's avatar
jang dong hyeok committed
52
53
                }
              : {
jang dong hyeok's avatar
jang dong hyeok committed
54
55
                  width: "140px",
                  borderWidth: "1px",
jang dong hyeok's avatar
jang dong hyeok committed
56
                  borderColor: "#008080",
jang dong hyeok's avatar
jang dong hyeok committed
57
58
59
60
                  borderTopRightRadius: "25px",
                  borderBottomRightRadius: "25px",
                  textAlign: "center",
                  fontSize: "18px",
jang dong hyeok's avatar
jang dong hyeok committed
61
                }
jang dong hyeok's avatar
.    
jang dong hyeok committed
62
          }
63
        >
jang dong hyeok's avatar
jang dong hyeok committed
64
          <div className="m-3">응답결과</div>
jang dong hyeok's avatar
.    
jang dong hyeok committed
65
        </NavLink>
66
67
68
69
70
      </div>
      <Outlet />
    </div>
  );
};