olahol / react-social

Simple React components for social buttons (Facebook, Twitter and Pinterest) and social counts.
177 stars 60 forks source link

Truncate Twitter text automatically? #30

Closed slorber closed 6 years ago

slorber commented 8 years ago

Hi,

var msg = this.props.message === "" ?
        this.props.url : this.props.message + " " + this.props.url;

The url is shortened by twitter automatically and the size is always 23, so it makes sense to automatically truncate the message with a limit of (140 - 24) I think

olahol commented 8 years ago

Maybe, there is an argument for leaving it as it is as Twitter has made noises about abandoning the 140 character limit in the future, also overriding user input might surprise some people and lead to debugging headaches for them.

slorber commented 8 years ago

that's true, I'll implement this on my side