forked from karsrhyder/FairDrive
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
316ef94
commit 3b344a2
Showing
16 changed files
with
229 additions
and
117 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
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,33 @@ | ||
import React from "react"; | ||
import styles from "styles.module.css"; | ||
import { NavLink } from "react-router-dom"; | ||
import { connect } from "react-redux"; | ||
|
||
class PutioToken extends React.Component { | ||
render() { | ||
return ( | ||
<div className={styles.container}> | ||
<div className={styles.topbar}> | ||
<div className={styles.brand}>{token}</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
const mapStateToProps = (_, ownProps) => { | ||
const { token } = (ownProps.match || {}).params || {}; | ||
// return createStructuredSelector({ | ||
// directory: () => directory, | ||
// directories: state => getDirectories(state, directory), | ||
// }); | ||
}; | ||
|
||
const mapDispatchToProps = dispatch => ({ | ||
//addHashtag: name => dispatch({ type: "ADD_HASHTAG", hashtag: { name } }) | ||
}); | ||
|
||
export default connect( | ||
mapStateToProps, | ||
mapDispatchToProps | ||
)(PutioToken); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// Service > user | ||
|
||
export const UPDATE_USER_ADDRESS = "UPDATE_USER_ADDRESS"; | ||
export const FETCH_DIRECTORY_LIST = "FETCH_DIRECTORY_LIST"; | ||
export const UPDATE_DIRECTORY_LIST = "UPDATE_DIRECTORY_LIST"; | ||
|
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,8 +1,14 @@ | ||
import * as t from "./actionTypes"; | ||
|
||
// Service > user | ||
console.log("actions") | ||
|
||
export const updateWeb3Instance = userAddress => ({ | ||
type: t.UPDATE_USER_ADDRESS, | ||
userAddress | ||
// Service > user | ||
export const fetchDirectoryList = dirId => ({ | ||
type: t.FETCH_DIRECTORY_LIST, | ||
dirId | ||
}); | ||
|
||
export const updateDirectoryList = directoryList => ({ | ||
type: t.UPDATE_DIRECTORY_LIST, | ||
data: directoryList | ||
}) |
28 changes: 28 additions & 0 deletions
28
src/services/filebrowser/fetchFunctions/getDirectoryList.js
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,28 @@ | ||
import PutioAPI from '@putdotio/api-client'; | ||
|
||
export default async function getDirectoryList({ dirId }) { | ||
console.log(localStorage.getItem('putiotoken')); | ||
console.log({ dirId }); | ||
window.putApi = new PutioAPI({ | ||
clientID: '4051', | ||
token: localStorage.getItem('putiotoken'), | ||
}); | ||
|
||
const Api = await window.putApi; | ||
|
||
// Api | ||
// .User | ||
// .Info() | ||
// .then(res => console.log('Res: ', res.data.info) | ||
// .catch(err => console.log('Error occured while fetching user info: ', err)) | ||
const directoryList = await | ||
Api | ||
.Files | ||
.Query(dirId, {}); | ||
|
||
|
||
// treat data HERE!! | ||
|
||
return directoryList.data.files | ||
|
||
} |
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.