Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit df46ba0

Browse files
committed
refactor(sidebar): dynamic load sortable menulist
1 parent 87a617f commit df46ba0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/containers/Sidebar/MenuList.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
import React from 'react'
2+
import dynamic from 'next/dynamic'
23
import R from 'ramda'
34

45
import MenuBar from './MenuBar'
56
import NormalMenuList from './NormalMenuList'
6-
import SortableMenuList from './SortableMenuList'
7+
// import SortableMenuList from './SortableMenuList'
78

89
import { Wrapper } from './styles/menu_list'
910
import { onSortMenuEnd } from './logic'
1011

12+
const DynamicSortableMenuList = dynamic({
13+
loader: () => import('./SortableMenuList'),
14+
/* eslint-disable */
15+
loading: () => <div>..</div>,
16+
/* eslint-enable */
17+
})
18+
1119
const MenuList = ({
1220
items,
1321
pin,
@@ -38,7 +46,7 @@ const MenuList = ({
3846
forceRerender={forceRerender}
3947
/>
4048
) : (
41-
<SortableMenuList
49+
<DynamicSortableMenuList
4250
communities={sortableCommunities}
4351
sortOptActive={sortOptActive}
4452
pin={pin}

0 commit comments

Comments
 (0)