Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
osamasayed committed Mar 11, 2024
1 parent fdd0c9f commit 4d71759
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/components/Fundraising/DonateButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@ type Props = {
source: DonateButtonClickSource;
type?: DonateButtonType;
isOutlined?: boolean;
isTextBasedOnType?: boolean;
};

const DonateButton: React.FC<Props> = ({ source, type, isOutlined = false }) => {
const DonateButton: React.FC<Props> = ({
isTextBasedOnType = true,
source,
type,
isOutlined = false,
}) => {
const { t } = useTranslation('common');

const onDonateClicked = () => {
Expand All @@ -36,7 +42,10 @@ const DonateButton: React.FC<Props> = ({ source, type, isOutlined = false }) =>
navigateToExternalUrl(href);
};

const buttonTextTranslationKey = type ? `donate_${type}` : 'donate';
let buttonTextTranslationKey = 'donate';
if (isTextBasedOnType === true && type) {
buttonTextTranslationKey = `donate_${type}`;
}

return (
<Button
Expand Down
6 changes: 5 additions & 1 deletion src/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ const Navbar = () => {
<Banner
text={t('fundraising-sticky-banner.title')}
ctaButton={
<DonateButton type={DonateButtonType.MONTHLY} source={DonateButtonClickSource.BANNER} />
<DonateButton
isTextBasedOnType={false}
type={DonateButtonType.MONTHLY}
source={DonateButtonClickSource.BANNER}
/>
}
/>
<NavbarBody />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const EndOfScrollingControls: React.FC<Props> = ({
ctaButton={
<DonateButton
type={DonateButtonType.MONTHLY}
isTextBasedOnType={false}
source={DonateButtonClickSource.QURAN_READER}
/>
}
Expand Down

0 comments on commit 4d71759

Please sign in to comment.