Skip to content

Commit a3888d8

Browse files
authored
Merge pull request #73 from dlabaj/issue71
bug(issue-71): Fixes bug where there is no hover effect on the cards.
2 parents 5970b47 + a19eace commit a3888d8

File tree

2 files changed

+59
-21
lines changed

2 files changed

+59
-21
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
"prettier": "2.7.1",
5252
"jest": "^29.2.2",
5353
"husky": "^8.0.3",
54-
"@testing-library/react":"^13.4.0",
54+
"@testing-library/react": "^13.4.0",
5555
"@testing-library/user-event": "14.4.3",
56-
"@testing-library/jest-dom":"5.16.5",
56+
"@testing-library/jest-dom": "5.16.5",
5757
"@testing-library/dom": "9.0.0",
5858
"jest-environment-jsdom": "^29.2.2",
5959
"jest-canvas-mock": "^2.4.0",

packages/module/src/Feedback/FeedbackModalInternal.tsx

Lines changed: 57 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
Button,
44
Card,
55
CardBody,
6+
CardHeader,
67
CardTitle,
78
Flex,
89
FlexItem,
@@ -94,13 +95,22 @@ export const FeedbackModalInternal = memo(
9495
<PanelMainBody className="chr-c-feedback-cards">
9596
<Card
9697
isCompact
98+
isClickable
9799
variant="secondary"
98-
onClick={() => {
99-
typeof onShareFeedback === 'string'
100-
? window.open(onShareFeedback, '_blank')
101-
: setModalPage('feedbackOne');
102-
}}
103100
>
101+
<CardHeader
102+
selectableActions={{
103+
// eslint-disable-next-line no-console
104+
onClickAction: () => {
105+
typeof onShareFeedback === 'string'
106+
? window.open(onShareFeedback, '_blank')
107+
: setModalPage('feedbackOne');
108+
},
109+
selectableActionId: "feedback-card-1",
110+
selectableActionAriaLabelledby: 'feedback-card-1',
111+
name: 'feedback-card'
112+
}}
113+
></CardHeader>
104114
<CardTitle>
105115
{intl.shareFeedback} {typeof onShareFeedback === 'string' ? <ExternalLinkAltIcon /> : null}
106116
</CardTitle>
@@ -109,13 +119,23 @@ export const FeedbackModalInternal = memo(
109119
{onReportABug && (
110120
<Card
111121
isCompact
112-
variant="secondary"
113-
onClick={() => {
114-
typeof onReportABug === 'string'
115-
? window.open(onReportABug, '_blank')
116-
: setModalPage('reportBugOne');
117-
}}
122+
isClickable
123+
variant='secondary'
118124
>
125+
<CardHeader
126+
selectableActions={{
127+
// eslint-disable-next-line no-console
128+
onClickAction: () => {
129+
typeof onReportABug === 'string'
130+
? window.open(onReportABug, '_blank')
131+
: setModalPage('reportBugOne');
132+
},
133+
selectableActionId: "report-bug-card-1",
134+
selectableActionAriaLabelledby: 'report-bug-card-1',
135+
name: 'report-bug-card'
136+
}}
137+
></CardHeader>
138+
119139
<CardTitle>
120140
{intl.reportABug} {typeof onReportABug === 'string' ? <ExternalLinkAltIcon /> : null}{' '}
121141
</CardTitle>
@@ -125,11 +145,20 @@ export const FeedbackModalInternal = memo(
125145
{onOpenSupportCase && (
126146
<Card
127147
isCompact
148+
isClickable
128149
variant="secondary"
129-
onClick={() => {
130-
window.open(onOpenSupportCase, '_blank');
131-
}}
132150
>
151+
<CardHeader
152+
selectableActions={{
153+
// eslint-disable-next-line no-console
154+
onClickAction: () => {
155+
window.open(onOpenSupportCase, '_blank');
156+
},
157+
selectableActionId: "open-support-case-card-1",
158+
selectableActionAriaLabelledby: 'open-support-case-card-1',
159+
name: 'open-support-case-card'
160+
}}
161+
></CardHeader>
133162
<CardTitle>
134163
<Text>
135164
{intl.openSupportCase} <ExternalLinkAltIcon />
@@ -141,13 +170,22 @@ export const FeedbackModalInternal = memo(
141170
{onJoinMailingList && (
142171
<Card
143172
isCompact
173+
isClickable
144174
variant="secondary"
145-
onClick={() => {
146-
typeof onJoinMailingList === 'string'
147-
? window.open(onJoinMailingList, '_blank')
148-
: setModalPage('informDirection');
149-
}}
150175
>
176+
<CardHeader
177+
selectableActions={{
178+
// eslint-disable-next-line no-console
179+
onClickAction: () => {
180+
typeof onJoinMailingList === 'string'
181+
? window.open(onJoinMailingList, '_blank')
182+
: setModalPage('informDirection');
183+
},
184+
selectableActionId: "join-mailing-list-card-1",
185+
selectableActionAriaLabelledby: 'join-mailing-list-card-1',
186+
name: 'join-mailing-list-card'
187+
}}
188+
></CardHeader>
151189
<CardTitle>
152190
<Text>
153191
{intl.informDirection}{' '}

0 commit comments

Comments
 (0)