diff --git a/packages/app-accounts/src/index.tsx b/packages/app-accounts/src/index.tsx index c14e6c6c53..9ff40c1ffb 100644 --- a/packages/app-accounts/src/index.tsx +++ b/packages/app-accounts/src/index.tsx @@ -101,7 +101,7 @@ class AccountsApp extends React.PureComponent { return (
- +
{ return (
- +
{ return (
- +
div { - max-width: 30rem; - } - } `; class Accounts extends React.PureComponent { @@ -72,7 +62,7 @@ class Accounts extends React.PureComponent { return ( -
+ { options={filterOptions} value={filter} /> -
+
{accounts.map((account) => { const address = account.address(); diff --git a/packages/app-staking/src/Overview/CurrentList.tsx b/packages/app-staking/src/Overview/CurrentList.tsx index c8c9c0d90d..b65618ee57 100644 --- a/packages/app-staking/src/Overview/CurrentList.tsx +++ b/packages/app-staking/src/Overview/CurrentList.tsx @@ -7,8 +7,7 @@ import { I18nProps } from '@polkadot/ui-app/types'; import { ValidatorFilter, RecentlyOfflineMap } from '../types'; import React from 'react'; -import styled from 'styled-components'; -import { Dropdown } from '@polkadot/ui-app'; +import { Dropdown, FilterOverlay } from '@polkadot/ui-app'; import translate from '../translate'; import Address from './Address'; @@ -27,18 +26,6 @@ type State = { filterOptions: Array<{ text: React.ReactNode, value: ValidatorFilter }> }; -const Wrapper = styled.div` - .filter { - display: flex; - justify-content: flex-end; - margin-bottom: 0.75rem; - - > div { - max-width: 35rem; - } - } -`; - class CurrentList extends React.PureComponent { state: State; @@ -64,8 +51,8 @@ class CurrentList extends React.PureComponent { const { t } = this.props; const { filter, filterOptions } = this.state; return ( - -
+
+ { options={filterOptions} value={filter} /> -
+
{this.renderCurrent()} @@ -82,7 +69,7 @@ class CurrentList extends React.PureComponent { {this.renderNext()}
- +
); } diff --git a/packages/app-transfer/src/index.tsx b/packages/app-transfer/src/index.tsx index 8adbacfba0..ebbede12c9 100644 --- a/packages/app-transfer/src/index.tsx +++ b/packages/app-transfer/src/index.tsx @@ -20,7 +20,7 @@ class App extends React.PureComponent { return (
- +
div { + max-width: 35rem; + } + + .ui--Labelled label { + display: none; + } + + ${media.DESKTOP` + .ui--Labelled label { + display: flex; + } + `} +`; + +export default class FilterOverlay extends React.PureComponent { + render () { + const { children } = this.props; + + return ( + + {children} + + ); + } +} diff --git a/packages/ui-app/src/index.tsx b/packages/ui-app/src/index.tsx index c4967c734b..17194d2d5f 100644 --- a/packages/ui-app/src/index.tsx +++ b/packages/ui-app/src/index.tsx @@ -16,6 +16,7 @@ export { default as Dropdown } from './Dropdown'; export { default as Editor } from './Editor'; export { default as Event } from './Event'; export { default as Extrinsic } from './Extrinsic'; +export { default as FilterOverlay } from './FilterOverlay'; export { default as HelpOverlay } from './HelpOverlay'; export { default as Icon } from './Icon'; export { default as IdentityIcon } from './IdentityIcon'; diff --git a/packages/ui-app/src/media.ts b/packages/ui-app/src/media.ts index 43ad869753..99390e3ec8 100644 --- a/packages/ui-app/src/media.ts +++ b/packages/ui-app/src/media.ts @@ -3,6 +3,7 @@ // of the Apache-2.0 license. See the LICENSE file for details. import { css } from 'styled-components'; + import { ScreenSizes } from './constants'; type MediaCss = {