/* 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 from 'react'; import sdk from '../../../index'; import Modal from '../../../Modal'; import PlatformPeg from '../../../PlatformPeg'; import { _t } from '../../../languageHandler'; /** * Check a version string is compatible with the Changelog * dialog ([vectorversion]-react-[react-sdk-version]-js-[js-sdk-version]) */ function checkVersion(ver) { const parts = ver.split('-'); return parts.length == 5 && parts[1] == 'react' && parts[3] == 'js'; } export default React.createClass({ propTypes: { version: React.PropTypes.string.isRequired, newVersion: React.PropTypes.string.isRequired, releaseNotes: React.PropTypes.string, }, displayReleaseNotes: function(releaseNotes) { const QuestionDialog = sdk.getComponent('dialogs.QuestionDialog'); Modal.createTrackedDialog('Display release notes', '', QuestionDialog, { title: _t("What's New"), description: