Skip to content

Commit

Permalink
fix(ActionsMenu actions): Stop spreading t, f, lang into child
Browse files Browse the repository at this point in the history
  • Loading branch information
JF-Cozy committed Apr 27, 2023
1 parent 9dafd8c commit 4fa0cc0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion react/ActionsMenu/Actions/call.js
Expand Up @@ -15,7 +15,8 @@ export const call = () => {
!!phoneNumber && window.open(`tel:${phoneNumber}`, '_self')
},
Component: withActionsLocales(
forwardRef(({ t, ...props }, ref) => {
// eslint-disable-next-line no-unused-vars
forwardRef(({ t, f, lang, ...props }, ref) => {
return (
<ActionsMenuItem {...props} ref={ref}>
<ListItemIcon>
Expand Down
3 changes: 2 additions & 1 deletion react/ActionsMenu/Actions/emailTo.js
Expand Up @@ -15,7 +15,8 @@ export const emailTo = () => {
!!emailAddress && window.open(`mailto:${emailAddress}`, '_self')
},
Component: withActionsLocales(
forwardRef(({ t, ...props }, ref) => {
// eslint-disable-next-line no-unused-vars
forwardRef(({ t, f, lang, ...props }, ref) => {
return (
<ActionsMenuItem {...props} ref={ref}>
<ListItemIcon>
Expand Down
5 changes: 5 additions & 0 deletions react/ActionsMenu/Actions/locales/withActionsLocales.jsx
Expand Up @@ -8,4 +8,9 @@ export const locales = {
fr
}

/**
* TODO: We should use something else than withLocales here. Because it's an HOC
* so it spreads t, f, lang into child props.
* We don't use HOC anymore, so we just want to use new I18n context with new locales
*/
export default withLocales(locales)
3 changes: 2 additions & 1 deletion react/ActionsMenu/Actions/modify.js
Expand Up @@ -26,7 +26,8 @@ export const modify = () => {
window.open(webLink, '_blank')
},
Component: withActionsLocales(
forwardRef(({ t, ...props }, ref) => {
// eslint-disable-next-line no-unused-vars
forwardRef(({ t, f, lang, ...props }, ref) => {
return (
<ActionsMenuItem ref={ref} {...props}>
<ListItemIcon>
Expand Down
3 changes: 2 additions & 1 deletion react/ActionsMenu/Actions/smsTo.js
Expand Up @@ -15,7 +15,8 @@ export const smsTo = () => {
!!phoneNumber && window.open(`sms:${phoneNumber}`, '_self')
},
Component: withActionsLocales(
forwardRef(({ t, ...props }, ref) => {
// eslint-disable-next-line no-unused-vars
forwardRef(({ t, f, lang, ...props }, ref) => {
return (
<ActionsMenuItem {...props} ref={ref}>
<ListItemIcon>
Expand Down
3 changes: 2 additions & 1 deletion react/ActionsMenu/Actions/viewInContacts.js
Expand Up @@ -26,7 +26,8 @@ export const viewInContacts = () => {
window.open(webLink, '_blank')
},
Component: withActionsLocales(
forwardRef(({ t, ...props }, ref) => {
// eslint-disable-next-line no-unused-vars
forwardRef(({ t, f, lang, ...props }, ref) => {
return (
<ActionsMenuItem ref={ref} {...props}>
<ListItemIcon>
Expand Down

0 comments on commit 4fa0cc0

Please sign in to comment.