/* * SonarQube * Copyright (C) 2009-2021 SonarSource SA * mailto:info AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; import { Link } from 'react-router'; import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { getBaseUrl } from 'sonar-ui-common/helpers/urls'; import { isSonarCloud } from '../../../helpers/system'; import ProductNewsMenuItem from './ProductNewsMenuItem'; import { SuggestionsContext } from './SuggestionsContext'; interface Props { onClose: () => void; } export default class EmbedDocsPopup extends React.PureComponent { renderTitle(text: string) { return
  • {text}
  • ; } renderSuggestions = ({ suggestions }: { suggestions: T.SuggestionLink[] }) => { if (suggestions.length === 0) { return null; } return ( <> {this.renderTitle(translate('embed_docs.suggestion'))} {suggestions.map((suggestion, index) => (
  • {suggestion.text}
  • ))}
  • ); }; renderIconLink(link: string, icon: string, text: string) { return ( {text} {text} ); } renderSonarCloudLinks() { return ( <>
  • {translate('embed_docs.get_help')}
  • {this.renderTitle(translate('embed_docs.stay_connected'))}
  • {this.renderIconLink( 'https://twitter.com/sonarcloud', 'embed-doc/twitter-icon.svg', 'Twitter' )}
  • {this.renderIconLink( 'https://blog.sonarsource.com/product/SonarCloud', 'sonarcloud-square-logo.svg', translate('embed_docs.blog') )}
  • ); } renderSonarQubeLinks() { return ( <>
  • {translate('embed_docs.get_help')}
  • {this.renderTitle(translate('embed_docs.stay_connected'))}
  • {this.renderIconLink( 'https://www.sonarqube.org/whats-new/?referrer=sonarqube', 'embed-doc/sq-icon.svg', translate('embed_docs.news') )}
  • {this.renderIconLink( 'https://twitter.com/SonarQube', 'embed-doc/twitter-icon.svg', 'Twitter' )}
  • ); } render() { return ( ); } }