Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed text on the events page two buttons and linked it to the common.json file #3488

Closed
7 changes: 6 additions & 1 deletion components/buttons/GoogleCalendarButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { IButtonDefaultProps } from '../../types/components/buttons/types';
import { useTranslation } from '../../utils/i18n';
import IconGoogleCalendar from '../icons/GoogleCalendar';
import Button from './Button';
import details from '../../public/locales/en/common.json';

interface IGoogleCalendarButtonProps extends IButtonDefaultProps {}

Expand All @@ -25,10 +26,14 @@ export default function GoogleCalendarButton({
className
}: IGoogleCalendarButtonProps) {
const { t } = useTranslation('common');

// created a variable with name 'googleCalendarBtnText' to take the value from 'common.json' file to add text on the button

let googleCalendarBtnText = details.googleCalendarBtn;

return (
<Button
text={t(text)}
text={t(googleCalendarBtnText)}
icon={<IconGoogleCalendar />}
href={href}
iconPosition={iconPosition}
Expand Down
7 changes: 6 additions & 1 deletion components/buttons/ICSFileButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { IButtonDefaultProps } from '../../types/components/buttons/types';
import { useTranslation } from '../../utils/i18n';
import IconCalendar from '../icons/Calendar';
import Button from './Button';
import details from '../../public/locales/en/common.json';
BalrajDhakad marked this conversation as resolved.
Show resolved Hide resolved

interface IICSFButtonProps extends IButtonDefaultProps {}

Expand All @@ -26,9 +27,13 @@ export default function ICSFButton({
}: IICSFButtonProps) {
const { t } = useTranslation('common');

// created a variable with name 'icsFileBtnText' to take the value from 'common.json' file to add text on the button

let icsFileBtnText = details.icsFileBtn;

return (
<Button
text={t(text)}
text={t(icsFileBtnText)}
icon={<IconCalendar />}
href={href}
iconPosition={iconPosition}
Expand Down
Loading