From 034681aa62248c3af0c6f6fc8c6777756be64a55 Mon Sep 17 00:00:00 2001 From: Krzysztof Kotlarski Date: Wed, 6 Jan 2016 19:39:03 +0100 Subject: [PATCH] Add SMS button --- react-social.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/react-social.js b/react-social.js index 07a2ede..4b7ecaf 100644 --- a/react-social.js +++ b/react-social.js @@ -322,5 +322,19 @@ } }); + exports.SmsButton = React.createClass({ + mixins: [Button] + + , constructUrl: function () { + var body = encodeURIComponent(this.props.message); + body += (body ? ' ' : '') + encodeURIComponent(this.props.url); + + return [ + "sms:?&body=" + body, + "_self" + ] + } + }); + return exports; });