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

How to set MUI breakpoint values #1856

Open
dosier opened this issue Nov 18, 2022 · 5 comments
Open

How to set MUI breakpoint values #1856

dosier opened this issue Nov 18, 2022 · 5 comments
Assignees

Comments

@dosier
Copy link

dosier commented Nov 18, 2022

Hi, I am trying to convert the following code:

<Grid container spacing={3}>
  <Grid xs="auto">
    <Item>variable width content</Item>
  </Grid>
  <Grid xs={6}>
    <Item>xs=6</Item>
  </Grid>
  <Grid xs>
    <Item>xs</Item>
  </Grid>
</Grid> 

to Kotlin using kotlin-mui.

The issue I am having is that I don't know how to set the value for the xs breakpoint.

@turansky
Copy link
Collaborator

WA

inline var GridProps.xs: Any?
    get() = asDynamic().xs
    set(value) = asDynamic().xs = value

@mattdornfeld
Copy link

mattdornfeld commented Jul 2, 2023

Get the following error when I try the above

Assignments are not expressions, and only expressions are allowed in this context

This works though

inline var GridProps.xs: Any?
    get() = asDynamic().xs
    set(value) {
        asDynamic().xs = value
    }

@ArjenKellerICS
Copy link

ArjenKellerICS commented Jul 10, 2023

I have these extensions now for GridProps

inline var GridProps.xs: Int
    get() = throw NotImplementedError("Prop is write-only!")
    set(value) {
        asDynamic().xs = value
    }

inline var GridProps.justifyContent: String
    get() = throw NotImplementedError("Prop is write-only!")
    set(value) {
        asDynamic().justifyContent = value
    }

inline var GridProps.alignItems: String
    get() = throw NotImplementedError("Prop is write-only!")
    set(value) {
        asDynamic().alignItems = value
  

@turansky
Copy link
Collaborator

turansky commented Jul 10, 2023

Expected extensions:

inline var GridProps.justifyContent: JustifyContent
    get() = asDynamic().justifyContent
    set(value) {
        asDynamic().justifyContent = value
    }

inline var GridProps.alignItems: AlignItems
    get() = asDynamic().alignItems
    set(value) {
        asDynamic().alignItems = value

@shubhamsinghshubham777
Copy link

Is there a plan to include these extensions in the library?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants