From 60c23385433d2cb671df6ff9db972b338cc55e3c Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 6 Sep 2017 11:27:04 +0100 Subject: [PATCH 1/3] generic contextual menu for tooltip/responses Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../context_menus/GenericTextContextMenu.js | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/components/views/context_menus/GenericTextContextMenu.js diff --git a/src/components/views/context_menus/GenericTextContextMenu.js b/src/components/views/context_menus/GenericTextContextMenu.js new file mode 100644 index 00000000..7df52dc1 --- /dev/null +++ b/src/components/views/context_menus/GenericTextContextMenu.js @@ -0,0 +1,29 @@ +/* +Copyright 2015, 2016 OpenMarket Ltd + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +'use strict'; + +import React, {PropTypes} from 'react'; + +export default class GenericTextContextMenu extends React.Component { + static PropTypes = { + message: PropTypes.string.isRequired, + }; + + render() { + return
{ this.props.message }
; + } +} From 32ea675c9284622d3710a9ac970638e63a740863 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 6 Sep 2017 14:20:12 +0100 Subject: [PATCH 2/3] fix (C) header Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/context_menus/GenericTextContextMenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/context_menus/GenericTextContextMenu.js b/src/components/views/context_menus/GenericTextContextMenu.js index 7df52dc1..92cee781 100644 --- a/src/components/views/context_menus/GenericTextContextMenu.js +++ b/src/components/views/context_menus/GenericTextContextMenu.js @@ -1,5 +1,5 @@ /* -Copyright 2015, 2016 OpenMarket Ltd +Copyright 2017 Michael Telatynski <7t3chguy@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 2316f4230eb6f19081d2d0cc96baaf947dff4a2d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 13 Sep 2017 14:23:35 +0100 Subject: [PATCH 3/3] install and use prop-types over React.PropTypes Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- package.json | 1 + src/components/views/context_menus/GenericTextContextMenu.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index bc41791b..fba685d1 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "matrix-react-sdk": "0.10.2", "modernizr": "^3.1.0", "pako": "^1.0.5", + "prop-types": "^15.5.10", "react": "^15.6.0", "react-dnd": "^2.1.4", "react-dnd-html5-backend": "^2.1.2", diff --git a/src/components/views/context_menus/GenericTextContextMenu.js b/src/components/views/context_menus/GenericTextContextMenu.js index 92cee781..2319fe05 100644 --- a/src/components/views/context_menus/GenericTextContextMenu.js +++ b/src/components/views/context_menus/GenericTextContextMenu.js @@ -16,7 +16,8 @@ limitations under the License. 'use strict'; -import React, {PropTypes} from 'react'; +import React from 'react'; +import PropTypes from 'prop-types'; export default class GenericTextContextMenu extends React.Component { static PropTypes = {