@bigbinary/neeto-molecules 3.2.18 → 3.2.19

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,14 +1,28 @@
1
1
  import React from "react";
2
2
  import { AlertProps, ButtonProps } from "@bigbinary/neetoui";
3
+ interface PublishPaneProps {
4
+ isSubmitting: boolean;
5
+ onPublish: (params: {
6
+ isPublishLaterChecked: boolean;
7
+ datetimeValue: Date | null;
8
+ onClose: () => void;
9
+ }) => void;
10
+ onCancel: (params: {
11
+ onClose: () => void;
12
+ }) => void;
13
+ datetime: Date | null;
14
+ }
15
+ interface PublishButtonProps extends ButtonProps {
16
+ showTooltipWhenDisabled?: boolean;
17
+ publishPaneProps?: PublishPaneProps;
18
+ }
3
19
  interface PublishBlockProps {
4
20
  renderDraftButtons: (props: {
5
21
  ViewDraftButton: React.FC<ButtonProps>;
6
22
  ResetDraftButton: React.FC<ButtonProps>;
7
23
  }) => React.ReactNode;
8
24
  renderPublishButtons: (props: {
9
- PublishButton: React.FC<ButtonProps & {
10
- showTooltipWhenDisabled?: boolean;
11
- }>;
25
+ PublishButton: React.FC<PublishButtonProps>;
12
26
  PublishPreviewButton: React.FC<ButtonProps>;
13
27
  }) => React.ReactNode;
14
28
  }
@@ -52,6 +66,51 @@ interface PublishBlockProps {
52
66
  * );
53
67
  * };
54
68
  * @endexample
69
+ * To use scheduling of publication:
70
+ *
71
+ * @example
72
+ *
73
+ * import PublishBlock from "@bigbinary/neeto-molecules/PublishBlock";
74
+ *
75
+ * const PublishActionBlock = (
76
+ * {
77
+ * //all variables used in the below example can be passed as props or can be defined in the component itself
78
+ * }
79
+ * ) => {
80
+ * const renderDraftButtons = ({ ViewDraftButton, ResetDraftButton }) =>
81
+ * !isDraftBlockHidden && (
82
+ * <>
83
+ * <ViewDraftButton to={previewDraftUrl} />
84
+ * {hasDraftVersion && <ResetDraftButton onClick={handleResetDraft} />}
85
+ * </>
86
+ * );
87
+ *
88
+ * const renderPublishButtons = ({ PublishButton, PublishPreviewButton }) => (
89
+ * <>
90
+ * <PublishButton
91
+ * disabled={isPublishDisabled}
92
+ * onClick={handlePublish}
93
+ * publishPaneProps={{
94
+ * isSubmitting: false,
95
+ * onPublish: ({ onClose }) => onClose(),
96
+ * onCancel: ({ onClose }) => onClose(),
97
+ * datetime: null,
98
+ * }}
99
+ * />
100
+ * <PublishPreviewButton
101
+ * disabled={isPublishPreviewDisabled}
102
+ * to={previewPublishedUrl}
103
+ * />
104
+ * </>
105
+ * );
106
+ * return (
107
+ * <PublishBlock
108
+ * renderDraftButtons={renderDraftButtons}
109
+ * renderPublishButtons={renderPublishButtons}
110
+ * />
111
+ * );
112
+ * };
113
+ * @endexample
55
114
  * This optional component can be used to render the reset alert modal for
56
115
  *
57
116
  * discarding draft.