mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-11-01 19:32:27 +08:00
38 lines
1.3 KiB
JavaScript
38 lines
1.3 KiB
JavaScript
import React from 'react';
|
|
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
|
|
|
|
import { Container, Icon } from '../../components/';
|
|
import { Link } from 'react-router-dom';
|
|
import Path from 'path';
|
|
|
|
import './frequently_access.scss';
|
|
|
|
export class FrequentlyAccess extends React.Component {
|
|
constructor(props){
|
|
super(props);
|
|
}
|
|
|
|
render(){
|
|
if(this.props.files.length < 1) return null;
|
|
return (
|
|
<ReactCSSTransitionGroup transitionName="frequent-access" transitionLeave={false} transitionEnter={false} transitionAppear={true} transitionAppearTimeout={300}>
|
|
<Container>
|
|
<span>Quick Access</span>
|
|
<div className="component_frequently-access">
|
|
{
|
|
this.props.files.map(function(path, index){
|
|
return (
|
|
<Link key={path} to={"/files"+path+window.location.search}>
|
|
<Icon name={'directory'} />
|
|
<div>{Path.basename(path)}</div>
|
|
</Link>
|
|
);
|
|
})
|
|
}
|
|
</div>
|
|
</Container>
|
|
</ReactCSSTransitionGroup>
|
|
);
|
|
}
|
|
}
|