reflex
reflex copied to clipboard
Allowing any case style on all string built ins
pc.button( pc.icon(tag="MoonIcon"), on_click=pc.toggle_color_mode, ) has same behavior as pc.button( pc.icon(tag="moonicon"), on_click=pc.toggle_color_mode, ) so make it non case sensitive by using .lower() thanks and make sure to have this for any strings related to Pynecone
I'd like to work on this. Just need to know what specific components need to be changed under this
Hi thanks for taking a look at this, I think a good place to start is the icon component. Feel free to join the discord if you need any help or guidance, or post follow ups here
Hi thanks for taking a look at this, I think a good place to start is the icon component. Feel free to join the discord if you need any help or guidance, or post follow ups here
^ yea icon components and other places in code base where strings are used I feel non case sensitive should be used
This was a little more complicated to solve than I actually thought. The below code addition for icon.py
works in testing but doesn't feel rigorous enough. What do you think?
if "tag" not in props.keys():
raise AttributeError("Missing 'tag' keyword-argument for Icon")
else:
tag_keywords = [
"add", "allowed", "arrow", "back", "circle", "clock", "close", "down", "forward",
"handle", "icon", "left", "link", "off", "outline", "right", "sign", "two", "up"
]
props['tag'] = props['tag'].title()
for keyword in tag_keywords:
props['tag'] = re.sub(keyword, keyword.title(), props['tag'])
Seems fixed via #553 unless there are other areas that are unaddressed.
rx.icon(tag="RePeaT"),
is rendering correctly