-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
chore: add lineSize prop to Burger #432
base: master
Are you sure you want to change the base?
chore: add lineSize prop to Burger #432
Conversation
Nice catch - can you please update the README too? 🙏 |
Updated! I'm still getting the error though for some reason. |
If you are getting the error, it's probably because it's not using the local build. After installing the requirments.txt be sure to install in editable mode:
Then when you do
|
Generated link: snehilvj/dash-mantine-components-432 |
Here's your sample app hosted on PyCafe Based on the Mantine Docs, the |
Ah I see, it's working now! |
I added a couple more requests to the issue since you started. Would you be up fo updating the component description and adding a test? |
Sure thing! I'm not quite sure how to add the tests though😅 |
Cool - check out the Contributing Guide for how to get started with testing, and see if you get get the current tests to run locally. This test will be very similar to the Popover test |
Just checking in. Let me know if you would like help getting the tests to run locally. If not, to finish up this pr, please add this file to the tests folder
from dash import Dash, html, Output, Input, _dash_renderer, callback
import dash_mantine_components as dmc
_dash_renderer._set_react_version("18.2.0")
def test_001bu_burger(dash_duo):
app = Dash(__name__)
app.layout = dmc.MantineProvider(
html.Div(
[dmc.Burger(id="burger-button", opened=False, lineSize=2, ), dmc.Text(id="burger-state", mt="md")]
)
)
@callback(Output("burger-state", "children"), Input("burger-button", "opened"))
def is_open(opened):
return str(opened)
dash_duo.start_server(app)
# Wait for the app to load
dash_duo.wait_for_text_to_equal("#burger-state", "False")
# Open Burger
burger = dash_duo.find_element("#burger-button")
burger.click()
# Verify the Burger opens when clicking the button
dash_duo.wait_for_text_to_equal("#burger-state", "True")
# Close Popover
burger.click()
# Verify the Burger closes when clicked again
dash_duo.wait_for_text_to_equal("#burger-state", "False")
assert dash_duo.get_logs() == []
|
Hi! Sorry, I did run into some errors installing ChromeDriver and never got round to resolving it. I've added the test file! |
@@ -17,6 +17,8 @@ interface Props | |||
size?: MantineSize | (string & {}) | number; | |||
/** Key of `theme.colors` of any valid CSS value, by default `theme.white` in dark color scheme and `theme.black` in light */ | |||
color?: MantineColor; | |||
/** Height of the burger lines */ | |||
lineSize?: string | number; |
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.
As @AnnMarieW commented:
Based on the Mantine Docs, the
lineSize
prop is a number. For examplelineSize=5
or as textlineSize="5"
but the Mantine named sizes likexl
is not valid
If named sizes like xl
are in fact valid, let's put one in the test. If not, let's remove string |
here.
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.
It doesn't work with the named sizes. I tried it in a code sandbox with the Mantine react component too, and it can either be lineSize={5}
or lineSize="5"
but nothing renders if you do lineSize="sm"
@ChinoUkaegbu would you like to update to the prop so it's just
lineSize?: number;
Part of #428
I tried using this code for the example:
But I'm getting this error: