Skip to content

Commit 2d97581

Browse files
authored
Flatten tabs (#4883)
1 parent 7bfc42e commit 2d97581

File tree

24 files changed

+107
-150
lines changed

24 files changed

+107
-150
lines changed

packages/page-accounts/src/index.tsx

+5-7
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,11 @@ function AccountsApp ({ basePath, onStatusChange }: Props): React.ReactElement<P
3939
return (
4040
<main className='accounts--App'>
4141
<HelpOverlay md={basicMd as string} />
42-
<header>
43-
<Tabs
44-
basePath={basePath}
45-
hidden={(hasAccounts && !isIpfs) ? undefined : HIDDEN_ACC}
46-
items={tabsRef.current}
47-
/>
48-
</header>
42+
<Tabs
43+
basePath={basePath}
44+
hidden={(hasAccounts && !isIpfs) ? undefined : HIDDEN_ACC}
45+
items={tabsRef.current}
46+
/>
4947
<Switch>
5048
<Route path={`${basePath}/vanity`}>
5149
<Vanity

packages/page-addresses/src/index.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ function AddressesApp ({ basePath, onStatusChange }: Props): React.ReactElement<
2424

2525
return (
2626
<main>
27-
<header>
28-
<Tabs
29-
basePath={basePath}
30-
items={itemsRef.current}
31-
/>
32-
</header>
27+
<Tabs
28+
basePath={basePath}
29+
items={itemsRef.current}
30+
/>
3331
<Switch>
3432
<Route>
3533
<Contacts

packages/page-bounties/src/index.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@ function BountiesApp ({ basePath, className = '' }: Props): React.ReactElement<P
2828

2929
return (
3030
<main className={`bounties--App ${className}`}>
31-
<header>
32-
<Tabs
33-
basePath={basePath}
34-
items={itemsRef.current}
35-
/>
36-
</header>
31+
<Tabs
32+
basePath={basePath}
33+
items={itemsRef.current}
34+
/>
3735
<Bounties/>
3836
</main>
3937
);

packages/page-calendar/src/index.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,10 @@ function CalendarApp ({ basePath, className }: Props): React.ReactElement<Props>
116116

117117
return (
118118
<main className={className}>
119-
<header>
120-
<Tabs
121-
basePath={basePath}
122-
items={itemsRef.current}
123-
/>
124-
</header>
119+
<Tabs
120+
basePath={basePath}
121+
items={itemsRef.current}
122+
/>
125123
<div className='calendarFlex'>
126124
<Month
127125
hasNextMonth={hasNextMonth}

packages/page-claims/src/index.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,10 @@ function ClaimsApp ({ basePath }: Props): React.ReactElement<Props> {
187187

188188
return (
189189
<main>
190-
<header>
191-
<Tabs
192-
basePath={basePath}
193-
items={itemsRef.current}
194-
/>
195-
</header>
190+
<Tabs
191+
basePath={basePath}
192+
items={itemsRef.current}
193+
/>
196194
{!isOldClaimProcess && <Warning />}
197195
<h1>
198196
<Trans>Claim your <em>{TokenUnit.abbr}</em> tokens</Trans>

packages/page-contracts/src/index.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@ function ContractsApp ({ basePath, className = '' }: Props): React.ReactElement<
2525
return (
2626
<main className={`contracts--App ${className}`}>
2727
<HelpOverlay md={introMd as string} />
28-
<header>
29-
<Tabs
30-
basePath={basePath}
31-
items={itemsRef.current}
32-
/>
33-
</header>
28+
<Tabs
29+
basePath={basePath}
30+
items={itemsRef.current}
31+
/>
3432
<Contracts />
3533
</main>
3634
);

packages/page-council/src/index.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,10 @@ function CouncilApp ({ basePath, className }: Props): React.ReactElement<Props>
5252

5353
return (
5454
<main className={className}>
55-
<header>
56-
<Tabs
57-
basePath={basePath}
58-
items={items}
59-
/>
60-
</header>
55+
<Tabs
56+
basePath={basePath}
57+
items={items}
58+
/>
6159
<Switch>
6260
<Route path={`${basePath}/motions`}>
6361
<Motions

packages/page-democracy/src/index.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,10 @@ function DemocracyApp ({ basePath }: Props): React.ReactElement<Props> {
3838
return (
3939
<main className='democracy--App'>
4040
<HelpOverlay md={basicMd as string} />
41-
<header>
42-
<Tabs
43-
basePath={basePath}
44-
items={items}
45-
/>
46-
</header>
41+
<Tabs
42+
basePath={basePath}
43+
items={items}
44+
/>
4745
<Switch>
4846
<Route path={`${basePath}/dispatch`}>
4947
<Execute />

packages/page-explorer/src/index.tsx

+5-7
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,11 @@ function ExplorerApp ({ basePath, className }: Props): React.ReactElement<Props>
5353

5454
return (
5555
<main className={className}>
56-
<header>
57-
<Tabs
58-
basePath={basePath}
59-
hidden={api.query.babe ? undefined : HIDDESN_NOBABE}
60-
items={itemsRef.current}
61-
/>
62-
</header>
56+
<Tabs
57+
basePath={basePath}
58+
hidden={api.query.babe ? undefined : HIDDESN_NOBABE}
59+
items={itemsRef.current}
60+
/>
6361
<Switch>
6462
<Route path={`${basePath}/forks`}><Forks /></Route>
6563
<Route path={`${basePath}/query/:value`}><BlockInfo /></Route>

packages/page-extrinsics/src/index.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ function ExtrinsicsApp ({ basePath }: Props): React.ReactElement<Props> {
2121

2222
return (
2323
<main className='extrinsics--App'>
24-
<header>
25-
<Tabs
26-
basePath={basePath}
27-
items={itemsRef.current}
28-
/>
29-
</header>
24+
<Tabs
25+
basePath={basePath}
26+
items={itemsRef.current}
27+
/>
3028
<Selection />
3129
</main>
3230
);

packages/page-js/src/Playground.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,10 @@ function Playground ({ basePath, className = '' }: Props): React.ReactElement<Pr
234234

235235
return (
236236
<main className={`js--App ${className}`}>
237-
<header>
238-
<Tabs
239-
basePath={basePath}
240-
items={tabsRef.current}
241-
/>
242-
</header>
237+
<Tabs
238+
basePath={basePath}
239+
items={tabsRef.current}
240+
/>
243241
<section className='js--Selection'>
244242
<Dropdown
245243
className='js--Dropdown'

packages/page-parachains/src/index.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,10 @@ function ParachainsApp ({ basePath, className }: Props): React.ReactElement<Prop
4949

5050
return (
5151
<main className={className}>
52-
<header>
53-
<Tabs
54-
basePath={basePath}
55-
items={items}
56-
/>
57-
</header>
52+
<Tabs
53+
basePath={basePath}
54+
items={items}
55+
/>
5856
<Switch>
5957
<Route path={`${basePath}/auctions`}>
6058
<Auctions />

packages/page-poll/src/index.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,10 @@ function PollApp ({ basePath, className }: Props): React.ReactElement<Props> {
9696

9797
return (
9898
<main className={className}>
99-
<header>
100-
<Tabs
101-
basePath={basePath}
102-
items={itemsRef.current}
103-
/>
104-
</header>
99+
<Tabs
100+
basePath={basePath}
101+
items={itemsRef.current}
102+
/>
105103
<div className='pollContainer'>
106104
<div className='pollHeader'>
107105
<h1>{t('denomination vote')}</h1>

packages/page-rpc/src/index.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ function RpcApp ({ basePath }: Props): React.ReactElement<Props> {
2424

2525
return (
2626
<main className='toolbox--App'>
27-
<header>
28-
<Tabs
29-
basePath={basePath}
30-
items={itemsRef.current}
31-
/>
32-
</header>
27+
<Tabs
28+
basePath={basePath}
29+
items={itemsRef.current}
30+
/>
3331
<Switch>
3432
<Route><Rpc /></Route>
3533
</Switch>

packages/page-settings/src/Metadata/Extensions.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function Extensions ({ chainInfo, className }: Props): React.ReactElement<Props>
5757
{extensions
5858
? options.length !== 0 && (
5959
<>
60-
<tr>
60+
<tr className='noBorder'>
6161
<td>
6262
<Dropdown
6363
label={t<string>('upgradable extensions')}

packages/page-settings/src/index.tsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,11 @@ function SettingsApp ({ basePath, onStatusChange }: Props): React.ReactElement<P
5555
return (
5656
<main className='settings--App'>
5757
<HelpOverlay md={md as string} />
58-
<header>
59-
<Tabs
60-
basePath={basePath}
61-
hidden={hidden}
62-
items={items}
63-
/>
64-
</header>
58+
<Tabs
59+
basePath={basePath}
60+
hidden={hidden}
61+
items={items}
62+
/>
6563
<Switch>
6664
<Route path={`${basePath}/developer`}>
6765
<Developer
@@ -75,7 +73,9 @@ function SettingsApp ({ basePath, onStatusChange }: Props): React.ReactElement<P
7573
<Route path={`${basePath}/metadata`}>
7674
<Metadata />
7775
</Route>
78-
<Route component={General} />
76+
<Route>
77+
<General />
78+
</Route>
7979
</Switch>
8080
</main>
8181
);

packages/page-signing/src/index.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,10 @@ function SigningApp ({ basePath }: Props): React.ReactElement<Props> {
3434

3535
return (
3636
<main className='toolbox--App'>
37-
<header>
38-
<Tabs
39-
basePath={basePath}
40-
items={itemsRef.current}
41-
/>
42-
</header>
37+
<Tabs
38+
basePath={basePath}
39+
items={itemsRef.current}
40+
/>
4341
<Switch>
4442
<Route path={`${basePath}/hash`}><Hash /></Route>
4543
<Route path={`${basePath}/verify`}><Verify /></Route>

packages/page-society/src/index.tsx

+9-12
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function strikeSort (a: MapMember, b: MapMember): number {
3737
: 0;
3838
}
3939

40-
function secondarySort (a: MapMember, b: MapMember): number {
40+
function voterSort (a: MapMember, b: MapMember): number {
4141
const isVoterA = a.isCandidateVoter || a.member.isDefenderVoter;
4242
const isVoterB = b.isCandidateVoter || b.member.isDefenderVoter;
4343

@@ -60,7 +60,7 @@ function finalSort (a: MapMember, b: MapMember): number {
6060
: b.isFounder
6161
? 1
6262
: a.isSkeptic && b.isSkeptic
63-
? secondarySort(a, b)
63+
? voterSort(a, b)
6464
: a.isSkeptic
6565
? -1
6666
: b.isSkeptic
@@ -81,7 +81,7 @@ function getMapMembers (members: DeriveSocietyMember[], skeptics: string[], vote
8181
member
8282
}))
8383
.sort(({ member: a }, { member: b }) => (b.payouts.length - a.payouts.length) || b.strikes.cmp(a.strikes))
84-
.sort(secondarySort)
84+
.sort(voterSort)
8585
.sort(finalSort);
8686
}
8787

@@ -95,9 +95,8 @@ function SocietyApp ({ basePath, className }: Props): React.ReactElement<Props>
9595
const { candidates, skeptics, voters } = useVoters();
9696

9797
const mapMembers = useMemo(
98-
() => members && info && skeptics && voters
99-
? getMapMembers(members, skeptics, voters, info, api.consts.society.maxStrikes.mul(BN_TWO).div(BN_THREE))
100-
: undefined,
98+
() => members && info && skeptics && voters &&
99+
getMapMembers(members, skeptics, voters, info, api.consts.society.maxStrikes.mul(BN_TWO).div(BN_THREE)),
101100
[api, info, members, skeptics, voters]
102101
);
103102

@@ -120,12 +119,10 @@ function SocietyApp ({ basePath, className }: Props): React.ReactElement<Props>
120119

121120
return (
122121
<main className={className}>
123-
<header>
124-
<Tabs
125-
basePath={basePath}
126-
items={items}
127-
/>
128-
</header>
122+
<Tabs
123+
basePath={basePath}
124+
items={items}
125+
/>
129126
<Switch>
130127
<Route path={`${basePath}/candidates`}>
131128
<Candidates

packages/page-staking/src/index.tsx

+9-11
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,15 @@ function StakingApp ({ basePath, className = '' }: Props): React.ReactElement<Pr
100100
return (
101101
<main className={`staking--App ${className}`}>
102102
<HelpOverlay md={basicMd as string} />
103-
<header>
104-
<Tabs
105-
basePath={basePath}
106-
hidden={
107-
hasAccounts
108-
? undefined
109-
: HIDDEN_ACC
110-
}
111-
items={items}
112-
/>
113-
</header>
103+
<Tabs
104+
basePath={basePath}
105+
hidden={
106+
hasAccounts
107+
? undefined
108+
: HIDDEN_ACC
109+
}
110+
items={items}
111+
/>
114112
<Summary
115113
isVisible={pathname === basePath}
116114
stakingOverview={stakingOverview}

packages/page-storage/src/Selection/index.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,10 @@ function Selection ({ basePath, onAdd }: Props): React.ReactElement<Props> {
4646

4747
return (
4848
<>
49-
<header>
50-
<Tabs
51-
basePath={basePath}
52-
items={itemsRef.current}
53-
/>
54-
</header>
49+
<Tabs
50+
basePath={basePath}
51+
items={itemsRef.current}
52+
/>
5553
<Switch>
5654
<Route path={`${basePath}/constants`}><Consts onAdd={_onAdd} /></Route>
5755
<Route path={`${basePath}/raw`}><Raw onAdd={_onAdd} /></Route>

0 commit comments

Comments
 (0)