Skip to content

Commit

Permalink
featched list and card data for clicked board
Browse files Browse the repository at this point in the history
  • Loading branch information
abhilashcr-mountblue committed Sep 15, 2020
1 parent 86df091 commit 2614fcd
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {MemoryRouter as Router, Route,Link,Switch} from 'react-router-dom'
import SideBar2 from './sidebar/sideBar2';
import List from './Lists/List'
import Content from './content/Content';
import CheckList from './Lists/Checklist'
//import CheckList from './Lists/Checklist'


class App extends Component{
Expand Down Expand Up @@ -46,7 +46,7 @@ class App extends Component{
<Header></Header>
<Switch>
<Route path="/boards/:boardid" render={props =>(<List {...props}/>)} />
<Route path="/check" render={props =>(<CheckList prop={props}/>)} />
{/* <Route path="/check" render={props =>(<CheckList prop={props}/>)} /> */}
<Route path="/" render={ props => (<Content boards={this.state.boards}/>)} />
</Switch>
</div>
Expand Down
35 changes: 35 additions & 0 deletions src/Lists/List.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React, { Component } from 'react'
//import SimpleList from './Listitems'

class List extends Component{
constructor(props) {
super(props)

this.state = {
token:"374c221b4185e80027a402574dc071768d32336c175b07d821f47c7cdfbaecf2",
key:"5c73e280ffee643ce764c6df16a719b5",
id:props.match.params.boardid,
lists:[],
cards:[],
listData:[]
}
}
async componentDidMount(){
console.log(this.state.id)
const res= await fetch(`https://api.trello.com/1/boards/${this.state.id}/lists?key=${this.state.key}&token=${this.state.token}`)
const dataList = await res.json();
const res2= await fetch(`https://api.trello.com/1/boards/5eaefe609dc0505416efe976/cards?key=${this.state.key}&token=${this.state.token}`)
const dataCards = await res2.json();
}

render(){
return (
<div style={{maxHeight:"91vh",display:"flex",overflow:"scroll",marginTop:5}}>
{this.state.listData}

</div>
)
}

}
export default List;

0 comments on commit 2614fcd

Please sign in to comment.