Skip to content

Commit

Permalink
fix: allow text provided to component with default fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel-Develops committed Jan 29, 2025
1 parent a563b5a commit 87c67c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/components/footer/FooterAbout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ export interface FooterAboutProps
extends FooterPartsPrimitiveProps<HTMLDivElement> {
entityLink?: string;
entityName?: string;
entityText?: string;
}

const FooterAbout = (props: React.PropsWithChildren<FooterAboutProps>) => {
const { className, children, entityLink, entityName, ...rest } = props;
const { className, children, entityLink, entityName, entityText, ...rest } = props;
if (children) {
<div {...rest} className={className}>
{props.children}
Expand All @@ -27,7 +28,7 @@ const FooterAbout = (props: React.PropsWithChildren<FooterAboutProps>) => {
),
)}
>
Built with <span>🧡</span> by the{" "}
{entityText ?? "Built with 🧡 by the "}{" "}
<a
href={entityLink ?? "https://bitcoindevs.xyz/"}
target="_blank"
Expand Down
8 changes: 5 additions & 3 deletions src/components/footer/FooterFeedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import clsx from "clsx";
export interface FooterFeedbackProps
extends FooterPartsPrimitiveProps<HTMLDivElement> {
feedbackLink: string;
enitityText?: string;
entityCtaText?: string;
}

const FooterFeedback = (
props: React.PropsWithChildren<FooterFeedbackProps>,
) => {
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) {
<div {...rest} className={props.className}>
{props.children}
Expand All @@ -27,14 +29,14 @@ const FooterFeedback = (
),
)}
>
<span>We&apos;d love to hear your feedback on this project?</span>
<span>{enitityText}</span>
<a
href={feedbackLink}
target="_blank"
rel="noreferrer"
className="leading-none w-fit min-w-fit mx-auto text-base font-medium md:font-semibold py-4 px-5 rounded-[10px] text-[#FAFAFA] dark:text-[#292929] bg-[#292929] dark:bg-[#FAFAFA]"
>
Give Feedback
{entityCtaText}
</a>
</div>
);
Expand Down
4 changes: 3 additions & 1 deletion src/components/footer/FooterPublic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import clsx from "clsx";
export interface FooterPublicProps
extends FooterPartsPrimitiveProps<HTMLAnchorElement> {
dashboardLink: string;
entityText?: string;
}

const FooterPublic = ({
className,
dashboardLink,
entityText = "View our public visitor count",
...rest
}: FooterPublicProps) => {
return (
Expand All @@ -26,7 +28,7 @@ const FooterPublic = ({
)}
{...rest}
>
View our public visitor count
{entityText}
</a>
);
};
Expand Down

0 comments on commit 87c67c4

Please sign in to comment.