@factorearth/component-library 6.6.4 → 6.6.5

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.
@@ -2,12 +2,10 @@ import React from "react";
2
2
  import { Colors } from "Theme/types";
3
3
  interface ErrorSplashProps {
4
4
  colorPalette: Colors & string;
5
- title: string;
6
- description: string;
7
- image?: string;
8
5
  backgroundImage: string;
9
- errorMessage?: string;
10
- refreshOnClick?: () => void;
6
+ onFAQ?: () => void;
7
+ onTryAgain?: () => void;
8
+ onReportBug?: () => void;
11
9
  }
12
10
  export declare const ErrorSplash: (props: ErrorSplashProps) => React.JSX.Element;
13
11
  export {};
@@ -1,7 +1,8 @@
1
1
  import React from "react";
2
2
  import styled from "@emotion/styled";
3
- import { FiRefreshCw } from "react-icons/fi";
3
+ import { FiRefreshCw, FiHelpCircle } from "react-icons/fi";
4
4
  import { Button } from "../../Atoms/Buttons/Button";
5
+ import { ReportABugButton } from "../../Atoms/Buttons/ReportABugButton";
5
6
  import { Typography } from "../../Atoms/Typography/Typography";
6
7
  const ErrorSplashContainer = styled.div `
7
8
  background-color: ${({ colorPalette }) => colorPalette.background.primary};
@@ -26,6 +27,14 @@ const DescriptionDiv = styled.div `
26
27
  margin-top: 24px;
27
28
  text-align: center;
28
29
  `;
30
+ const ActionsDiv = styled.div `
31
+ display: flex;
32
+ flex-direction: row;
33
+ flex-wrap: wrap;
34
+ justify-content: center;
35
+ gap: 12px;
36
+ margin-top: 16px;
37
+ `;
29
38
  const BackgroundDiv = styled.div `
30
39
  display: flex;
31
40
  height: 245px;
@@ -64,15 +73,17 @@ const ContactContainer = styled.div `
64
73
  align-self: stretch;
65
74
  `;
66
75
  export const ErrorSplash = (props) => {
67
- const { colorPalette, title, description, image, backgroundImage, errorMessage, refreshOnClick, ...tableHtmlProps } = props;
76
+ const { colorPalette, backgroundImage, onFAQ, onTryAgain, onReportBug, ...tableHtmlProps } = props;
68
77
  return (React.createElement(ErrorSplashContainer, { colorPalette: colorPalette, ...tableHtmlProps },
69
78
  React.createElement(HeaderDiv, { colorPalette: colorPalette },
70
- React.createElement(Typography, { textColor: colorPalette.text.primary, content: title, variant: "Heading 3" }),
79
+ React.createElement(Typography, { textColor: colorPalette.text.primary, content: "Oops something went wrong!", variant: "Heading 3" }),
71
80
  React.createElement(DescriptionDiv, { colorPalette: colorPalette },
72
- React.createElement(Typography, { textColor: colorPalette.text.primary, content: description, variant: "Paragraphy Body" }),
73
- React.createElement(Typography, { textColor: colorPalette.text.primary, content: `Error Message: ${errorMessage}`, variant: "Paragraphy Body" }))),
74
- image && React.createElement("img", { src: image, alt: "Splash Image" }),
75
- React.createElement(BackgroundDiv, { colorPalette: colorPalette, backgroundImage: backgroundImage }, refreshOnClick && React.createElement(Button, { colorPalette: colorPalette, onClick: refreshOnClick, label: "Refresh to Try Again", variant: "outlined", icon: React.createElement(FiRefreshCw, null) })),
81
+ React.createElement(Typography, { textColor: colorPalette.text.primary, content: "An unexpected error occurred. You can try again, or report the issue if it persists.", variant: "Paragraphy Body" }),
82
+ (onFAQ || onTryAgain || onReportBug) && (React.createElement(ActionsDiv, null,
83
+ onFAQ && React.createElement(Button, { colorPalette: colorPalette, onClick: onFAQ, label: "FAQ", variant: "outlined", icon: React.createElement(FiHelpCircle, null) }),
84
+ onTryAgain && React.createElement(Button, { colorPalette: colorPalette, onClick: onTryAgain, label: "Try Again", variant: "outlined", icon: React.createElement(FiRefreshCw, null) }),
85
+ onReportBug && React.createElement(ReportABugButton, { colorPalette: colorPalette, variant: "outlined", onClick: onReportBug }))))),
86
+ React.createElement(BackgroundDiv, { colorPalette: colorPalette, backgroundImage: backgroundImage }),
76
87
  React.createElement(ContactContainer, { colors: colorPalette },
77
88
  React.createElement(Typography, { textColor: colorPalette.text.primary, content: "Please ask further questions, or reach out for additional support by emailing", variant: "Label" }),
78
89
  React.createElement(Typography, { textColor: colorPalette.text.primary, content: "devs@factorearth.com", variant: "Heading 4" }))));
@@ -1 +1 @@
1
-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AU,EAAC,IAAI,EAAE,oBAAC,YAAY,OAAG,GAAI;oBACtH,UAAU,IAAI,oBAAC,MAAM,IAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAC,WAAW,EAAC,OAAO,EAAC,UAAU,EAAC,IAAI,EAAE,oBAAC,WAAW,OAAG,GAAI;oBACrI,WAAW,IAAI,oBAAC,gBAAgB,IAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAC,UAAU,EAAC,OAAO,EAAE,WAAW,GAAI,CAC7F,CACb,CACe,CACN;QACZ,oBAAC,aAAa,IAAC,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,GAAI;QAK/E,oBAAC,gBAAgB,IAAC,MAAM,EAAE,YAAY;YACrC,oBAAC,UAAU,IAAC,SAAS,EAAE,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,+EAA+E,EAAE,OAAO,EAAE,OAAO,GAAI;YAChK,oBAAC,UAAU,IAAC,SAAS,EAAE,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,WAAW,GAAI,CACzF,CACG,CACvB,CAAC;AACH,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factorearth/component-library",
3
- "version": "6.6.4",
3
+ "version": "6.6.5",
4
4
  "description": " A storybook component library for FactorEarth",
5
5
  "author": "madtrx <marlin.makori@gmail.com>",
6
6
  "homepage": "https://github.com/FactorEarth/RecordMiddleware#readme",
@@ -47,7 +47,7 @@
47
47
  "access": "public",
48
48
  "registry": "https://registry.npmjs.org/"
49
49
  },
50
- "gitHead": "896cb3f79e9b7078555cdad9e8556ae3cfe9f334",
50
+ "gitHead": "5724b3887edf04166eede68965af21607e0ef8ef",
51
51
  "dependencies": {
52
52
  "@emotion/react": "^11.13.0",
53
53
  "@emotion/styled": "^11.13.0",