Created
October 19, 2016 04:45
-
-
Save solebox/589d9c6044ed877da6e0d34d26b5a2cb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import React from "react"; | |
import Title from "./Slider/Title"; | |
import { fetchThumbs } from "../actions/thumbActions"; | |
import { addLayer } from "../actions/layerActions"; | |
import { connect } from "react-redux"; | |
import Thumbnail from "./Slider/Thumbnail"; | |
export default class Slider extends React.Component { | |
constructor(props) { | |
super(props); | |
onClickHandler = (id) => { | |
console.log("wtf man "+id); | |
this.props.dispatch(addLayer(id)); | |
} | |
} | |
render() { | |
const { thumbs_list } = this.props.thumbs; | |
const mapped_thumbs = thumbs_list.map((thumbnail) => { | |
if (!thumbnail.selected){ | |
return <Thumbnail key={thumbnail.id} map_id={thumbnail.id} map_url={thumbnail.url} | |
map_title={thumbnail.title} onClick={this.onClickHandler.bind(this, thumbnail.id)}/>; | |
} | |
} | |
); | |
return ( | |
<div id="slider" class="mdl-layout__drawer"> | |
<header> | |
<span class="mdl-layout-title"> | |
<a href="/"> | |
<img id="mainLogo" src="../static/img/mapabazman-logo-v1.png"></img> | |
</a> | |
</span> | |
<button class="mdl-button mdl-button--icon mdl-js-button mdl-js-ripple-effect layer-button-info" data-dialog="dialog"> | |
<i class="material-icons">info</i> | |
</button> | |
<div class="mdl-grid"> | |
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> | |
<input id="fixed-search" class="mdl-textfield__input" name="searchInput" type="text"></input> | |
<label class="mdl-textfield__label" for="fixed-search">Type Something...</label> | |
</div> | |
<div id="search" class="mdl-cell mdl-cell--4-col mdl-cell--12-col-tablet"> | |
<a id="search-more" href="#">More options</a> | |
<button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect">Search</button> | |
</div> | |
</div> | |
</header> | |
<div id="search"> | |
<ul id="thumb" > | |
{ mapped_thumbs } | |
</ul> | |
</div> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment