feat breadcrumb.back: add back button
This commit is contained in:
@ -41,11 +41,21 @@ export default class Breadcrumb extends Component {
|
||||
return (
|
||||
<div className='breadcrumb'>
|
||||
<div>
|
||||
<span onClick={this.goUp} className='icon-up'></span>
|
||||
{els}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
goUp() {
|
||||
let current = store.getState().get('cwd');
|
||||
let up = current.split('/').slice(0, -1).join('/');
|
||||
|
||||
if (up === current) return;
|
||||
|
||||
store.dispatch(changedir(up));
|
||||
}
|
||||
}
|
||||
|
||||
function props(state) {
|
||||
|
@ -28,7 +28,9 @@ header {
|
||||
border: none;
|
||||
|
||||
width: 8rem;
|
||||
height: 4rem;
|
||||
height: 3rem;
|
||||
padding-top: 1rem;
|
||||
margin-top: -1rem;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
|
@ -65,3 +65,20 @@
|
||||
fill: white;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-up {
|
||||
.icon;
|
||||
display: inline-block;
|
||||
|
||||
border: 11px solid transparent;
|
||||
border-right-color: @blue;
|
||||
border-top-width: 8px;
|
||||
border-bottom-width: 8px;
|
||||
border-radius: 3px;
|
||||
|
||||
margin-right: 0.5rem;
|
||||
|
||||
position: relative;
|
||||
top: 2px;
|
||||
right: 0.5rem;
|
||||
}
|
||||
|
Reference in New Issue
Block a user