-
-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathExtras.jsx
More file actions
43 lines (40 loc) · 1.27 KB
/
Extras.jsx
File metadata and controls
43 lines (40 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// @ts-check
import * as React from 'react'
import { PokestopDrawer } from './pokestops'
import { GymDrawer } from './gyms'
import { NestsDrawer } from './nests'
import { RoutesDrawer } from './Routes'
import { HyperlocalDrawer } from './Hyperlocal'
import { WayfarerDrawer } from './Wayfarer'
import { S2CellsDrawer } from './S2Cells'
import { AdminDrawer } from './Admin'
import { StationsDrawer } from './Stations'
function ExtrasComponent({ category, subItem }) {
switch (category) {
case 'nests':
return <NestsDrawer subItem={subItem} />
case 's2cells':
return <S2CellsDrawer subItem={subItem} />
case 'pokestops':
return <PokestopDrawer subItem={subItem} />
case 'gyms':
return <GymDrawer subItem={subItem} />
case 'wayfarer':
return <WayfarerDrawer subItem={subItem} />
case 'routes':
return <RoutesDrawer subItem={subItem} />
case 'hyperlocal':
return <HyperlocalDrawer subItem={subItem} />
case 'admin':
return <AdminDrawer subItem={subItem} />
case 'stations':
return subItem === 'maxBattles' && <StationsDrawer />
default:
return null
}
}
export const Extras = React.memo(
ExtrasComponent,
(prev, next) =>
prev.category === next.category && prev.subItem === next.subItem,
)