From ededbe1bef80f7bd46bb8e26fcccd88faa216844 Mon Sep 17 00:00:00 2001 From: Elinor Date: Mon, 15 Feb 2021 13:12:16 +0300 Subject: [PATCH] Fix: Graph Explorer link colors (#846) * add fullstop * change blueMid colour * change link colour * use classNames to style components * change link colour on high contrast mode * revert to blueMid colour * add weak types workaround * use classNames to style components * remove style prop * add ts-ignore rule --- .../views/app-sections/TermsOfUseMessage.tsx | 6 ++--- src/app/views/classnames.ts | 1 + .../adaptive-cards/AdaptiveCard.tsx | 25 ++++++++----------- .../graph-toolkit/GraphToolkit.tsx | 17 +++++++------ .../query-response/queryResponse.styles.ts | 2 +- src/themes/dark.ts | 2 +- src/themes/high-contrast.ts | 2 +- 7 files changed, 28 insertions(+), 27 deletions(-) diff --git a/src/app/views/app-sections/TermsOfUseMessage.tsx b/src/app/views/app-sections/TermsOfUseMessage.tsx index fd9237e03..f864b9bf4 100644 --- a/src/app/views/app-sections/TermsOfUseMessage.tsx +++ b/src/app/views/app-sections/TermsOfUseMessage.tsx @@ -11,12 +11,12 @@ export function termsOfUseMessage(termsOfUse: any, actions: any, classes: any, l telemetry.trackLinkClickEvent(e.currentTarget.href, componentNames.MICROSOFT_APIS_TERMS_OF_USE_LINK)} className={classes.links} href={'https://docs.microsoft.com/' + language + - '/legal/microsoft-apis/terms-of-use?context=graph/context'} target='_blank' rel='noopener noreferrer'> + '/legal/microsoft-apis/terms-of-use?context=graph/context'} target='_blank' rel='noopener noreferrer'> . - telemetry.trackLinkClickEvent(e.currentTarget.href, componentNames.MICROSOFT_PRIVACY_STATEMENT_LINK)} + telemetry.trackLinkClickEvent(e.currentTarget.href, componentNames.MICROSOFT_PRIVACY_STATEMENT_LINK)} className={classes.links} href={'https://privacy.microsoft.com/' + language + '/privacystatement'} target='_blank' rel='noopener noreferrer'> - + . ); } diff --git a/src/app/views/classnames.ts b/src/app/views/classnames.ts index 059a4c700..6f753c86e 100644 --- a/src/app/views/classnames.ts +++ b/src/app/views/classnames.ts @@ -1,6 +1,7 @@ import { classNamesFunction, ITheme } from 'office-ui-fabric-react'; interface IClassNames { + [prop: string]: unknown; theme?: ITheme; styles?: object; } diff --git a/src/app/views/query-response/adaptive-cards/AdaptiveCard.tsx b/src/app/views/query-response/adaptive-cards/AdaptiveCard.tsx index 5d986ae67..196d97599 100644 --- a/src/app/views/query-response/adaptive-cards/AdaptiveCard.tsx +++ b/src/app/views/query-response/adaptive-cards/AdaptiveCard.tsx @@ -1,6 +1,5 @@ -import { getTheme } from '@uifabric/styling/lib/styles/theme'; import * as AdaptiveCardsAPI from 'adaptivecards'; -import { IconButton, Label, MessageBar, MessageBarType, Pivot, PivotItem } from 'office-ui-fabric-react'; +import { IconButton, Label, MessageBar, MessageBarType, Pivot, PivotItem, styled } from 'office-ui-fabric-react'; import React, { Component } from 'react'; import { FormattedMessage, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; @@ -10,6 +9,7 @@ import { componentNames, telemetry } from '../../../../telemetry'; import { IAdaptiveCardProps } from '../../../../types/adaptivecard'; import { getAdaptiveCard } from '../../../services/actions/adaptive-cards-action-creator'; import { translateMessage } from '../../../utils/translate-messages'; +import { classNames } from '../../classnames'; import { Monaco } from '../../common'; import { genericCopy } from '../../common/copy'; import { queryResponseStyles } from './../queryResponse.styles'; @@ -58,13 +58,9 @@ class AdaptiveCard extends Component { } public render() { - const currentTheme = getTheme(); - const labelStyles = queryResponseStyles(currentTheme).emptyStateLabel; - const link = queryResponseStyles(currentTheme).link; - const cardStyles: any = queryResponseStyles(currentTheme).card; - const copyIcon: any = queryResponseStyles(currentTheme).copyIcon; const { data, pending } = this.props.card; const { body, queryStatus } = this.props; + const classes = classNames(this.props); if (!body) { return
; @@ -72,7 +68,7 @@ class AdaptiveCard extends Component { if (body && pending) { return ( -