Skip to content

Commit

Permalink
Merge pull request #2427 from SpareBank1/legg-til-classname-prop-feed…
Browse files Browse the repository at this point in the history
…back

feat(ffe-feedback-react): legg til className prop
  • Loading branch information
HeleneKassandra authored Nov 27, 2024
2 parents 99cdaff + 39bce9c commit 6a26d23
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/ffe-feedback-react/src/Feedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface FeedbackProps {
texts?: {
feedbackNotSentHeading?: string;
};
className?: string;
}
export const Feedback: React.FC<FeedbackProps> = ({
headingLevel,
Expand All @@ -29,6 +30,7 @@ export const Feedback: React.FC<FeedbackProps> = ({
bgDarkmodeColor,
contactLink,
texts,
className,
}) => {
const feedbackSentRef = useRef<HTMLHeadingElement>();
const expandedRef = useRef<HTMLHeadingElement>();
Expand All @@ -37,10 +39,14 @@ export const Feedback: React.FC<FeedbackProps> = ({
const [feedbackSent, setFeedbackSent] = useState(false);
const headingId = useId();

const feedbackClassnames = classNames('ffe-feedback', {
[`ffe-feedback--bg-${bgColor}`]: bgColor,
[`ffe-feedback--dm-bg-${bgDarkmodeColor}`]: bgDarkmodeColor,
});
const feedbackClassnames = classNames(
'ffe-feedback',
{
[`ffe-feedback--bg-${bgColor}`]: bgColor,
[`ffe-feedback--dm-bg-${bgDarkmodeColor}`]: bgDarkmodeColor,
},
className,
);

const handleThumbClicked = (thumb: Thumb) => {
setFeedbackThumbClicked(thumb);
Expand Down

0 comments on commit 6a26d23

Please sign in to comment.