From 87c67c4040b821f3df60c64cb868920f5e8157b2 Mon Sep 17 00:00:00 2001 From: Emmanuel-Develops Date: Wed, 29 Jan 2025 14:56:58 +0100 Subject: [PATCH] fix: allow text provided to component with default fallback --- src/components/footer/FooterAbout.tsx | 5 +++-- src/components/footer/FooterFeedback.tsx | 8 +++++--- src/components/footer/FooterPublic.tsx | 4 +++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/components/footer/FooterAbout.tsx b/src/components/footer/FooterAbout.tsx index 35017ac..25ec35a 100644 --- a/src/components/footer/FooterAbout.tsx +++ b/src/components/footer/FooterAbout.tsx @@ -7,10 +7,11 @@ export interface FooterAboutProps extends FooterPartsPrimitiveProps { entityLink?: string; entityName?: string; + entityText?: string; } const FooterAbout = (props: React.PropsWithChildren) => { - const { className, children, entityLink, entityName, ...rest } = props; + const { className, children, entityLink, entityName, entityText, ...rest } = props; if (children) {
{props.children} @@ -27,7 +28,7 @@ const FooterAbout = (props: React.PropsWithChildren) => { ), )} > - Built with 🧡 by the{" "} + {entityText ?? "Built with 🧡 by the "}{" "} { feedbackLink: string; + enitityText?: string; + entityCtaText?: string; } const FooterFeedback = ( props: React.PropsWithChildren, ) => { - const { className, children, feedbackLink, ...rest } = props; + const { className, children, feedbackLink, enitityText="We'd love to hear your feedback on this project?", entityCtaText="Give feedback", ...rest } = props; if (children) { ); diff --git a/src/components/footer/FooterPublic.tsx b/src/components/footer/FooterPublic.tsx index a224b4e..1b347a0 100644 --- a/src/components/footer/FooterPublic.tsx +++ b/src/components/footer/FooterPublic.tsx @@ -6,11 +6,13 @@ import clsx from "clsx"; export interface FooterPublicProps extends FooterPartsPrimitiveProps { dashboardLink: string; + entityText?: string; } const FooterPublic = ({ className, dashboardLink, + entityText = "View our public visitor count", ...rest }: FooterPublicProps) => { return ( @@ -26,7 +28,7 @@ const FooterPublic = ({ )} {...rest} > - View our public visitor count + {entityText} ); };