): Generator {
try {
yield put(startLoading());
- const common = yield call(fetchCommonDetail, action.payload);
+ const common = (yield call(fetchCommonDetail, payload.payload)) as Common;
const [discussions, proposals] = (yield Promise.all([
- fetchCommonDiscussions((common as Common).id),
- fetchCommonProposals((common as Common).id),
+ fetchCommonDiscussions(common.id),
+ fetchCommonProposals(common.id),
])) as any[];
- yield put(actions.getCommonDetail.success(common as Common));
+ yield put(actions.getCommonDetail.success(common));
yield put(actions.setDiscussion(discussions));
yield put(actions.setProposals(proposals));
- yield put(stopLoading());
+ if (payload.callback) {
+ payload.callback(null, common);
+ }
} catch (e) {
yield put(actions.getCommonDetail.failure(e));
+
+ if (payload.callback) {
+ payload.callback(e);
+ }
+ } finally {
yield put(stopLoading());
}
}
diff --git a/src/shared/components/NotFound.tsx b/src/shared/components/NotFound.tsx
deleted file mode 100755
index e7fcc5956d..0000000000
--- a/src/shared/components/NotFound.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import React from "react";
-
-const NotFound = () => not found
;
-
-export default NotFound;
diff --git a/src/shared/components/NotFound/NotFound.tsx b/src/shared/components/NotFound/NotFound.tsx
new file mode 100644
index 0000000000..7650fcb36f
--- /dev/null
+++ b/src/shared/components/NotFound/NotFound.tsx
@@ -0,0 +1,11 @@
+import React, { FC } from "react";
+import "./index.scss";
+
+const NotFound: FC = () => (
+
+ 404
+
This page could not be found.
+
+);
+
+export default NotFound;
diff --git a/src/shared/components/NotFound/index.scss b/src/shared/components/NotFound/index.scss
new file mode 100644
index 0000000000..52cf800fda
--- /dev/null
+++ b/src/shared/components/NotFound/index.scss
@@ -0,0 +1,27 @@
+@import "../../../constants";
+@import "../../../styles/sizes";
+
+.page-not-found {
+ margin-top: 4rem;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ color: $secondary-blue;
+
+ .page-not-found__code {
+ padding: 0.5rem 1.5rem 0.5rem 0;
+ font-size: $moderate-med;
+ font-weight: bold;
+ border-right: 2px solid $light-gray-3;
+ }
+
+ .page-not-found__message {
+ margin: 0 0 0 1.5rem;
+ font-size: $small;
+ font-weight: normal;
+ }
+
+ @include big-phone {
+ margin-top: 2.5rem;
+ }
+}
diff --git a/src/shared/components/NotFound/index.ts b/src/shared/components/NotFound/index.ts
new file mode 100644
index 0000000000..cd9562ee55
--- /dev/null
+++ b/src/shared/components/NotFound/index.ts
@@ -0,0 +1 @@
+export { default as NotFound } from "./NotFound";
diff --git a/src/shared/components/index.tsx b/src/shared/components/index.tsx
index 4a6f59c689..fe28ff27b9 100644
--- a/src/shared/components/index.tsx
+++ b/src/shared/components/index.tsx
@@ -4,7 +4,7 @@ export * from "./ButtonLink";
export * from "./Common";
export { default as Content } from "./Content";
export * from "./FilesCarousel";
-export { default as NotFound } from "./NotFound";
+export * from "./NotFound";
export * from "./SocialLogin";
export * from "./Footer";
export * from "./Header";