microsoft / react-native-adaptivecards

React Native renderer for AdaptiveCards
https://microsoft.github.io/react-native-adaptivecards/
80 stars 21 forks source link

Styles should be case insensitive #48

Open vivekhumnabad opened 5 years ago

vivekhumnabad commented 5 years ago

sampleAdaptiveCard.txt

Please refer to attached text file which contains JSON I am trying out. this is not working..complete block is not showing up { "type": "TextBlock", "size": "Medium", "weight": "Bolder", "text": "Tell us about yourself" },

same if I change it to - { "type": "TextBlock", "size": "medium", "weight": "bolder", "text": "Tell us about yourself" },

shows up the text as expected.

The same issue exists with other params as well. For e.g -"email", "tel", "small", "default".

It should work irrespective of text case. I verified the same JSON with upper case text in https://adaptivecards.io/designer website and everything works perfectly and in react-native it misses out if we use upper case text.

vivekhumnabad commented 5 years ago

Any Update in this issue please..

vivekhumnabad commented 5 years ago
Screenshot 2019-06-26 at 9 37 25 pm

refer to attached screenshot ,currently verticalContentAlignement is accepting all styles will lower case.. I Tried adding CamelCase to this and it started working.

we are using the enums from the adaptive cards node.js lib https://github.com/microsoft/AdaptiveCards/blob/master/source/nodejs/adaptivecards/src/enums.ts

and we don't want to change enums there.

Any help would be appreciated. Thanks