@nethru/ui 1.0.73 → 1.0.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { Button, Stack } from "@mui/material";
1
+ import { Box, Button, Stack } from "@mui/material";
2
2
  import DialogContent from "@mui/material/DialogContent";
3
3
  import DialogContentText from "@mui/material/DialogContentText";
4
4
  import DialogActions from "@mui/material/DialogActions";
@@ -30,7 +30,11 @@ export default function AlertDialog({
30
30
  }
31
31
  }), /*#__PURE__*/_jsx(DialogContentText, {
32
32
  component: "div",
33
- children: /*#__PURE__*/_jsx("pre", {
33
+ children: /*#__PURE__*/_jsx(Box, {
34
+ component: "div",
35
+ sx: {
36
+ whiteSpace: 'pre-wrap'
37
+ },
34
38
  children: content.replace(/(\\n)/g, '\n')
35
39
  })
36
40
  })]
@@ -2,6 +2,7 @@ import { Box, Button, Paper, Stack, Typography } from "@mui/material";
2
2
  import CampaignIcon from '@mui/icons-material/Campaign';
3
3
  import { useNavigate } from "react-router-dom";
4
4
  import { variables } from "../variables";
5
+ import { useCallback } from "react";
5
6
  import { jsx as _jsx } from "react/jsx-runtime";
6
7
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
8
  export default function Error({
@@ -9,9 +10,13 @@ export default function Error({
9
10
  body,
10
11
  buttonText = '홈으로 가기',
11
12
  buttonHref = '/',
13
+ onClick,
12
14
  footer
13
15
  }) {
14
16
  const navigate = useNavigate();
17
+ const handleClick = useCallback(() => {
18
+ if (onClick) onClick();else navigate(buttonHref);
19
+ }, [navigate, buttonHref, onClick]);
15
20
  return /*#__PURE__*/_jsxs(Stack, {
16
21
  height: "100%",
17
22
  justifyContent: "center",
@@ -54,7 +59,7 @@ export default function Error({
54
59
  mt: 6,
55
60
  children: /*#__PURE__*/_jsx(Button, {
56
61
  size: "large",
57
- onClick: _ => navigate(buttonHref),
62
+ onClick: handleClick,
58
63
  children: buttonText
59
64
  })
60
65
  })]
@@ -8,11 +8,11 @@ export default function HttpError({
8
8
  let title, body;
9
9
  switch (code) {
10
10
  case '401':
11
- title = '요청을 완료할 없습니다.';
11
+ title = '계정 정보가 없습니다.';
12
12
  body = '유효한 계정 정보가 존재하지 않아 요청을 완료할 수 없습니다. 로그아웃 되었는지 확인후 다시 로그인 해주시기 바랍니다.';
13
13
  break;
14
14
  case '403':
15
- title = '요청을 완료할 없습니다.';
15
+ title = '요청 권한이 없습니다.';
16
16
  body = '유효한 계정 정보가 존재하지 않거나 권한이 없어 요청을 완료할 수 없습니다. 로그아웃 되었는지 확인후 다시 로그인 하거나 필요한 권한을 시스템 관리자에게 요청하시기 바랍니다.';
17
17
  break;
18
18
  case '404':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nethru/ui",
3
- "version": "1.0.73",
3
+ "version": "1.0.75",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "/dist"