-
Notifications
You must be signed in to change notification settings - Fork 203
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) O3-3890 Help menu (and menu items) should use a standard Carbon… #1164
base: main
Are you sure you want to change the base?
Changes from all commits
c470659
675378a
700b47b
26d30e5
1df72a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,16 @@ | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
import styles from './styles.scss'; | ||
import { ArrowUpRight } from '@carbon/react/icons'; | ||
import { Link } from '@carbon/react'; | ||
import { MenuItem } from '@carbon/react'; | ||
|
||
const Docs = () => { | ||
const { t } = useTranslation(); | ||
return ( | ||
<Link | ||
<MenuItem | ||
className={styles.helpButton} | ||
href="https://o3-docs.openmrs.org" | ||
rel="noopener noreferrer" | ||
renderIcon={ArrowUpRight} | ||
target="_blank" | ||
> | ||
{t('docs', 'Docs')} | ||
</Link> | ||
label={t('documentation', 'Documentation')} | ||
onClick={() => window.open('https://o3-docs.openmrs.org', '_blank')} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we move the onClick handler to a function that's wrapped in a useCallback hook? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Noted |
||
/> | ||
); | ||
}; | ||
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn’t expect these changes to be included here. Bad rebase? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, a mistake on my end, I'll fix it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we wrap the
onClick
handlers in use callback hooks? Additionally, for security, it’s good to addnoreferrer noopener
to external links:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted