@redocly/theme 0.14.1 → 0.14.2
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.
|
@@ -22,10 +22,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
exports.Feedback = void 0;
|
|
27
30
|
const React = __importStar(require("react"));
|
|
28
31
|
const react_router_dom_1 = require("react-router-dom");
|
|
32
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
29
33
|
const Feedback_1 = require("../../components/Feedback");
|
|
30
34
|
const hooks_1 = require("../../hooks");
|
|
31
35
|
const useSubmitFeedback_1 = require("../../mocks/Feedback/useSubmitFeedback");
|
|
@@ -37,11 +41,14 @@ const Feedback = (props) => {
|
|
|
37
41
|
const renderFeedbackComponent = () => {
|
|
38
42
|
switch (type) {
|
|
39
43
|
case 'rating':
|
|
40
|
-
return (React.createElement(
|
|
44
|
+
return (React.createElement(Wrapper, null,
|
|
45
|
+
React.createElement(Feedback_1.Rating, { settings: settings, onSubmit: (values) => submitFeedback({ type: 'rating', values, path }) })));
|
|
41
46
|
case 'sentiment':
|
|
42
|
-
return (React.createElement(
|
|
47
|
+
return (React.createElement(Wrapper, null,
|
|
48
|
+
React.createElement(Feedback_1.Sentiment, { settings: settings, onSubmit: (values) => submitFeedback({ type: 'sentiment', values, path }) })));
|
|
43
49
|
case 'comment':
|
|
44
|
-
return (React.createElement(
|
|
50
|
+
return (React.createElement(Wrapper, null,
|
|
51
|
+
React.createElement(Feedback_1.Comment, { settings: settings, onSubmit: (values) => submitFeedback({ type: 'comment', values, path }) })));
|
|
45
52
|
default:
|
|
46
53
|
console.log(`No feedback with type ${type}!`);
|
|
47
54
|
break;
|
|
@@ -51,4 +58,9 @@ const Feedback = (props) => {
|
|
|
51
58
|
return React.createElement(React.Fragment, { key: pathname }, renderFeedbackComponent());
|
|
52
59
|
};
|
|
53
60
|
exports.Feedback = Feedback;
|
|
61
|
+
const Wrapper = styled_components_1.default.div `
|
|
62
|
+
@media print {
|
|
63
|
+
display: none;
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
54
66
|
//# sourceMappingURL=Feedback.js.map
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useLocation } from 'react-router-dom';
|
|
3
|
+
import styled from 'styled-components';
|
|
3
4
|
|
|
4
5
|
import type { FeedbackProps } from '@theme/types/portal/src/shared/types/feedback';
|
|
5
6
|
import { Rating, Sentiment, Comment } from '@theme/components/Feedback';
|
|
@@ -16,24 +17,30 @@ export const Feedback = (props: FeedbackProps & { path?: string }) => {
|
|
|
16
17
|
switch (type) {
|
|
17
18
|
case 'rating':
|
|
18
19
|
return (
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
<Wrapper>
|
|
21
|
+
<Rating
|
|
22
|
+
settings={settings}
|
|
23
|
+
onSubmit={(values) => submitFeedback({ type: 'rating', values, path })}
|
|
24
|
+
/>
|
|
25
|
+
</Wrapper>
|
|
23
26
|
);
|
|
24
27
|
case 'sentiment':
|
|
25
28
|
return (
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
<Wrapper>
|
|
30
|
+
<Sentiment
|
|
31
|
+
settings={settings}
|
|
32
|
+
onSubmit={(values) => submitFeedback({ type: 'sentiment', values, path })}
|
|
33
|
+
/>
|
|
34
|
+
</Wrapper>
|
|
30
35
|
);
|
|
31
36
|
case 'comment':
|
|
32
37
|
return (
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
<Wrapper>
|
|
39
|
+
<Comment
|
|
40
|
+
settings={settings}
|
|
41
|
+
onSubmit={(values) => submitFeedback({ type: 'comment', values, path })}
|
|
42
|
+
/>
|
|
43
|
+
</Wrapper>
|
|
37
44
|
);
|
|
38
45
|
default:
|
|
39
46
|
console.log(`No feedback with type ${type}!`);
|
|
@@ -45,3 +52,9 @@ export const Feedback = (props: FeedbackProps & { path?: string }) => {
|
|
|
45
52
|
|
|
46
53
|
return <React.Fragment key={pathname}>{renderFeedbackComponent()}</React.Fragment>;
|
|
47
54
|
};
|
|
55
|
+
|
|
56
|
+
const Wrapper = styled.div`
|
|
57
|
+
@media print {
|
|
58
|
+
display: none;
|
|
59
|
+
}
|
|
60
|
+
`;
|