@@ -2,7 +2,6 @@ import React, { Suspense, useCallback, useState } from "react";
2
2
import {
3
3
Divider ,
4
4
List ,
5
- ListItem ,
6
5
ListItemIcon ,
7
6
ListItemText ,
8
7
makeStyles ,
@@ -21,6 +20,7 @@ import pathHelper from "../../utils/page";
21
20
import MuiExpansionPanel from "@material-ui/core/ExpansionPanel" ;
22
21
import MuiExpansionPanelSummary from "@material-ui/core/ExpansionPanelSummary" ;
23
22
import MuiExpansionPanelDetails from "@material-ui/core/ExpansionPanelDetails" ;
23
+ import MuiListItem from "@material-ui/core/ListItem" ;
24
24
import { useDispatch } from "react-redux" ;
25
25
import Auth from "../../middleware/Auth" ;
26
26
import {
@@ -47,6 +47,12 @@ import API from "../../middleware/Api";
47
47
import { navigateTo , searchMyFile , toggleSnackbar } from "../../redux/explorer" ;
48
48
import { useTranslation } from "react-i18next" ;
49
49
50
+ const ListItem = withStyles ( ( theme ) => ( {
51
+ root : {
52
+ borderRadius :theme . shape . borderRadius ,
53
+ } ,
54
+ } ) ) ( MuiListItem ) ;
55
+
50
56
const ExpansionPanel = withStyles ( {
51
57
root : {
52
58
maxWidth : "100%" ,
@@ -62,11 +68,10 @@ const ExpansionPanel = withStyles({
62
68
expanded : { } ,
63
69
} ) ( MuiExpansionPanel ) ;
64
70
65
- const ExpansionPanelSummary = withStyles ( {
71
+ const ExpansionPanelSummary = withStyles ( ( theme ) => ( {
66
72
root : {
67
73
minHeight : 0 ,
68
74
padding : 0 ,
69
-
70
75
"&$expanded" : {
71
76
minHeight : 0 ,
72
77
} ,
@@ -80,7 +85,7 @@ const ExpansionPanelSummary = withStyles({
80
85
} ,
81
86
} ,
82
87
expanded : { } ,
83
- } ) ( MuiExpansionPanelSummary ) ;
88
+ } ) ) ( MuiExpansionPanelSummary ) ;
84
89
85
90
const ExpansionPanelDetails = withStyles ( ( theme ) => ( {
86
91
root : {
@@ -112,6 +117,13 @@ const useStyles = makeStyles((theme) => ({
112
117
overflow : "hidden" ,
113
118
textOverflow : "ellipsis" ,
114
119
} ,
120
+ paddingList :{
121
+ padding :theme . spacing ( 1 ) ,
122
+ } ,
123
+ paddingSummary :{
124
+ paddingLeft :theme . spacing ( 1 ) ,
125
+ paddingRight :theme . spacing ( 1 ) ,
126
+ }
115
127
} ) ) ;
116
128
117
129
const icons = {
@@ -223,35 +235,38 @@ export default function FileTag() {
223
235
aria-controls = "panel1d-content"
224
236
id = "panel1d-header"
225
237
>
226
- < ListItem
227
- button
228
- key = "我的文件"
229
- onClick = { ( ) =>
230
- ! isHomePage && history . push ( "/home?path=%2F" )
231
- }
232
- >
233
- < ListItemIcon >
234
- < KeyboardArrowRight
235
- className = { classNames (
236
- {
237
- [ classes . expanded ] :
238
+ < div className = { classes . paddingSummary } >
239
+ < ListItem
240
+ button
241
+ key = "我的文件"
242
+ onClick = { ( ) =>
243
+ ! isHomePage && history . push ( "/home?path=%2F" )
244
+ }
245
+ >
246
+ < ListItemIcon >
247
+ < KeyboardArrowRight
248
+ className = { classNames (
249
+ {
250
+ [ classes . expanded ] :
238
251
tagOpen && isHomePage ,
239
- [ classes . iconFix ] : true ,
240
- } ,
241
- classes . expand
252
+ [ classes . iconFix ] : true ,
253
+ } ,
254
+ classes . expand
255
+ ) }
256
+ />
257
+ { ! ( tagOpen && isHomePage ) && (
258
+ < FolderShared className = { classes . iconFix } />
242
259
) }
243
- />
244
- { ! ( tagOpen && isHomePage ) && (
245
- < FolderShared className = { classes . iconFix } />
246
- ) }
247
- </ ListItemIcon >
248
- < ListItemText primary = { t ( "navbar.myFiles" ) } />
249
- </ ListItem >
260
+ </ ListItemIcon >
261
+ < ListItemText primary = { t ( "navbar.myFiles" ) } />
262
+ </ ListItem >
263
+ </ div >
264
+
250
265
< Divider />
251
266
</ ExpansionPanelSummary >
252
267
253
268
< ExpansionPanelDetails >
254
- < List onMouseLeave = { ( ) => setTagHover ( null ) } >
269
+ < List className = { classes . paddingList } onMouseLeave = { ( ) => setTagHover ( null ) } >
255
270
< ListItem
256
271
button
257
272
id = "pickfiles"
0 commit comments