Skip to content

Commit a4ee25e

Browse files
authored
fix(props): ensure fluidOnMobile passes through (#135)
1 parent 0727905 commit a4ee25e

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/utils/mjml-component-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function convertPropsToMjmlAttributes<P>(props: {
3434
return mjmlProps;
3535
}
3636

37-
const booleanToString = ["inline", "full-width"];
37+
const booleanToString = ["inline", "full-width", "fluid-on-mobile"];
3838
const numberToPixel = [
3939
"width",
4040
"height",

test/mjml-props.test.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ describe("mjml components prop values", () => {
3030
).toBe(`<mj-raw i-am-not-a-prop="random"></mj-raw>`);
3131
});
3232

33-
it("fullWidth and inline props convert to string", () => {
33+
it("fullWidth, inline, and fluidOnMobile props convert to string", () => {
3434
expect(renderToMjml(<mjmlComponents.MjmlSection fullWidth />)).toBe(
3535
`<mj-section full-width="full-width"></mj-section>`
3636
);
3737
expect(renderToMjml(<mjmlComponents.MjmlStyle inline />)).toBe(
3838
`<mj-style inline="inline"></mj-style>`
3939
);
40+
expect(renderToMjml(<mjmlComponents.MjmlImage fluidOnMobile />)).toBe(
41+
`<mj-image fluid-on-mobile="fluid-on-mobile"></mj-image>`
42+
);
4043
});
4144

4245
it("enum prop type accepts all enum values", () => {

0 commit comments

Comments
 (0)