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

GoogleCalender Button, ics File Download Button: text fixed in community/events #3471

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion components/buttons/GoogleCalendarButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import { useTranslation } from '../../utils/i18n';
import IconGoogleCalendar from '../icons/GoogleCalendar';
import Button from './Button';


// Importing text to display on button from common.json
import { githubButton } from '../../public/locales/en/common.json';

Comment on lines +10 to +13
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove extra blank line and fix incorrect import

There are two issues here:

  1. Extra blank line
  2. Incorrect text key import (githubButton for a Google Calendar button)
 import Button from './Button';
-
-// Importing text to display on button from common.json
-import { githubButton } from '../../public/locales/en/common.json';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Importing text to display on button from common.json
import { githubButton } from '../../public/locales/en/common.json';
import Button from './Button';
🧰 Tools
🪛 eslint

[error] 10-11: Delete

(prettier/prettier)


[error] 10-11: More than 1 blank line not allowed.

(no-multiple-empty-lines)

interface IGoogleCalendarButtonProps extends IButtonDefaultProps {}

/**
Expand All @@ -18,7 +22,7 @@ interface IGoogleCalendarButtonProps extends IButtonDefaultProps {}
* @param {string} props.className - The class name to be applied to the button.
*/
export default function GoogleCalendarButton({
text = 'googleCalendarBtn',
text = githubButton,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

⚠️ Potential issue

Fix incorrect text key and refactor localization

The component is using githubButton for a Google Calendar button, which is incorrect. Additionally, like the ICS button, this implementation bypasses the i18n system.

-  text = githubButton,
+  text = 'googleCalendarBtn',

This change:

  1. Uses the correct translation key for a Google Calendar button
  2. Removes direct dependency on the English locale file
  3. Maintains consistency with i18n best practices

Committable suggestion skipped: line range outside the PR's diff.

href,
target = '_blank',
iconPosition = ButtonIconPosition.LEFT,
Expand Down
5 changes: 4 additions & 1 deletion components/buttons/ICSFileButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { useTranslation } from '../../utils/i18n';
import IconCalendar from '../icons/Calendar';
import Button from './Button';

// Importing text to display on button from common.json
import { icsFileBtn } from '../../public/locales/en/common.json';

interface IICSFButtonProps extends IButtonDefaultProps {}

/**
Expand All @@ -18,7 +21,7 @@ interface IICSFButtonProps extends IButtonDefaultProps {}
* @param {string} props.className - The class name to be applied to the button.
*/
export default function ICSFButton({
text = 'icsFileBtn',
text = icsFileBtn,
href,
target = '_blank',
iconPosition = ButtonIconPosition.LEFT,
Expand Down
Loading