@unitedstatespowersquadrons/components 1.2.7-pre.2 → 1.2.7-pre.3
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.
- package/Reducer/buildReducer.tsx +2 -2
- package/Toasts/Toast.tsx +2 -0
- package/package.json +1 -1
package/Reducer/buildReducer.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { createContext, useContext, useMemo } from "react";
|
|
2
2
|
import { Draft, produce } from "immer";
|
|
3
3
|
import { useImmerReducer } from "use-immer";
|
|
4
|
-
import
|
|
4
|
+
import { Cable, createConsumer } from "actioncable";
|
|
5
5
|
import { ReducerHandler } from "./types";
|
|
6
6
|
|
|
7
7
|
interface InitialAppProps<AppState> {
|
|
@@ -18,7 +18,7 @@ export default function buildReducer<AppState, AppAction>(
|
|
|
18
18
|
const DispatchContext = createContext<React.Dispatch<AppAction> | null>(null);
|
|
19
19
|
const CableContext = createContext<Cable | null>(null);
|
|
20
20
|
|
|
21
|
-
const cable = actionCableUrl ?
|
|
21
|
+
const cable = actionCableUrl ? createConsumer(actionCableUrl) : null;
|
|
22
22
|
|
|
23
23
|
function AppProvider(props: InitialAppProps<AppState>) {
|
|
24
24
|
const [providerState, dispatch] = useImmerReducer(reducer, props.initialState, (state: AppState) => {
|
package/Toasts/Toast.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import classNames from "classnames";
|
|
|
3
3
|
import { createUseStyles } from "react-jss";
|
|
4
4
|
import { DismissFunc, Toast_Status, ToastProps } from "./types";
|
|
5
5
|
import FontAwesomeIcon from "../FontAwesomeIcon";
|
|
6
|
+
import Styles from "../Styles";
|
|
6
7
|
|
|
7
8
|
interface Props {
|
|
8
9
|
dismiss: DismissFunc;
|
|
@@ -59,6 +60,7 @@ const useStyles = createUseStyles({
|
|
|
59
60
|
fontSize: "1em",
|
|
60
61
|
fontWeight: "bold",
|
|
61
62
|
},
|
|
63
|
+
...Styles.flexRow,
|
|
62
64
|
marginBottom: "1em",
|
|
63
65
|
textAlign: "left",
|
|
64
66
|
},
|