-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Walk): Standardize directory listing to GenericList
- Loading branch information
Showing
14 changed files
with
148 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,26 @@ | ||
import { push } from 'connected-react-router'; | ||
import React from 'react'; | ||
import { Helmet } from 'react-helmet'; | ||
import { FormattedMessage } from 'react-intl'; | ||
import { connect } from 'react-redux'; | ||
import { compose } from 'redux'; | ||
|
||
import A from '../../components/A'; | ||
import messages from './messages'; | ||
|
||
export function AdminLandingPage({ | ||
navToResize, | ||
navToWalk, | ||
}) { | ||
export function AdminLandingPage() { | ||
return ( | ||
<div> | ||
<Helmet> | ||
<title>Admin</title> | ||
<title>Walk - Admin</title> | ||
<meta name="description" content="Admin" /> | ||
</Helmet> | ||
<h1> | ||
<FormattedMessage {...messages.header} /> | ||
</h1> | ||
<ul> | ||
<li><A onClick={navToWalk}>Walk</A></li> | ||
<li><A onClick={navToResize}>Resize</A></li> | ||
<li><A href="/admin/walk">Walk</A></li> | ||
<li><A href="/admin/resize">Resize</A></li> | ||
</ul> | ||
</div> | ||
); | ||
} | ||
|
||
const mapDispatchToProps = (dispatch) => ({ | ||
navToWalk: () => dispatch(push('/admin/walk')), | ||
navToResize: () => dispatch(push('/admin/resize')), | ||
}); | ||
|
||
const withConnect = connect(null, mapDispatchToProps); | ||
|
||
export default compose( | ||
withConnect, | ||
)(AdminLandingPage); | ||
export default AdminLandingPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
|
||
import A from '../../components/A'; | ||
import ListItem from '../../components/ListItem'; | ||
import Placeholder from './Placeholder'; | ||
|
||
import walkUtils from './util'; | ||
|
||
const { areImages } = walkUtils; | ||
|
||
function Contents({ item: file }) { | ||
const key = `contents-${file.id.replace(/\//, '-') || 'missingId'}`; | ||
if (areImages(file)) { | ||
return <Placeholder file={file} key={key} />; | ||
} | ||
|
||
if (file.mediumType === 'folder') { | ||
const Link = ( | ||
<A href={`?path=${file.path}`}> | ||
{file.filename} | ||
</A> | ||
); | ||
|
||
return (<ListItem item={Link} />); | ||
} | ||
|
||
return ( | ||
<ListItem item={file.filename} /> | ||
); | ||
} | ||
|
||
export default Contents; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.