-
Notifications
You must be signed in to change notification settings - Fork 17
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
Make container ID as optional prop #110
base: main
Are you sure you want to change the base?
Conversation
Olá @luisguerra, assim que possível faremos a revisão e teste das alterações. |
@luisguerra obrigado por contribuir com o projeto, excelente sugestão. Tenho só um ponto que penso que podemos alterar. O nome da propriedade Como é um elemento customizado do React não teria conflito com outras propriedades. Além de ser padrão a utilização somente da prop O que você acha? Podemos mudar esse nome da prop para ser mais consistente no futuro? Alterando isso a gente já aprova o PR 😄 |
src/bricks/brand/index.tsx
Outdated
onReady = onReadyDefault, | ||
customization, | ||
locale, | ||
divId = 'brandBrick_container', |
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.
divId = 'brandBrick_container', | |
id = 'brandBrick_container', |
src/bricks/brand/index.tsx
Outdated
@@ -50,7 +55,7 @@ const Brand = ({ onReady = onReadyDefault, customization, locale }: TBrand) => { | |||
window.brandBrickController?.unmount(); | |||
}; | |||
}, [customization, onReady]); | |||
return <div id="brandBrick_container"></div>; | |||
return <div id={divId}></div>; |
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.
return <div id={divId}></div>; | |
return <div id={id}></div>; |
src/bricks/brand/brand.test.tsx
Outdated
valueProp: 'payment_methods_logos', | ||
}, | ||
}} | ||
divId="customBrandBrick_container" |
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.
divId="customBrandBrick_container" | |
id="customBrandBrick_container" |
src/bricks/brand/index.tsx
Outdated
@@ -37,7 +42,7 @@ const Brand = ({ onReady = onReadyDefault, customization, locale }: TBrand) => { | |||
}, | |||
}, | |||
name: 'brand', | |||
divId: 'brandBrick_container', | |||
divId, |
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.
divId, | |
divId: id, |
src/bricks/brand/types.ts
Outdated
/** | ||
* Optional. Container ID where the Brick will be rendered. Default: 'walletBrick_container' | ||
*/ | ||
divId?: string; |
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.
divId?: string; | |
id?: string; |
(Sorry I don't speak Portuguese 😅 , hello From Mexico, so I will write in English) |
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.
Hello @luisguerra,
I have tested the changes and it looks great, there's only a few changes needed, it seems that the default values in the comments are all referencing wallet brick.
After this fix, I think that we are ready to merge!
@@ -18,6 +18,10 @@ export type TBrand = { | |||
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/additional-content/select-language Bricks language customization} documentation. | |||
*/ | |||
locale?: 'es-AR' | 'es-CL' | 'es-CO' | 'es-MX' | 'es-VE' | 'es-UY' | 'es-PE' | 'pt-BR' | 'en-US'; | |||
/** | |||
* Optional. Container ID where the Brick will be rendered. Default: 'walletBrick_container' |
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.
* Optional. Container ID where the Brick will be rendered. Default: 'walletBrick_container' | |
* Optional. Container ID where the Brick will be rendered. Default: 'brandBrick_container' |
@@ -100,6 +100,10 @@ export type TCardPayment = { | |||
*/ | |||
visual?: object; | |||
}; | |||
/** | |||
* Optional. Container ID where the Brick will be rendered. Default: 'walletBrick_container' |
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.
* Optional. Container ID where the Brick will be rendered. Default: 'walletBrick_container' | |
* Optional. Container ID where the Brick will be rendered. Default: 'cardPaymentBrick_container' |
@@ -97,6 +97,10 @@ export type TPaymentType = { | |||
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/additional-content/select-language General Customizations # Select Language} documentation. | |||
*/ | |||
locale?: string; | |||
/** | |||
* Optional. Container ID where the Brick will be rendered. Default: 'walletBrick_container' |
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.
* Optional. Container ID where the Brick will be rendered. Default: 'walletBrick_container' | |
* Optional. Container ID where the Brick will be rendered. Default: 'paymentBrick_container' |
@@ -28,6 +28,10 @@ export interface IStatusScreenBrickSettings extends IStatusScreenBrickCallbacks | |||
* @see {@link https://www.mercadopago.com/developers/en/docs/checkout-bricks/additional-content/select-language General Customization # Select Language} documentation. | |||
*/ | |||
locale?: 'es-AR' | 'es-CL' | 'es-CO' | 'es-MX' | 'es-VE' | 'es-UY' | 'es-PE' | 'pt-BR' | 'en-US'; | |||
/** | |||
* Optional. Container ID where the Brick will be rendered. Default: 'walletBrick_container' |
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.
* Optional. Container ID where the Brick will be rendered. Default: 'walletBrick_container' | |
* Optional. Container ID where the Brick will be rendered. Default: 'statusScreenBrick_container' |
@luisguerra hey, could you please check @AleFossati comments? Thank you a lot! |
This PR enables the ability to modify the div to avoid collision with existing ID's or define multiple elements