Multiline Text ellipsis component
Hide description content (not just single line, but multiline)
Requirements:
-
add story with different examples - different amount of lines
- different amount of words
- maybe different orientation (Left to right / right to left)?
-
Use only CSS if possible. (Multiline css is a bit complicated, use a pre-existing node module (maybe https://reactjsexample.com/cross-browser-multiline-text-ellipsis-for-react/ ?) or something proven to work in all browsers with least amount of javascript)
Needed props:
- description: Text with possibly very long content
- locShowMore: localized "show more" string, which should be passed from outside (do not hardcode values!)
- (optional): how many lines should be allowed
- (optional): expansion handler
Functionality:
- If description text has many characters/words, have a way to set text ellipsis on multiple lines. Show only x amount of words or characters on default render
- Allow to show whole description on clicking or touching "Show more" text.