@plusscommunities/pluss-circles-web 1.0.17-beta.0 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1578,6 +1578,17 @@ var Circle = /*#__PURE__*/function (_Component) {
1578
1578
  });
1579
1579
  });
1580
1580
 
1581
+ _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onReply", function (m) {
1582
+ _this.setState({
1583
+ replyingTo: m
1584
+ });
1585
+
1586
+ if (m) {
1587
+ var input = document.getElementById('messageInput');
1588
+ if (input) input.focus();
1589
+ }
1590
+ });
1591
+
1581
1592
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "handleMessageDateChange", function (date) {
1582
1593
  _this.setState({
1583
1594
  messageDate: date,
@@ -1649,6 +1660,10 @@ var Circle = /*#__PURE__*/function (_Component) {
1649
1660
  return;
1650
1661
  }
1651
1662
 
1663
+ if (_this.state.replyingTo) {
1664
+ message.replyingTo = _this.state.replyingTo;
1665
+ }
1666
+
1652
1667
  var clonedMessage = ___default['default'].cloneDeep(message);
1653
1668
 
1654
1669
  clonedMessage.uploading = true;
@@ -1671,6 +1686,8 @@ var Circle = /*#__PURE__*/function (_Component) {
1671
1686
  });
1672
1687
 
1673
1688
  setTimeout(function () {
1689
+ _this.onReply(null);
1690
+
1674
1691
  _this.scrollToBottom();
1675
1692
 
1676
1693
  _this.imageInput && _this.imageInput.getWrappedInstance().setValue(null);
@@ -1688,7 +1705,8 @@ var Circle = /*#__PURE__*/function (_Component) {
1688
1705
  messages: [],
1689
1706
  images: [],
1690
1707
  files: [],
1691
- membersExpanded: true
1708
+ membersExpanded: true,
1709
+ replyingTo: null
1692
1710
  };
1693
1711
  return _this;
1694
1712
  }
@@ -1861,6 +1879,8 @@ var Circle = /*#__PURE__*/function (_Component) {
1861
1879
  }, {
1862
1880
  key: "renderMessage",
1863
1881
  value: function renderMessage(m) {
1882
+ var _this6 = this;
1883
+
1864
1884
  if (m.system) {
1865
1885
  return /*#__PURE__*/React__default['default'].createElement("div", {
1866
1886
  key: m._id,
@@ -1889,7 +1909,12 @@ var Circle = /*#__PURE__*/function (_Component) {
1889
1909
  }, /*#__PURE__*/React__default['default'].createElement(Components$1.Text, {
1890
1910
  type: "body",
1891
1911
  className: "message_name"
1892
- }, m.user.name), /*#__PURE__*/React__default['default'].createElement("div", {
1912
+ }, m.user.name, m.replyingTo ? " replied to ".concat(m.replyingTo.user.name) : ''), m.replyingTo && /*#__PURE__*/React__default['default'].createElement("div", {
1913
+ className: "message_replyBubble"
1914
+ }, /*#__PURE__*/React__default['default'].createElement(Components$1.Text, {
1915
+ type: "body",
1916
+ className: "message_text"
1917
+ }, Helper.toParagraphed((m.replyingTo.text || '').substr(0, 100)))), /*#__PURE__*/React__default['default'].createElement("div", {
1893
1918
  className: "message_bubble"
1894
1919
  }, /*#__PURE__*/React__default['default'].createElement(Components$1.Text, {
1895
1920
  type: "body",
@@ -1910,7 +1935,14 @@ var Circle = /*#__PURE__*/function (_Component) {
1910
1935
  key: i,
1911
1936
  white: isSelf
1912
1937
  });
1913
- }))))));
1938
+ }))), /*#__PURE__*/React__default['default'].createElement("div", {
1939
+ className: "message_reply"
1940
+ }, /*#__PURE__*/React__default['default'].createElement(Components$1.Text, {
1941
+ type: "button",
1942
+ onClick: function onClick() {
1943
+ _this6.onReply(m);
1944
+ }
1945
+ }, "Reply")))));
1914
1946
  }
1915
1947
  }, {
1916
1948
  key: "renderHeaderRight",
@@ -2006,10 +2038,39 @@ var Circle = /*#__PURE__*/function (_Component) {
2006
2038
  });
2007
2039
  }))));
2008
2040
  }
2041
+ }, {
2042
+ key: "renderReplyTo",
2043
+ value: function renderReplyTo() {
2044
+ var _this7 = this;
2045
+
2046
+ if (!this.state.replyingTo) {
2047
+ return null;
2048
+ }
2049
+
2050
+ var m = this.state.replyingTo;
2051
+ return /*#__PURE__*/React__default['default'].createElement("div", {
2052
+ className: "chat_replyTo"
2053
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
2054
+ className: "chat_replyTo_container"
2055
+ }, /*#__PURE__*/React__default['default'].createElement(Components$1.Text, {
2056
+ type: "h5"
2057
+ }, "Replying to ", m && m.user && !___default['default'].isEmpty(m.user.displayName) ? m.user.displayName : ''), m && !___default['default'].isEmpty(m.text) && /*#__PURE__*/React__default['default'].createElement(Components$1.Text, {
2058
+ type: "body"
2059
+ }, m.text.substr(0, 50))), /*#__PURE__*/React__default['default'].createElement("div", {
2060
+ className: "chat_replyTo_remove"
2061
+ }, /*#__PURE__*/React__default['default'].createElement(Components$1.SVGIcon, {
2062
+ className: "removeIcon",
2063
+ icon: "close",
2064
+ onClick: function onClick() {
2065
+ _this7.onReply(null);
2066
+ },
2067
+ colour: Colours$1.COLOUR_DUSK
2068
+ })));
2069
+ }
2009
2070
  }, {
2010
2071
  key: "render",
2011
2072
  value: function render() {
2012
- var _this6 = this;
2073
+ var _this8 = this;
2013
2074
 
2014
2075
  return /*#__PURE__*/React__default['default'].createElement(Components$1.OverlayPage, {
2015
2076
  fullPage: true,
@@ -2046,8 +2107,8 @@ var Circle = /*#__PURE__*/function (_Component) {
2046
2107
  value: this.state.messageDateText,
2047
2108
  readOnly: true,
2048
2109
  onClick: function onClick() {
2049
- return _this6.setState({
2050
- showMessageDate: !_this6.state.showMessageDate
2110
+ return _this8.setState({
2111
+ showMessageDate: !_this8.state.showMessageDate
2051
2112
  });
2052
2113
  },
2053
2114
  rightContent: !___default['default'].isEmpty(this.state.messageDate) && /*#__PURE__*/React__default['default'].createElement(Components$1.SVGIcon, {
@@ -2064,13 +2125,13 @@ var Circle = /*#__PURE__*/function (_Component) {
2064
2125
  className: "chat"
2065
2126
  }, /*#__PURE__*/React__default['default'].createElement("div", {
2066
2127
  className: "chat_newMessage"
2067
- }, this.renderChatInput()), /*#__PURE__*/React__default['default'].createElement("div", {
2128
+ }, this.renderChatInput()), this.renderReplyTo(), /*#__PURE__*/React__default['default'].createElement("div", {
2068
2129
  ref: function ref(_ref6) {
2069
- return _this6.chat = _ref6;
2130
+ return _this8.chat = _ref6;
2070
2131
  },
2071
2132
  className: "chat_messages"
2072
2133
  }, ___default['default'].isEmpty(this.state.messages) && !___default['default'].isEmpty(this.state.messageDate) && this.renderEmptyDate(), this.state.messages.map(function (m) {
2073
- return _this6.renderMessage(m);
2134
+ return _this8.renderMessage(m);
2074
2135
  }))))));
2075
2136
  }
2076
2137
  }]);
package/dist/index.esm.js CHANGED
@@ -1536,6 +1536,17 @@ var Circle = /*#__PURE__*/function (_Component) {
1536
1536
  });
1537
1537
  });
1538
1538
 
1539
+ _defineProperty(_assertThisInitialized(_this), "onReply", function (m) {
1540
+ _this.setState({
1541
+ replyingTo: m
1542
+ });
1543
+
1544
+ if (m) {
1545
+ var input = document.getElementById('messageInput');
1546
+ if (input) input.focus();
1547
+ }
1548
+ });
1549
+
1539
1550
  _defineProperty(_assertThisInitialized(_this), "handleMessageDateChange", function (date) {
1540
1551
  _this.setState({
1541
1552
  messageDate: date,
@@ -1607,6 +1618,10 @@ var Circle = /*#__PURE__*/function (_Component) {
1607
1618
  return;
1608
1619
  }
1609
1620
 
1621
+ if (_this.state.replyingTo) {
1622
+ message.replyingTo = _this.state.replyingTo;
1623
+ }
1624
+
1610
1625
  var clonedMessage = _.cloneDeep(message);
1611
1626
 
1612
1627
  clonedMessage.uploading = true;
@@ -1629,6 +1644,8 @@ var Circle = /*#__PURE__*/function (_Component) {
1629
1644
  });
1630
1645
 
1631
1646
  setTimeout(function () {
1647
+ _this.onReply(null);
1648
+
1632
1649
  _this.scrollToBottom();
1633
1650
 
1634
1651
  _this.imageInput && _this.imageInput.getWrappedInstance().setValue(null);
@@ -1646,7 +1663,8 @@ var Circle = /*#__PURE__*/function (_Component) {
1646
1663
  messages: [],
1647
1664
  images: [],
1648
1665
  files: [],
1649
- membersExpanded: true
1666
+ membersExpanded: true,
1667
+ replyingTo: null
1650
1668
  };
1651
1669
  return _this;
1652
1670
  }
@@ -1819,6 +1837,8 @@ var Circle = /*#__PURE__*/function (_Component) {
1819
1837
  }, {
1820
1838
  key: "renderMessage",
1821
1839
  value: function renderMessage(m) {
1840
+ var _this6 = this;
1841
+
1822
1842
  if (m.system) {
1823
1843
  return /*#__PURE__*/React.createElement("div", {
1824
1844
  key: m._id,
@@ -1847,7 +1867,12 @@ var Circle = /*#__PURE__*/function (_Component) {
1847
1867
  }, /*#__PURE__*/React.createElement(Components$1.Text, {
1848
1868
  type: "body",
1849
1869
  className: "message_name"
1850
- }, m.user.name), /*#__PURE__*/React.createElement("div", {
1870
+ }, m.user.name, m.replyingTo ? " replied to ".concat(m.replyingTo.user.name) : ''), m.replyingTo && /*#__PURE__*/React.createElement("div", {
1871
+ className: "message_replyBubble"
1872
+ }, /*#__PURE__*/React.createElement(Components$1.Text, {
1873
+ type: "body",
1874
+ className: "message_text"
1875
+ }, Helper.toParagraphed((m.replyingTo.text || '').substr(0, 100)))), /*#__PURE__*/React.createElement("div", {
1851
1876
  className: "message_bubble"
1852
1877
  }, /*#__PURE__*/React.createElement(Components$1.Text, {
1853
1878
  type: "body",
@@ -1868,7 +1893,14 @@ var Circle = /*#__PURE__*/function (_Component) {
1868
1893
  key: i,
1869
1894
  white: isSelf
1870
1895
  });
1871
- }))))));
1896
+ }))), /*#__PURE__*/React.createElement("div", {
1897
+ className: "message_reply"
1898
+ }, /*#__PURE__*/React.createElement(Components$1.Text, {
1899
+ type: "button",
1900
+ onClick: function onClick() {
1901
+ _this6.onReply(m);
1902
+ }
1903
+ }, "Reply")))));
1872
1904
  }
1873
1905
  }, {
1874
1906
  key: "renderHeaderRight",
@@ -1964,10 +1996,39 @@ var Circle = /*#__PURE__*/function (_Component) {
1964
1996
  });
1965
1997
  }))));
1966
1998
  }
1999
+ }, {
2000
+ key: "renderReplyTo",
2001
+ value: function renderReplyTo() {
2002
+ var _this7 = this;
2003
+
2004
+ if (!this.state.replyingTo) {
2005
+ return null;
2006
+ }
2007
+
2008
+ var m = this.state.replyingTo;
2009
+ return /*#__PURE__*/React.createElement("div", {
2010
+ className: "chat_replyTo"
2011
+ }, /*#__PURE__*/React.createElement("div", {
2012
+ className: "chat_replyTo_container"
2013
+ }, /*#__PURE__*/React.createElement(Components$1.Text, {
2014
+ type: "h5"
2015
+ }, "Replying to ", m && m.user && !_.isEmpty(m.user.displayName) ? m.user.displayName : ''), m && !_.isEmpty(m.text) && /*#__PURE__*/React.createElement(Components$1.Text, {
2016
+ type: "body"
2017
+ }, m.text.substr(0, 50))), /*#__PURE__*/React.createElement("div", {
2018
+ className: "chat_replyTo_remove"
2019
+ }, /*#__PURE__*/React.createElement(Components$1.SVGIcon, {
2020
+ className: "removeIcon",
2021
+ icon: "close",
2022
+ onClick: function onClick() {
2023
+ _this7.onReply(null);
2024
+ },
2025
+ colour: Colours$1.COLOUR_DUSK
2026
+ })));
2027
+ }
1967
2028
  }, {
1968
2029
  key: "render",
1969
2030
  value: function render() {
1970
- var _this6 = this;
2031
+ var _this8 = this;
1971
2032
 
1972
2033
  return /*#__PURE__*/React.createElement(Components$1.OverlayPage, {
1973
2034
  fullPage: true,
@@ -2004,8 +2065,8 @@ var Circle = /*#__PURE__*/function (_Component) {
2004
2065
  value: this.state.messageDateText,
2005
2066
  readOnly: true,
2006
2067
  onClick: function onClick() {
2007
- return _this6.setState({
2008
- showMessageDate: !_this6.state.showMessageDate
2068
+ return _this8.setState({
2069
+ showMessageDate: !_this8.state.showMessageDate
2009
2070
  });
2010
2071
  },
2011
2072
  rightContent: !_.isEmpty(this.state.messageDate) && /*#__PURE__*/React.createElement(Components$1.SVGIcon, {
@@ -2022,13 +2083,13 @@ var Circle = /*#__PURE__*/function (_Component) {
2022
2083
  className: "chat"
2023
2084
  }, /*#__PURE__*/React.createElement("div", {
2024
2085
  className: "chat_newMessage"
2025
- }, this.renderChatInput()), /*#__PURE__*/React.createElement("div", {
2086
+ }, this.renderChatInput()), this.renderReplyTo(), /*#__PURE__*/React.createElement("div", {
2026
2087
  ref: function ref(_ref6) {
2027
- return _this6.chat = _ref6;
2088
+ return _this8.chat = _ref6;
2028
2089
  },
2029
2090
  className: "chat_messages"
2030
2091
  }, _.isEmpty(this.state.messages) && !_.isEmpty(this.state.messageDate) && this.renderEmptyDate(), this.state.messages.map(function (m) {
2031
- return _this6.renderMessage(m);
2092
+ return _this8.renderMessage(m);
2032
2093
  }))))));
2033
2094
  }
2034
2095
  }]);
package/dist/index.umd.js CHANGED
@@ -1560,6 +1560,17 @@
1560
1560
  });
1561
1561
  });
1562
1562
 
1563
+ _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "onReply", function (m) {
1564
+ _this.setState({
1565
+ replyingTo: m
1566
+ });
1567
+
1568
+ if (m) {
1569
+ var input = document.getElementById('messageInput');
1570
+ if (input) input.focus();
1571
+ }
1572
+ });
1573
+
1563
1574
  _defineProperty__default['default'](_assertThisInitialized__default['default'](_this), "handleMessageDateChange", function (date) {
1564
1575
  _this.setState({
1565
1576
  messageDate: date,
@@ -1631,6 +1642,10 @@
1631
1642
  return;
1632
1643
  }
1633
1644
 
1645
+ if (_this.state.replyingTo) {
1646
+ message.replyingTo = _this.state.replyingTo;
1647
+ }
1648
+
1634
1649
  var clonedMessage = ___default['default'].cloneDeep(message);
1635
1650
 
1636
1651
  clonedMessage.uploading = true;
@@ -1653,6 +1668,8 @@
1653
1668
  });
1654
1669
 
1655
1670
  setTimeout(function () {
1671
+ _this.onReply(null);
1672
+
1656
1673
  _this.scrollToBottom();
1657
1674
 
1658
1675
  _this.imageInput && _this.imageInput.getWrappedInstance().setValue(null);
@@ -1670,7 +1687,8 @@
1670
1687
  messages: [],
1671
1688
  images: [],
1672
1689
  files: [],
1673
- membersExpanded: true
1690
+ membersExpanded: true,
1691
+ replyingTo: null
1674
1692
  };
1675
1693
  return _this;
1676
1694
  }
@@ -1843,6 +1861,8 @@
1843
1861
  }, {
1844
1862
  key: "renderMessage",
1845
1863
  value: function renderMessage(m) {
1864
+ var _this6 = this;
1865
+
1846
1866
  if (m.system) {
1847
1867
  return /*#__PURE__*/React__default['default'].createElement("div", {
1848
1868
  key: m._id,
@@ -1871,7 +1891,12 @@
1871
1891
  }, /*#__PURE__*/React__default['default'].createElement(Components$1.Text, {
1872
1892
  type: "body",
1873
1893
  className: "message_name"
1874
- }, m.user.name), /*#__PURE__*/React__default['default'].createElement("div", {
1894
+ }, m.user.name, m.replyingTo ? " replied to ".concat(m.replyingTo.user.name) : ''), m.replyingTo && /*#__PURE__*/React__default['default'].createElement("div", {
1895
+ className: "message_replyBubble"
1896
+ }, /*#__PURE__*/React__default['default'].createElement(Components$1.Text, {
1897
+ type: "body",
1898
+ className: "message_text"
1899
+ }, Helper.toParagraphed((m.replyingTo.text || '').substr(0, 100)))), /*#__PURE__*/React__default['default'].createElement("div", {
1875
1900
  className: "message_bubble"
1876
1901
  }, /*#__PURE__*/React__default['default'].createElement(Components$1.Text, {
1877
1902
  type: "body",
@@ -1892,7 +1917,14 @@
1892
1917
  key: i,
1893
1918
  white: isSelf
1894
1919
  });
1895
- }))))));
1920
+ }))), /*#__PURE__*/React__default['default'].createElement("div", {
1921
+ className: "message_reply"
1922
+ }, /*#__PURE__*/React__default['default'].createElement(Components$1.Text, {
1923
+ type: "button",
1924
+ onClick: function onClick() {
1925
+ _this6.onReply(m);
1926
+ }
1927
+ }, "Reply")))));
1896
1928
  }
1897
1929
  }, {
1898
1930
  key: "renderHeaderRight",
@@ -1988,10 +2020,39 @@
1988
2020
  });
1989
2021
  }))));
1990
2022
  }
2023
+ }, {
2024
+ key: "renderReplyTo",
2025
+ value: function renderReplyTo() {
2026
+ var _this7 = this;
2027
+
2028
+ if (!this.state.replyingTo) {
2029
+ return null;
2030
+ }
2031
+
2032
+ var m = this.state.replyingTo;
2033
+ return /*#__PURE__*/React__default['default'].createElement("div", {
2034
+ className: "chat_replyTo"
2035
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
2036
+ className: "chat_replyTo_container"
2037
+ }, /*#__PURE__*/React__default['default'].createElement(Components$1.Text, {
2038
+ type: "h5"
2039
+ }, "Replying to ", m && m.user && !___default['default'].isEmpty(m.user.displayName) ? m.user.displayName : ''), m && !___default['default'].isEmpty(m.text) && /*#__PURE__*/React__default['default'].createElement(Components$1.Text, {
2040
+ type: "body"
2041
+ }, m.text.substr(0, 50))), /*#__PURE__*/React__default['default'].createElement("div", {
2042
+ className: "chat_replyTo_remove"
2043
+ }, /*#__PURE__*/React__default['default'].createElement(Components$1.SVGIcon, {
2044
+ className: "removeIcon",
2045
+ icon: "close",
2046
+ onClick: function onClick() {
2047
+ _this7.onReply(null);
2048
+ },
2049
+ colour: Colours$1.COLOUR_DUSK
2050
+ })));
2051
+ }
1991
2052
  }, {
1992
2053
  key: "render",
1993
2054
  value: function render() {
1994
- var _this6 = this;
2055
+ var _this8 = this;
1995
2056
 
1996
2057
  return /*#__PURE__*/React__default['default'].createElement(Components$1.OverlayPage, {
1997
2058
  fullPage: true,
@@ -2028,8 +2089,8 @@
2028
2089
  value: this.state.messageDateText,
2029
2090
  readOnly: true,
2030
2091
  onClick: function onClick() {
2031
- return _this6.setState({
2032
- showMessageDate: !_this6.state.showMessageDate
2092
+ return _this8.setState({
2093
+ showMessageDate: !_this8.state.showMessageDate
2033
2094
  });
2034
2095
  },
2035
2096
  rightContent: !___default['default'].isEmpty(this.state.messageDate) && /*#__PURE__*/React__default['default'].createElement(Components$1.SVGIcon, {
@@ -2046,13 +2107,13 @@
2046
2107
  className: "chat"
2047
2108
  }, /*#__PURE__*/React__default['default'].createElement("div", {
2048
2109
  className: "chat_newMessage"
2049
- }, this.renderChatInput()), /*#__PURE__*/React__default['default'].createElement("div", {
2110
+ }, this.renderChatInput()), this.renderReplyTo(), /*#__PURE__*/React__default['default'].createElement("div", {
2050
2111
  ref: function ref(_ref6) {
2051
- return _this6.chat = _ref6;
2112
+ return _this8.chat = _ref6;
2052
2113
  },
2053
2114
  className: "chat_messages"
2054
2115
  }, ___default['default'].isEmpty(this.state.messages) && !___default['default'].isEmpty(this.state.messageDate) && this.renderEmptyDate(), this.state.messages.map(function (m) {
2055
- return _this6.renderMessage(m);
2116
+ return _this8.renderMessage(m);
2056
2117
  }))))));
2057
2118
  }
2058
2119
  }]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-circles-web",
3
- "version": "1.0.17-beta.0",
3
+ "version": "1.0.17",
4
4
  "description": "Extension package to enable circles on Pluss Communities Platform",
5
5
  "main": "dist/index.cjs.js",
6
6
  "scripts": {
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@babel/runtime": "^7.14.0",
38
- "@plusscommunities/pluss-core-web": "1.4.14-beta.0",
38
+ "@plusscommunities/pluss-core-web": "1.4.17",
39
39
  "lodash": "^4.17.4",
40
40
  "moment": "^2.18.1",
41
41
  "react": "^16.14.0",
@@ -25,6 +25,7 @@ class Circle extends Component {
25
25
  images: [],
26
26
  files: [],
27
27
  membersExpanded: true,
28
+ replyingTo: null,
28
29
  };
29
30
  }
30
31
 
@@ -189,6 +190,16 @@ class Circle extends Component {
189
190
  });
190
191
  };
191
192
 
193
+ onReply = (m) => {
194
+ this.setState({
195
+ replyingTo: m,
196
+ });
197
+ if (m) {
198
+ const input = document.getElementById('messageInput');
199
+ if (input) input.focus();
200
+ }
201
+ };
202
+
192
203
  isMember() {
193
204
  const audience = this.getCircle().Audience || [];
194
205
  return _.some(audience, (u) => {
@@ -268,6 +279,10 @@ class Circle extends Component {
268
279
  return;
269
280
  }
270
281
 
282
+ if (this.state.replyingTo) {
283
+ message.replyingTo = this.state.replyingTo;
284
+ }
285
+
271
286
  const clonedMessage = _.cloneDeep(message);
272
287
  clonedMessage.uploading = true;
273
288
 
@@ -287,6 +302,7 @@ class Circle extends Component {
287
302
  fileInputShowing: false,
288
303
  });
289
304
  setTimeout(() => {
305
+ this.onReply(null);
290
306
  this.scrollToBottom();
291
307
  this.imageInput && this.imageInput.getWrappedInstance().setValue(null);
292
308
  this.fileInput && this.fileInput.getWrappedInstance().setValue(null);
@@ -391,7 +407,15 @@ class Circle extends Component {
391
407
  <div className="message_bubbleContainer">
392
408
  <Components.Text type="body" className="message_name">
393
409
  {m.user.name}
410
+ {m.replyingTo ? ` replied to ${m.replyingTo.user.name}` : ''}
394
411
  </Components.Text>
412
+ {m.replyingTo && (
413
+ <div className="message_replyBubble">
414
+ <Components.Text type="body" className="message_text">
415
+ {Helper.toParagraphed((m.replyingTo.text || '').substr(0, 100))}
416
+ </Components.Text>
417
+ </div>
418
+ )}
395
419
  <div className="message_bubble">
396
420
  <Components.Text type="body" className="message_text">
397
421
  {Helper.toParagraphed(m.text)}
@@ -411,6 +435,16 @@ class Circle extends Component {
411
435
  })}
412
436
  </div>
413
437
  </div>
438
+ <div className="message_reply">
439
+ <Components.Text
440
+ type="button"
441
+ onClick={() => {
442
+ this.onReply(m);
443
+ }}
444
+ >
445
+ Reply
446
+ </Components.Text>
447
+ </div>
414
448
  </div>
415
449
  </div>
416
450
  </div>
@@ -512,6 +546,31 @@ class Circle extends Component {
512
546
  );
513
547
  }
514
548
 
549
+ renderReplyTo() {
550
+ if (!this.state.replyingTo) {
551
+ return null;
552
+ }
553
+ const m = this.state.replyingTo;
554
+ return (
555
+ <div className="chat_replyTo">
556
+ <div className="chat_replyTo_container">
557
+ <Components.Text type="h5">Replying to {m && m.user && !_.isEmpty(m.user.displayName) ? m.user.displayName : ''}</Components.Text>
558
+ {m && !_.isEmpty(m.text) && <Components.Text type="body">{m.text.substr(0, 50)}</Components.Text>}
559
+ </div>
560
+ <div className="chat_replyTo_remove">
561
+ <Components.SVGIcon
562
+ className="removeIcon"
563
+ icon="close"
564
+ onClick={() => {
565
+ this.onReply(null);
566
+ }}
567
+ colour={Colours.COLOUR_DUSK}
568
+ />
569
+ </div>
570
+ </div>
571
+ );
572
+ }
573
+
515
574
  render() {
516
575
  return (
517
576
  <Components.OverlayPage fullPage fullPageStyle={{ display: 'flex', flexDirection: 'column' }}>
@@ -562,6 +621,7 @@ class Circle extends Component {
562
621
  </Components.Header>
563
622
  <div className="chat">
564
623
  <div className="chat_newMessage">{this.renderChatInput()}</div>
624
+ {this.renderReplyTo()}
565
625
  <div ref={(ref) => (this.chat = ref)} className="chat_messages">
566
626
  {_.isEmpty(this.state.messages) && !_.isEmpty(this.state.messageDate) && this.renderEmptyDate()}
567
627
  {this.state.messages.map((m) => {