diff --git a/components/brave_extension/extension/brave_extension/components/controls/httpsUpgradesControl.tsx b/components/brave_extension/extension/brave_extension/components/controls/httpsUpgradesControl.tsx index baa461642925..f4d0925e780e 100644 --- a/components/brave_extension/extension/brave_extension/components/controls/httpsUpgradesControl.tsx +++ b/components/brave_extension/extension/brave_extension/components/controls/httpsUpgradesControl.tsx @@ -15,7 +15,7 @@ import { } from 'brave-ui/features/shields' // Group Components -import StaticList from '../list/static' +import HTTPSUpgrades from '../list/httpsUpgrades' // Locale import { getLocale } from '../../background/api/localeAPI' @@ -128,11 +128,10 @@ export default class HTTPSUpgradesControl extends React.PureComponent { connectionsUpgradedOpen && - diff --git a/components/brave_extension/extension/brave_extension/components/list/httpsUpgrades.tsx b/components/brave_extension/extension/brave_extension/components/list/httpsUpgrades.tsx new file mode 100644 index 000000000000..4834e4b21834 --- /dev/null +++ b/components/brave_extension/extension/brave_extension/components/list/httpsUpgrades.tsx @@ -0,0 +1,70 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +import * as React from 'react' + +import { + BlockedListHeader, + BlockedListSummary, + BlockedListContent, + BlockedListStatic, + BlockedListItem, + BlockedListFooter, + ArrowUpIcon, + Favicon, + SiteInfoText, + BlockedInfoRowStats, + BlockedListSummaryText, + ShieldsButton +} from 'brave-ui/features/shields' + +// Helpers +import { blockedResourcesSize } from '../../helpers/shieldsUtils' + +// Locale +import { getLocale } from '../../background/api/localeAPI' + +interface Props { + favicon: string + hostname: string + stats: number + list: Array + onClose?: (event?: React.MouseEvent) => void +} + +export default class HTTPSUpgrades extends React.PureComponent { + get statsDisplay (): string { + const { stats } = this.props + return blockedResourcesSize(stats) + } + + getHostname = (url: string): string => { + return new window.URL(url).hostname + } + + render () { + const { favicon, hostname, list, onClose } = this.props + return ( + + + + {hostname} + +
+ + + {this.statsDisplay} + {getLocale('connectionsUpgradedHTTPS')} + + + {list.map((item, index) => {this.getHostname(item)})} + +
+ + + +
+ ) + } +}