Skip to content

Commit

Permalink
passed onClick prop to FooterButton / added color (#1694)
Browse files Browse the repository at this point in the history
* passed onClick prop to FooterButton / added color

* fixed data type
  • Loading branch information
mertbagt authored Feb 5, 2025
1 parent 5e2c3aa commit 61cfbd4
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions components/TestimonyCard/TestimonyItem.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useTranslation } from "next-i18next"
import { ReactNode, useState } from "react"
import { MouseEventHandler, ReactNode, useState } from "react"
import { ButtonProps } from "react-admin"
import { ToastContainer } from "react-bootstrap"
import Image from "react-bootstrap/Image"
Expand All @@ -21,17 +21,20 @@ import { UserInfoHeader } from "./UserInfoHeader"
type FooterButtonProps = Omit<ButtonProps, "children"> & {
className?: string
children?: ReactNode
onClick?: MouseEventHandler<HTMLButtonElement> | undefined
}

const FooterButton = ({
variant = "text",
className,
children
children,
onClick
}: FooterButtonProps) => {
return (
<Button
className={`text-decoration-none m-0 p-0 ${className}`}
variant={variant}
onClick={onClick}
>
{children}
</Button>
Expand Down Expand Up @@ -135,6 +138,7 @@ export const TestimonyItem = ({
{canExpand && (
<Col className="justify-content-end d-flex">
<FooterButton
className="text-secondary"
variant="text"
onClick={() => setShowAllTestimony(true)}
>
Expand Down Expand Up @@ -168,7 +172,11 @@ export const TestimonyItem = ({
</Col>
)}
<Col xs="auto">
<FooterButton variant="text" onClick={() => setIsReporting(true)}>
<FooterButton
className="text-secondary"
variant="text"
onClick={() => setIsReporting(true)}
>
{t("reportModal.report")}
<IconSpacer />
</FooterButton>
Expand Down

0 comments on commit 61cfbd4

Please sign in to comment.