From c6d5d36fc0e25bd22f0a3205ee44f71585dcdf34 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Tue, 24 May 2016 22:55:12 -0700 Subject: [PATCH 01/26] adds simple debounced function that runs on input field change --- utils/utils.js | 18 ++++++++++++++++++ views/FishView/index.js | 17 ++++++++++++++++- views/RootView/index.js | 13 +++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 utils/utils.js diff --git a/utils/utils.js b/utils/utils.js new file mode 100644 index 0000000..28664ab --- /dev/null +++ b/utils/utils.js @@ -0,0 +1,18 @@ +export function debounce (func, wait, immediate) { + let timeout; + return function() { + let context = this, args = arguments; + let later = () => { + timeout = null; + if (!immediate) { + func.apply(context, args); + } + }; + const callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + if (callNow) { + func.apply(context, args); + } + }; +}; \ No newline at end of file diff --git a/views/FishView/index.js b/views/FishView/index.js index 44fcbde..642747f 100644 --- a/views/FishView/index.js +++ b/views/FishView/index.js @@ -1,10 +1,25 @@ import React from 'react'; +let people = [ + 'egan', + 'mark', + 'alash' +]; + export default class FishView extends React.Component { render () { + + let searchResults = people.map((person) => { + return ( +
+

{person}

+
+ ) + }); + return (
-

No Fishes Here

+ {searchResults}
); } diff --git a/views/RootView/index.js b/views/RootView/index.js index 554ebd9..b4d8008 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -1,14 +1,27 @@ import React from 'react'; +import {debounce} from '../../utils/utils.js'; export default class RootView extends React.Component { + static propTypes = { children: React.PropTypes.any + } + + componentDidMount () { + this.debouncedGithubSearch = debounce ((query) => { + console.log(query); + }, 200); + } + + handleChange (event) { + this.debouncedGithubSearch(event.target.value); } render () { return (

Welcome To The Exercise

+ {this.props.children}
); From d958a592c237e53638ff5c1b4f8aad225daa24b4 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Wed, 25 May 2016 00:16:28 -0700 Subject: [PATCH 02/26] adds function that makes call to GitHub api with value from input field, when value is longer than three chars --- utils/utils.js | 15 +++++++++++++++ views/RootView/index.js | 22 +++++++++++++++++----- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/utils/utils.js b/utils/utils.js index 28664ab..30c9f8c 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -15,4 +15,19 @@ export function debounce (func, wait, immediate) { func.apply(context, args); } }; +}; + +export function fetchData (query, partial, context) { + const request_url = partial + query; + fetch(request_url) + .then((response) => { + return response.json(); + }) + .then((responseData) => { + console.log(responseData); + console.log(context.setState) + }) + .catch((err) => { + console.log(err); + }) }; \ No newline at end of file diff --git a/views/RootView/index.js b/views/RootView/index.js index b4d8008..5f0535c 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -1,16 +1,28 @@ import React from 'react'; -import {debounce} from '../../utils/utils.js'; +import {debounce, fetchData} from '../../utils/utils.js'; + +let request_url_partial = 'https://api.github.com/search/users?q='; export default class RootView extends React.Component { static propTypes = { children: React.PropTypes.any - } + } + + constructor (props) { + super (props); + this.state = { + searchResults : [] + } + } componentDidMount () { - this.debouncedGithubSearch = debounce ((query) => { - console.log(query); - }, 200); + console.log('tha state', this.state) + this.debouncedGithubSearch = debounce ((query) => { + if (query.length > 3) { + fetchData(query, request_url_partial, this); + } + }, 200); } handleChange (event) { From b6f4cd4043095f660a4597109479a856185d3056 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Wed, 25 May 2016 16:18:27 -0700 Subject: [PATCH 03/26] searching returns ten results fomr GitHub, displays picture and user-name --- views/RootView/index.js | 51 +++++++++++++++++++++---- views/RootView/searchResultView.js | 61 ++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 8 deletions(-) create mode 100644 views/RootView/searchResultView.js diff --git a/views/RootView/index.js b/views/RootView/index.js index 5f0535c..d726e63 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -1,8 +1,36 @@ import React from 'react'; import {debounce, fetchData} from '../../utils/utils.js'; +import SearchResultView from './SearchResultView.js'; let request_url_partial = 'https://api.github.com/search/users?q='; +let divStyle = { + 'display' : 'flex', + 'justify-content' : 'center', + 'flex-direction' : 'column', + 'background-color' : 'lightgrey', + 'width' : '400px' +}; + +let container = { + 'display' : 'flex', + 'justify-content' : 'center' +}; + +let inputStyle = { + 'width' : '250px' +}; + +let inputContainer = { + 'display' : 'flex', + 'justify-content' : 'center' +}; + +let titleStyle = { + 'display' : 'flex', + 'justify-content' : 'center' +}; + export default class RootView extends React.Component { static propTypes = { @@ -12,14 +40,14 @@ export default class RootView extends React.Component { constructor (props) { super (props); this.state = { - searchResults : [] - } + searchResults : [], + currentFocus : null + }; } componentDidMount () { - console.log('tha state', this.state) this.debouncedGithubSearch = debounce ((query) => { - if (query.length > 3) { + if (query.length >= 3) { fetchData(query, request_url_partial, this); } }, 200); @@ -31,10 +59,17 @@ export default class RootView extends React.Component { render () { return ( -
-

Welcome To The Exercise

- - {this.props.children} +
+
+
+

Welcome To The Exercise

+
+
+ +
+ + {this.props.children} +
); } diff --git a/views/RootView/searchResultView.js b/views/RootView/searchResultView.js new file mode 100644 index 0000000..17defff --- /dev/null +++ b/views/RootView/searchResultView.js @@ -0,0 +1,61 @@ +import React from 'react'; + +let personStyle1 = { + 'display' : 'flex', + 'justify-content' : 'space-between' +} + +let personImgStyle = { + 'height' : '50px', + 'width' : '50px' +} + +let noResultsStyle = { + 'display' : 'flex', + 'justify-content' : 'center' +} + +const renderIf = predicate => element => predicate && element; + +export default class SearchResultView extends React.Component { + constructor(props) { + super(props); + this.state = { + hover: false + }; + } + + handleClick (event) { + console.log(this, ' ', event.currentTarget) + } + + toggleHover() { + this.setState({hover: !this.state.hover}); + } + + render () { + const noSearchResults = renderIf(this.props.searchResults.length === 0); + const searchResults = renderIf(this.props.searchResults.length !== 0); + + let githubSearchResults = this.props.searchResults.slice(0, 10).map((person) => { + console.log(person) + return ( +
+ +

{person.login}

+
+
+ ); + }); + + return ( +
+ {searchResults(githubSearchResults)} + {noSearchResults( + No results. Please search for another user. + )} +
+ ); + } + +} \ No newline at end of file From b60336d5094ef8ed7f2d98669b396ab541f2da91 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Wed, 25 May 2016 19:02:11 -0700 Subject: [PATCH 04/26] state updates with information of the person who is clicked in the dropdown menu --- utils/utils.js | 5 ++++- views/RootView/index.js | 27 ++++++++++++++++++++------- views/RootView/searchResultView.js | 21 +++------------------ views/profileView/index.js | 13 +++++++++++++ 4 files changed, 40 insertions(+), 26 deletions(-) create mode 100644 views/profileView/index.js diff --git a/utils/utils.js b/utils/utils.js index 30c9f8c..7c974c2 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -25,7 +25,10 @@ export function fetchData (query, partial, context) { }) .then((responseData) => { console.log(responseData); - console.log(context.setState) + context.setState({ + searchResults : responseData.items + }); + console.log('state changed ', context.state); }) .catch((err) => { console.log(err); diff --git a/views/RootView/index.js b/views/RootView/index.js index d726e63..1d40d88 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -1,20 +1,22 @@ import React from 'react'; import {debounce, fetchData} from '../../utils/utils.js'; import SearchResultView from './SearchResultView.js'; +import ProfileView from '../profileView/index.js'; let request_url_partial = 'https://api.github.com/search/users?q='; let divStyle = { 'display' : 'flex', - 'justify-content' : 'center', - 'flex-direction' : 'column', - 'background-color' : 'lightgrey', + 'justifyContent' : 'center', + 'flexDirection' : 'column', + 'backgroundColor' : 'lightgrey', 'width' : '400px' }; let container = { 'display' : 'flex', - 'justify-content' : 'center' + 'justifyContent' : 'center', + 'flexDirection' : 'column' }; let inputStyle = { @@ -23,12 +25,12 @@ let inputStyle = { let inputContainer = { 'display' : 'flex', - 'justify-content' : 'center' + 'justifyContent' : 'center' }; let titleStyle = { 'display' : 'flex', - 'justify-content' : 'center' + 'justifyContent' : 'center' }; export default class RootView extends React.Component { @@ -57,6 +59,16 @@ export default class RootView extends React.Component { this.debouncedGithubSearch(event.target.value); } + handleClick (event) { + console.log(this.state) + this.state.searchResults.forEach((person) => { + if (event.currentTarget.firstChild.nextSibling.innerHTML === person.login) { + console.log(person.login); + this.setState({currentFocus : person}) + } + }) + } + render () { return (
@@ -67,9 +79,10 @@ export default class RootView extends React.Component {
- + {this.props.children}
+
); } diff --git a/views/RootView/searchResultView.js b/views/RootView/searchResultView.js index 17defff..09ba4e4 100644 --- a/views/RootView/searchResultView.js +++ b/views/RootView/searchResultView.js @@ -2,7 +2,7 @@ import React from 'react'; let personStyle1 = { 'display' : 'flex', - 'justify-content' : 'space-between' + 'justifyContent' : 'space-between' } let personImgStyle = { @@ -12,35 +12,20 @@ let personImgStyle = { let noResultsStyle = { 'display' : 'flex', - 'justify-content' : 'center' + 'justifyContent' : 'center' } const renderIf = predicate => element => predicate && element; export default class SearchResultView extends React.Component { - constructor(props) { - super(props); - this.state = { - hover: false - }; - } - - handleClick (event) { - console.log(this, ' ', event.currentTarget) - } - - toggleHover() { - this.setState({hover: !this.state.hover}); - } render () { const noSearchResults = renderIf(this.props.searchResults.length === 0); const searchResults = renderIf(this.props.searchResults.length !== 0); let githubSearchResults = this.props.searchResults.slice(0, 10).map((person) => { - console.log(person) return ( -
+

{person.login}

diff --git a/views/profileView/index.js b/views/profileView/index.js new file mode 100644 index 0000000..ceb1e01 --- /dev/null +++ b/views/profileView/index.js @@ -0,0 +1,13 @@ +import React from 'react'; + +export default class ProfileView extends React.Component { + + render () { + return ( +
+ profile goes here +
+ ); + } + +} \ No newline at end of file From e22dc3c4968eb35260ffbd487d5afcf9c963f995 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Thu, 26 May 2016 21:35:06 -0700 Subject: [PATCH 05/26] adds a css file and gets rid of inline react styles --- routes.js | 3 +- styles.css | 36 ++++++++++++++++++++++++ views/RootView/index.js | 44 ++++++------------------------ views/RootView/searchResultView.js | 23 +++------------- views/profileView/index.js | 2 +- 5 files changed, 51 insertions(+), 57 deletions(-) create mode 100644 styles.css diff --git a/routes.js b/routes.js index 3ea20c9..8c03107 100644 --- a/routes.js +++ b/routes.js @@ -2,7 +2,8 @@ import React from 'react'; import { Route } from 'react-router'; import HomeView from './views/RootView'; import FishView from './views/FishView'; -import 'bootstrap/dist/css/bootstrap.min.css'; + +var styles = require('./styles.css'); const routes = ( diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..fea9b6f --- /dev/null +++ b/styles.css @@ -0,0 +1,36 @@ +body { + display: flex; + justify-content: center; +} + +.search-box { + width: 250px; +} + +.search-container, .title-container { + display: flex; + justify-content: center; +} + +.results-display-container { + display: flex; + justify-content: center; + flex-direction: column; + background-color: #f5f5f5; + width: 400px; +} + +.person-entry-view { + display: flex; + justify-content: space-between; +} + +.person-entry-view-image { + height: 50px; + width: 50px; +} + +.person-entry-view-no-results { + display: flex; + justify-content: center; +} \ No newline at end of file diff --git a/views/RootView/index.js b/views/RootView/index.js index 1d40d88..6723206 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -5,34 +5,6 @@ import ProfileView from '../profileView/index.js'; let request_url_partial = 'https://api.github.com/search/users?q='; -let divStyle = { - 'display' : 'flex', - 'justifyContent' : 'center', - 'flexDirection' : 'column', - 'backgroundColor' : 'lightgrey', - 'width' : '400px' -}; - -let container = { - 'display' : 'flex', - 'justifyContent' : 'center', - 'flexDirection' : 'column' -}; - -let inputStyle = { - 'width' : '250px' -}; - -let inputContainer = { - 'display' : 'flex', - 'justifyContent' : 'center' -}; - -let titleStyle = { - 'display' : 'flex', - 'justifyContent' : 'center' -}; - export default class RootView extends React.Component { static propTypes = { @@ -60,10 +32,10 @@ export default class RootView extends React.Component { } handleClick (event) { - console.log(this.state) + // console.log(this.state) this.state.searchResults.forEach((person) => { if (event.currentTarget.firstChild.nextSibling.innerHTML === person.login) { - console.log(person.login); + console.log(person); this.setState({currentFocus : person}) } }) @@ -71,18 +43,18 @@ export default class RootView extends React.Component { render () { return ( -
-
-
+
+
+

Welcome To The Exercise

-
- +
+
{this.props.children}
- +
); } diff --git a/views/RootView/searchResultView.js b/views/RootView/searchResultView.js index 09ba4e4..8058f81 100644 --- a/views/RootView/searchResultView.js +++ b/views/RootView/searchResultView.js @@ -1,20 +1,5 @@ import React from 'react'; -let personStyle1 = { - 'display' : 'flex', - 'justifyContent' : 'space-between' -} - -let personImgStyle = { - 'height' : '50px', - 'width' : '50px' -} - -let noResultsStyle = { - 'display' : 'flex', - 'justifyContent' : 'center' -} - const renderIf = predicate => element => predicate && element; export default class SearchResultView extends React.Component { @@ -25,10 +10,10 @@ export default class SearchResultView extends React.Component { let githubSearchResults = this.props.searchResults.slice(0, 10).map((person) => { return ( -
- +
+

{person.login}

-
+
); }); @@ -37,7 +22,7 @@ export default class SearchResultView extends React.Component {
{searchResults(githubSearchResults)} {noSearchResults( - No results. Please search for another user. + No results. Please search for another user. )}
); diff --git a/views/profileView/index.js b/views/profileView/index.js index ceb1e01..7a0948c 100644 --- a/views/profileView/index.js +++ b/views/profileView/index.js @@ -5,7 +5,7 @@ export default class ProfileView extends React.Component { render () { return (
- profile goes here + profile goes heres
); } From e4ad8432b817309805590d13adb3e83add50d105 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Thu, 26 May 2016 21:55:56 -0700 Subject: [PATCH 06/26] adds relevant user information to the state (the user that was clicked on in the search menu) todo: make profile page using information in state.currentFocus --- utils/utils.js | 26 ++++++++++++++++++++++---- views/RootView/index.js | 15 +++++---------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/utils/utils.js b/utils/utils.js index 7c974c2..bda53fa 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -1,3 +1,4 @@ + export function debounce (func, wait, immediate) { let timeout; return function() { @@ -17,14 +18,13 @@ export function debounce (func, wait, immediate) { }; }; -export function fetchData (query, partial, context) { - const request_url = partial + query; +export function fetchData (query, context) { + const request_url = 'https://api.github.com/search/users?q=' + query; fetch(request_url) .then((response) => { return response.json(); }) .then((responseData) => { - console.log(responseData); context.setState({ searchResults : responseData.items }); @@ -33,4 +33,22 @@ export function fetchData (query, partial, context) { .catch((err) => { console.log(err); }) -}; \ No newline at end of file +}; + +export function fetchUserData (query, context) { + const request_url = 'https://api.github.com/users/' + query; + console.log(request_url); + fetch(request_url) + .then((response) => { + return response.json(); + }) + .then((responseData) => { + context.setState({ + currentFocus : responseData + }); + console.log('state changed ', context.state.currentFocus); + }) + .catch((err) => { + console.log(err); + }) + }; \ No newline at end of file diff --git a/views/RootView/index.js b/views/RootView/index.js index 6723206..c539f50 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -1,10 +1,8 @@ import React from 'react'; -import {debounce, fetchData} from '../../utils/utils.js'; +import {debounce, fetchData, fetchUserData} from '../../utils/utils.js'; import SearchResultView from './SearchResultView.js'; import ProfileView from '../profileView/index.js'; -let request_url_partial = 'https://api.github.com/search/users?q='; - export default class RootView extends React.Component { static propTypes = { @@ -22,7 +20,7 @@ export default class RootView extends React.Component { componentDidMount () { this.debouncedGithubSearch = debounce ((query) => { if (query.length >= 3) { - fetchData(query, request_url_partial, this); + fetchData(query, this); } }, 200); } @@ -33,12 +31,9 @@ export default class RootView extends React.Component { handleClick (event) { // console.log(this.state) - this.state.searchResults.forEach((person) => { - if (event.currentTarget.firstChild.nextSibling.innerHTML === person.login) { - console.log(person); - this.setState({currentFocus : person}) - } - }) + const person_clicked = event.currentTarget.firstChild.nextSibling.innerHTML; + console.log(person_clicked) + fetchUserData(person_clicked, this); } render () { From 1a11e71ff51021b5115c5d36e8ed48f65e35d91d Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Fri, 27 May 2016 00:28:53 -0700 Subject: [PATCH 07/26] adds basic layout for profile page, gets bootstrap involved --- routes.js | 4 ++-- styles.css | 36 +++++++++++++++++++++++++++--- views/RootView/index.js | 3 ++- views/RootView/searchResultView.js | 12 +++++----- views/profileView/centerSection.js | 1 + views/profileView/index.js | 15 ++++++++++--- views/profileView/leftSection.js | 19 ++++++++++++++++ views/profileView/rightSection.js | 1 + 8 files changed, 77 insertions(+), 14 deletions(-) create mode 100644 views/profileView/centerSection.js create mode 100644 views/profileView/leftSection.js create mode 100644 views/profileView/rightSection.js diff --git a/routes.js b/routes.js index 8c03107..b41fbd3 100644 --- a/routes.js +++ b/routes.js @@ -4,10 +4,10 @@ import HomeView from './views/RootView'; import FishView from './views/FishView'; var styles = require('./styles.css'); +var bootstrap = require('./node_modules/bootstrap/dist/css/bootstrap.css'); const routes = ( - - + ); diff --git a/styles.css b/styles.css index fea9b6f..f957859 100644 --- a/styles.css +++ b/styles.css @@ -3,8 +3,8 @@ body { justify-content: center; } -.search-box { - width: 250px; +#search-box { + width: 300px; } .search-container, .title-container { @@ -12,17 +12,29 @@ body { justify-content: center; } +.title-container { + padding-top: 10px; +} + .results-display-container { display: flex; justify-content: center; flex-direction: column; background-color: #f5f5f5; - width: 400px; + border: 1px solid #e5e5e5; +} + +.person-entry-view-holder { + display: flex; + justify-content: center; } .person-entry-view { display: flex; justify-content: space-between; + padding: 5px; + border: 1px solid #e5e5e5; + width: 300px; } .person-entry-view-image { @@ -33,4 +45,22 @@ body { .person-entry-view-no-results { display: flex; justify-content: center; +} + + +/*profile partial css below*/ +.profile-container { + min-width: 1100px; +} + +.profile-left-section { + display: flex; + justify-content: center; + flex-direction: column; +} + +.profile-left-section-picture { + height: 100px; + width: 100px; + background-color: red; } \ No newline at end of file diff --git a/views/RootView/index.js b/views/RootView/index.js index c539f50..55bdda9 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -44,7 +44,7 @@ export default class RootView extends React.Component {

Welcome To The Exercise

- +
{this.props.children} @@ -53,4 +53,5 @@ export default class RootView extends React.Component {
); } + } diff --git a/views/RootView/searchResultView.js b/views/RootView/searchResultView.js index 8058f81..cdc945e 100644 --- a/views/RootView/searchResultView.js +++ b/views/RootView/searchResultView.js @@ -10,10 +10,12 @@ export default class SearchResultView extends React.Component { let githubSearchResults = this.props.searchResults.slice(0, 10).map((person) => { return ( -
- -

{person.login}

-
+
+
+ +

{person.login}

+
+
); }); @@ -27,5 +29,5 @@ export default class SearchResultView extends React.Component {
); } - + } \ No newline at end of file diff --git a/views/profileView/centerSection.js b/views/profileView/centerSection.js new file mode 100644 index 0000000..b01f5e7 --- /dev/null +++ b/views/profileView/centerSection.js @@ -0,0 +1 @@ +import React from 'react'; \ No newline at end of file diff --git a/views/profileView/index.js b/views/profileView/index.js index 7a0948c..888714a 100644 --- a/views/profileView/index.js +++ b/views/profileView/index.js @@ -1,12 +1,21 @@ import React from 'react'; +import LeftSection from './leftSection.js'; export default class ProfileView extends React.Component { render () { return ( -
- profile goes heres -
+
+
+ +
+
+ center section +
+
+ right section +
+
); } diff --git a/views/profileView/leftSection.js b/views/profileView/leftSection.js new file mode 100644 index 0000000..68daa2f --- /dev/null +++ b/views/profileView/leftSection.js @@ -0,0 +1,19 @@ +import React from 'react'; + +export default class LeftSection extends React.Component { + + render () { + return ( +
+ +

GitHub name

+

egan t

+

comapny

+

location

+

email

+

bio

+
+ ) + } + +} \ No newline at end of file diff --git a/views/profileView/rightSection.js b/views/profileView/rightSection.js new file mode 100644 index 0000000..b01f5e7 --- /dev/null +++ b/views/profileView/rightSection.js @@ -0,0 +1 @@ +import React from 'react'; \ No newline at end of file From ee66449510e20430accee774a0411973ebe9ec74 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Fri, 27 May 2016 17:07:58 -0700 Subject: [PATCH 08/26] profile page not loads only if there is something in the current state at currentFocus --- styles.css | 5 +++++ views/RootView/index.js | 7 ++++++- views/RootView/searchResultView.js | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/styles.css b/styles.css index f957859..e19baeb 100644 --- a/styles.css +++ b/styles.css @@ -53,6 +53,10 @@ body { min-width: 1100px; } +.profile-left-section, .profile-center-section, .profile-right-section { + padding: 20px; +} + .profile-left-section { display: flex; justify-content: center; @@ -63,4 +67,5 @@ body { height: 100px; width: 100px; background-color: red; + align-self: center; } \ No newline at end of file diff --git a/views/RootView/index.js b/views/RootView/index.js index 55bdda9..d5327c8 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -37,6 +37,11 @@ export default class RootView extends React.Component { } render () { + let profilePage; + if (this.state.currentFocus) { + profilePage = ; + } + return (
@@ -49,7 +54,7 @@ export default class RootView extends React.Component { {this.props.children}
- + {profilePage}
); } diff --git a/views/RootView/searchResultView.js b/views/RootView/searchResultView.js index cdc945e..9fb4eac 100644 --- a/views/RootView/searchResultView.js +++ b/views/RootView/searchResultView.js @@ -10,8 +10,8 @@ export default class SearchResultView extends React.Component { let githubSearchResults = this.props.searchResults.slice(0, 10).map((person) => { return ( -
-
+
+

{person.login}

From f131ead883d1a0db1323653ffcb47498f614225c Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Fri, 27 May 2016 17:31:57 -0700 Subject: [PATCH 09/26] clicking on a search result fills the profile page with user info --- styles.css | 7 ++++--- views/RootView/index.js | 2 +- views/profileView/index.js | 2 +- views/profileView/leftSection.js | 16 +++++++++------- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/styles.css b/styles.css index e19baeb..6241dec 100644 --- a/styles.css +++ b/styles.css @@ -49,7 +49,7 @@ body { /*profile partial css below*/ -.profile-container { +.profile-container, .title-container { min-width: 1100px; } @@ -64,8 +64,9 @@ body { } .profile-left-section-picture { - height: 100px; - width: 100px; + height: 150px; + width: 150px; background-color: red; align-self: center; + margin: 20px; } \ No newline at end of file diff --git a/views/RootView/index.js b/views/RootView/index.js index d5327c8..8bd8579 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -39,7 +39,7 @@ export default class RootView extends React.Component { render () { let profilePage; if (this.state.currentFocus) { - profilePage = ; + profilePage = ; } return ( diff --git a/views/profileView/index.js b/views/profileView/index.js index 888714a..b5dc5f4 100644 --- a/views/profileView/index.js +++ b/views/profileView/index.js @@ -7,7 +7,7 @@ export default class ProfileView extends React.Component { return (
- +
center section diff --git a/views/profileView/leftSection.js b/views/profileView/leftSection.js index 68daa2f..f945bdc 100644 --- a/views/profileView/leftSection.js +++ b/views/profileView/leftSection.js @@ -5,13 +5,15 @@ export default class LeftSection extends React.Component { render () { return (
- -

GitHub name

-

egan t

-

comapny

-

location

-

email

-

bio

+ +

{this.props.profileInfo.login}

+

{this.props.profileInfo.name}

+

{this.props.profileInfo.company}

+

{this.props.profileInfo.blog}

+

{this.props.profileInfo.location}

+

{this.props.profileInfo.email}

+

{this.props.profileInfo.bio}

+

{this.props.profileInfo.created_at}

) } From 3b4868c0a37e063bc53a14bc1276005f59833b31 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Fri, 27 May 2016 18:43:44 -0700 Subject: [PATCH 10/26] adds profile user's followers and repo list to state --- utils/utils.js | 47 +++++++++++++++++++++++++++++++- views/RootView/index.js | 4 ++- views/profileView/index.js | 4 +-- views/profileView/leftSection.js | 14 +++++----- 4 files changed, 58 insertions(+), 11 deletions(-) diff --git a/utils/utils.js b/utils/utils.js index bda53fa..244f29d 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -47,8 +47,53 @@ export function fetchUserData (query, context) { currentFocus : responseData }); console.log('state changed ', context.state.currentFocus); + fetchUserFollowersRepos(context.state.currentFocus.repos_url, context, 'repos'); + fetchUserFollowersRepos(context.state.currentFocus.followers_url, context, 'followers'); }) .catch((err) => { console.log(err); }) - }; \ No newline at end of file +}; + +const fetchUserFollowersRepos = (query, context, update) => { + fetch(query) + .then((response) => { + return response.json(); + }) + .then((responseData) => { + if (update === 'repos') { + context.setState({ + currentFocusRepos : responseData + }); + } if (update === 'followers') { + context.setState({ + currentFocusFollowers : responseData + }); + } + console.log('state changed', context.state); + }) + .catch((err) => { + console.log(err); + }) +}; + +export function stringifyDate (stringDate) { + const months = { + '01' : 'Jan', + '02' : 'Feb', + '03' : 'Mar', + '04' : 'Apr', + '05' : 'May', + '06' : 'Jun', + '07' : 'July', + '08' : 'Aug', + '09' : 'Sept', + '10' : 'Oct', + '11' : 'Nov', + '12' : 'Dec' + } + + console.log(stringDate) + + return stringDate; +}; \ No newline at end of file diff --git a/views/RootView/index.js b/views/RootView/index.js index 8bd8579..817056e 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -13,7 +13,9 @@ export default class RootView extends React.Component { super (props); this.state = { searchResults : [], - currentFocus : null + currentFocus : null, + currentFocusRepos: null, + currentFocusFollowers: null }; } diff --git a/views/profileView/index.js b/views/profileView/index.js index b5dc5f4..1085a5b 100644 --- a/views/profileView/index.js +++ b/views/profileView/index.js @@ -10,10 +10,10 @@ export default class ProfileView extends React.Component {
- center section + followers
- right section + repos
); diff --git a/views/profileView/leftSection.js b/views/profileView/leftSection.js index f945bdc..a0eb412 100644 --- a/views/profileView/leftSection.js +++ b/views/profileView/leftSection.js @@ -7,13 +7,13 @@ export default class LeftSection extends React.Component {

{this.props.profileInfo.login}

-

{this.props.profileInfo.name}

-

{this.props.profileInfo.company}

-

{this.props.profileInfo.blog}

-

{this.props.profileInfo.location}

-

{this.props.profileInfo.email}

-

{this.props.profileInfo.bio}

-

{this.props.profileInfo.created_at}

+
{this.props.profileInfo.name}
+
{this.props.profileInfo.company}
+
{this.props.profileInfo.blog}
+
{this.props.profileInfo.location}
+
{this.props.profileInfo.email}
+
{this.props.profileInfo.bio}
+
{this.props.profileInfo.created_at}
) } From ef9aea098ec159e52667e430a8f5dea6a1ebf5b5 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Fri, 27 May 2016 18:51:26 -0700 Subject: [PATCH 11/26] adds formatting function for the funny format the GitHub returns the date in --- utils/utils.js | 6 ++++-- views/profileView/leftSection.js | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/utils/utils.js b/utils/utils.js index 244f29d..e29d824 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -93,7 +93,9 @@ export function stringifyDate (stringDate) { '12' : 'Dec' } - console.log(stringDate) + let formattedDate = stringDate.substr(0, 10).split('-'); + formattedDate = months[formattedDate[1]]+' '+formattedDate[2]+' '+formattedDate[0]; + // console.log(formattedDate) - return stringDate; + return formattedDate; }; \ No newline at end of file diff --git a/views/profileView/leftSection.js b/views/profileView/leftSection.js index a0eb412..51dc7f7 100644 --- a/views/profileView/leftSection.js +++ b/views/profileView/leftSection.js @@ -1,8 +1,10 @@ import React from 'react'; +import {stringifyDate} from '../../utils/utils.js'; export default class LeftSection extends React.Component { render () { + return (
@@ -13,7 +15,7 @@ export default class LeftSection extends React.Component {
{this.props.profileInfo.location}
{this.props.profileInfo.email}
{this.props.profileInfo.bio}
-
{this.props.profileInfo.created_at}
+
profile created at: {stringifyDate(this.props.profileInfo.created_at)}
) } From e9f41a91a8ce115bb5dc5e5b6b9a2a6ac87c3606 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Fri, 27 May 2016 19:40:30 -0700 Subject: [PATCH 12/26] adds right and center sections to profile view --- views/profileView/centerSection.js | 14 +++++++++++++- views/profileView/index.js | 8 ++++++-- views/profileView/rightSection.js | 14 +++++++++++++- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/views/profileView/centerSection.js b/views/profileView/centerSection.js index b01f5e7..b2284bc 100644 --- a/views/profileView/centerSection.js +++ b/views/profileView/centerSection.js @@ -1 +1,13 @@ -import React from 'react'; \ No newline at end of file +import React from 'react'; + +export default class CenterSection extends React.Component { + + render () { + return ( +
    +
  • >:^|
  • +
+ ) + } + +}; \ No newline at end of file diff --git a/views/profileView/index.js b/views/profileView/index.js index 1085a5b..4e9a294 100644 --- a/views/profileView/index.js +++ b/views/profileView/index.js @@ -1,22 +1,26 @@ import React from 'react'; import LeftSection from './leftSection.js'; +import CenterSection from './centerSection.js'; +import RightSection from './rightSection.js'; export default class ProfileView extends React.Component { render () { return (
-
+
followers +
repos +
); } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/views/profileView/rightSection.js b/views/profileView/rightSection.js index b01f5e7..bce8b94 100644 --- a/views/profileView/rightSection.js +++ b/views/profileView/rightSection.js @@ -1 +1,13 @@ -import React from 'react'; \ No newline at end of file +import React from 'react'; + +export default class RightSection extends React.Component { + + render () { + return ( +
    +
  • (-__-;)
  • +
+ ) + } + +}; \ No newline at end of file From c285473cc6b205d50ab86f200e43c42005a71c46 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Fri, 27 May 2016 20:24:25 -0700 Subject: [PATCH 13/26] current profile followers now render --- views/RootView/index.js | 6 +++--- views/profileView/centerSection.js | 14 +++++++++++++- views/profileView/index.js | 4 ++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/views/RootView/index.js b/views/RootView/index.js index 817056e..3ddab5d 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -14,8 +14,8 @@ export default class RootView extends React.Component { this.state = { searchResults : [], currentFocus : null, - currentFocusRepos: null, - currentFocusFollowers: null + currentFocusRepos: [], + currentFocusFollowers: [] }; } @@ -41,7 +41,7 @@ export default class RootView extends React.Component { render () { let profilePage; if (this.state.currentFocus) { - profilePage = ; + profilePage = ; } return ( diff --git a/views/profileView/centerSection.js b/views/profileView/centerSection.js index b2284bc..2119221 100644 --- a/views/profileView/centerSection.js +++ b/views/profileView/centerSection.js @@ -3,9 +3,21 @@ import React from 'react'; export default class CenterSection extends React.Component { render () { + let followers; + if (this.props.currentProfileFollowers.length > 0) { + followers = this.props.currentProfileFollowers.map((follower) => { + console.log(follower) + return ( +
  • + {follower.login} +
  • + ) + }) + } + return (
      -
    • >:^|
    • + {followers}
    ) } diff --git a/views/profileView/index.js b/views/profileView/index.js index 4e9a294..b07d7df 100644 --- a/views/profileView/index.js +++ b/views/profileView/index.js @@ -9,11 +9,11 @@ export default class ProfileView extends React.Component { return (
    - +
    followers - +
    repos From 8ef29f91502f8c5e50e725e9b28a46820a2dced1 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Fri, 27 May 2016 20:44:07 -0700 Subject: [PATCH 14/26] adds styles to the list of followers --- styles.css | 20 ++++++++++++++++++-- views/RootView/searchResultView.js | 2 +- views/profileView/centerSection.js | 10 ++++++++-- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/styles.css b/styles.css index 6241dec..ae8052a 100644 --- a/styles.css +++ b/styles.css @@ -37,7 +37,7 @@ body { width: 300px; } -.person-entry-view-image { +.person-entry-view-image, .person-entry-view-spacer { height: 50px; width: 50px; } @@ -69,4 +69,20 @@ body { background-color: red; align-self: center; margin: 20px; -} \ No newline at end of file +} + +/*profile center section*/ +.followers-list-container { + max-height: 400px; + overflow: scroll; +} + +.followers-list-entry { + display: flex; + justify-content: space-between; +} + +.followers-list-image { + height: 40px; + width: 40px; +} diff --git a/views/RootView/searchResultView.js b/views/RootView/searchResultView.js index 9fb4eac..0502329 100644 --- a/views/RootView/searchResultView.js +++ b/views/RootView/searchResultView.js @@ -14,7 +14,7 @@ export default class SearchResultView extends React.Component {

    {person.login}

    -
    +
    ); diff --git a/views/profileView/centerSection.js b/views/profileView/centerSection.js index 2119221..aadb4f6 100644 --- a/views/profileView/centerSection.js +++ b/views/profileView/centerSection.js @@ -9,14 +9,20 @@ export default class CenterSection extends React.Component { console.log(follower) return (
  • - {follower.login} +
    + +
    {follower.login}
    +
    +
  • ) }) + } else { + followers =
    this user got no followers
    } return ( -
      +
        {followers}
      ) From e0101439d336b144b398e0a517917b94c8b9c68d Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Fri, 27 May 2016 21:10:57 -0700 Subject: [PATCH 15/26] all repos for a profile are rendering and style added --- styles.css | 16 ++++++++++++++++ views/RootView/index.js | 6 +++++- views/profileView/centerSection.js | 3 +-- views/profileView/index.js | 2 +- views/profileView/rightSection.js | 21 +++++++++++++++++++-- 5 files changed, 42 insertions(+), 6 deletions(-) diff --git a/styles.css b/styles.css index ae8052a..4a7b593 100644 --- a/styles.css +++ b/styles.css @@ -57,6 +57,7 @@ body { padding: 20px; } +/*profile left section*/ .profile-left-section { display: flex; justify-content: center; @@ -86,3 +87,18 @@ body { height: 40px; width: 40px; } + +/*profile right section*/ +.repo-container { + max-height: 400px; + overflow: scroll; +} + +.repo-entry > div { + display: flex; + justify-content: space-between; +} + +.repo-entry > div > span { + border-radius: 0.7em; +} diff --git a/views/RootView/index.js b/views/RootView/index.js index 3ddab5d..7278b3c 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -41,7 +41,11 @@ export default class RootView extends React.Component { render () { let profilePage; if (this.state.currentFocus) { - profilePage = ; + profilePage = ; } return ( diff --git a/views/profileView/centerSection.js b/views/profileView/centerSection.js index aadb4f6..449ed97 100644 --- a/views/profileView/centerSection.js +++ b/views/profileView/centerSection.js @@ -6,12 +6,11 @@ export default class CenterSection extends React.Component { let followers; if (this.props.currentProfileFollowers.length > 0) { followers = this.props.currentProfileFollowers.map((follower) => { - console.log(follower) return (
    • -
      {follower.login}
      +
      {follower.login}
    • diff --git a/views/profileView/index.js b/views/profileView/index.js index b07d7df..a2bef76 100644 --- a/views/profileView/index.js +++ b/views/profileView/index.js @@ -17,7 +17,7 @@ export default class ProfileView extends React.Component {
      repos - +
      ); diff --git a/views/profileView/rightSection.js b/views/profileView/rightSection.js index bce8b94..afb2991 100644 --- a/views/profileView/rightSection.js +++ b/views/profileView/rightSection.js @@ -3,9 +3,26 @@ import React from 'react'; export default class RightSection extends React.Component { render () { + let repos; + if (this.props.currentProfileRepos.length > 0) { + repos = this.props.currentProfileRepos.map((repo) => { + console.log(repo); + return ( +
    • +
      +
      {repo.name}
      + {repo.forks} forks +
      +
    • + ) + }) + } else { + repos =
      this user does not have any repos
      + } + return ( -
        -
      • (-__-;)
      • +
          + {repos}
        ) } From 8c2df092d99fa1e2d4b196a4183e714358370e24 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Fri, 27 May 2016 21:30:57 -0700 Subject: [PATCH 16/26] adds style to the profile page --- styles.css | 7 ++++++- views/RootView/searchResultView.js | 2 +- views/profileView/leftSection.js | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/styles.css b/styles.css index 4a7b593..24be50b 100644 --- a/styles.css +++ b/styles.css @@ -55,13 +55,17 @@ body { .profile-left-section, .profile-center-section, .profile-right-section { padding: 20px; + margin-top: 30px; } /*profile left section*/ -.profile-left-section { +.profile-left-container { display: flex; justify-content: center; flex-direction: column; + border: 1px solid #e5e5e5; + border-radius: 0.7em; + padding: 25px 20px; } .profile-left-section-picture { @@ -101,4 +105,5 @@ body { .repo-entry > div > span { border-radius: 0.7em; + height: 24px; } diff --git a/views/RootView/searchResultView.js b/views/RootView/searchResultView.js index 0502329..4fb0946 100644 --- a/views/RootView/searchResultView.js +++ b/views/RootView/searchResultView.js @@ -10,7 +10,7 @@ export default class SearchResultView extends React.Component { let githubSearchResults = this.props.searchResults.slice(0, 10).map((person) => { return ( -
        +

        {person.login}

        diff --git a/views/profileView/leftSection.js b/views/profileView/leftSection.js index 51dc7f7..983e9fa 100644 --- a/views/profileView/leftSection.js +++ b/views/profileView/leftSection.js @@ -6,7 +6,7 @@ export default class LeftSection extends React.Component { render () { return ( -
        +

        {this.props.profileInfo.login}

        {this.props.profileInfo.name}
        From 5be7e3dda548b407bfb5bececfae826e1c18acfd Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Sat, 28 May 2016 12:41:48 -0700 Subject: [PATCH 17/26] adds dirty checking for search results if nothing found --- styles.css | 14 ++++++++++-- utils/utils.js | 10 ++++----- views/RootView/index.js | 15 ++++++++++--- views/RootView/searchResultView.js | 36 ++++++++++++++---------------- views/profileView/rightSection.js | 1 - 5 files changed, 46 insertions(+), 30 deletions(-) diff --git a/styles.css b/styles.css index 24be50b..1916004 100644 --- a/styles.css +++ b/styles.css @@ -9,7 +9,14 @@ body { .search-container, .title-container { display: flex; - justify-content: center; + justify-content: center; + min-width: 1100px; +} + +.search-results-container { + position: absolute; + left: 558px; + z-index: 1; } .title-container { @@ -22,11 +29,15 @@ body { flex-direction: column; background-color: #f5f5f5; border: 1px solid #e5e5e5; + padding: 30px; + height: 172px; + min-width: 1100px; } .person-entry-view-holder { display: flex; justify-content: center; + background-color: white; } .person-entry-view { @@ -55,7 +66,6 @@ body { .profile-left-section, .profile-center-section, .profile-right-section { padding: 20px; - margin-top: 30px; } /*profile left section*/ diff --git a/utils/utils.js b/utils/utils.js index e29d824..84496ea 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -1,4 +1,3 @@ - export function debounce (func, wait, immediate) { let timeout; return function() { @@ -26,12 +25,13 @@ export function fetchData (query, context) { }) .then((responseData) => { context.setState({ - searchResults : responseData.items + searchResults : responseData.items, + dirtySearch : true }); console.log('state changed ', context.state); }) .catch((err) => { - console.log(err); + throw new Error(err); }) }; @@ -51,7 +51,7 @@ export function fetchUserData (query, context) { fetchUserFollowersRepos(context.state.currentFocus.followers_url, context, 'followers'); }) .catch((err) => { - console.log(err); + throw new Error(err); }) }; @@ -73,7 +73,7 @@ const fetchUserFollowersRepos = (query, context, update) => { console.log('state changed', context.state); }) .catch((err) => { - console.log(err); + throw new Error(err); }) }; diff --git a/views/RootView/index.js b/views/RootView/index.js index 7278b3c..aeae06a 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -21,10 +21,17 @@ export default class RootView extends React.Component { componentDidMount () { this.debouncedGithubSearch = debounce ((query) => { + query = query.trim(); if (query.length >= 3) { fetchData(query, this); } - }, 200); + if (query.length === 0) { + this.setState({ + searchResults: [], + dirtySearch : false + }); + } + }, 400); } handleChange (event) { @@ -34,7 +41,7 @@ export default class RootView extends React.Component { handleClick (event) { // console.log(this.state) const person_clicked = event.currentTarget.firstChild.nextSibling.innerHTML; - console.log(person_clicked) + console.log('clicked on', person_clicked) fetchUserData(person_clicked, this); } @@ -57,7 +64,9 @@ export default class RootView extends React.Component {
        - + {this.props.children}
        {profilePage} diff --git a/views/RootView/searchResultView.js b/views/RootView/searchResultView.js index 4fb0946..f9411ee 100644 --- a/views/RootView/searchResultView.js +++ b/views/RootView/searchResultView.js @@ -1,31 +1,29 @@ import React from 'react'; -const renderIf = predicate => element => predicate && element; - export default class SearchResultView extends React.Component { render () { - const noSearchResults = renderIf(this.props.searchResults.length === 0); - const searchResults = renderIf(this.props.searchResults.length !== 0); - let githubSearchResults = this.props.searchResults.slice(0, 10).map((person) => { - return ( -
        -
        - -

        {person.login}

        -
        + let githubSearchResults; + if (this.props.searchResults.length > 0) { + githubSearchResults = this.props.searchResults.slice(0, 10).map((person) => { + return ( +
        +
        + +
        {person.login}
        +
        +
        -
        - ); - }); + ); + }); + } else if (this.props.dirtySearch){ + githubSearchResults = No results. Please search for another user. + } return ( -
        - {searchResults(githubSearchResults)} - {noSearchResults( - No results. Please search for another user. - )} +
        + {githubSearchResults}
        ); } diff --git a/views/profileView/rightSection.js b/views/profileView/rightSection.js index afb2991..8e67497 100644 --- a/views/profileView/rightSection.js +++ b/views/profileView/rightSection.js @@ -6,7 +6,6 @@ export default class RightSection extends React.Component { let repos; if (this.props.currentProfileRepos.length > 0) { repos = this.props.currentProfileRepos.map((repo) => { - console.log(repo); return (
      • From d5b1f03b89b9bec3f5ad6e635d90ab386251dd9b Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Sat, 28 May 2016 12:59:45 -0700 Subject: [PATCH 18/26] adds style for serach results dropdown --- styles.css | 5 +++++ utils/utils.js | 1 - views/RootView/index.js | 4 +++- views/profileView/index.js | 4 ++-- views/profileView/leftSection.js | 26 +++++++++++++++++++++----- 5 files changed, 31 insertions(+), 9 deletions(-) diff --git a/styles.css b/styles.css index 1916004..7b2bb25 100644 --- a/styles.css +++ b/styles.css @@ -40,6 +40,11 @@ body { background-color: white; } +.person-entry-view-holder:hover { + cursor: pointer; + background-color: #f5f5f5; +} + .person-entry-view { display: flex; justify-content: space-between; diff --git a/utils/utils.js b/utils/utils.js index 84496ea..ad774df 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -95,7 +95,6 @@ export function stringifyDate (stringDate) { let formattedDate = stringDate.substr(0, 10).split('-'); formattedDate = months[formattedDate[1]]+' '+formattedDate[2]+' '+formattedDate[0]; - // console.log(formattedDate) return formattedDate; }; \ No newline at end of file diff --git a/views/RootView/index.js b/views/RootView/index.js index aeae06a..493717a 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -39,10 +39,12 @@ export default class RootView extends React.Component { } handleClick (event) { - // console.log(this.state) const person_clicked = event.currentTarget.firstChild.nextSibling.innerHTML; console.log('clicked on', person_clicked) fetchUserData(person_clicked, this); + // this.setState({ + // searchResults : [] + // }); } render () { diff --git a/views/profileView/index.js b/views/profileView/index.js index a2bef76..d54a6db 100644 --- a/views/profileView/index.js +++ b/views/profileView/index.js @@ -12,11 +12,11 @@ export default class ProfileView extends React.Component {
        - followers +
        Followers
        - repos +
        Repos
        diff --git a/views/profileView/leftSection.js b/views/profileView/leftSection.js index 983e9fa..65fd972 100644 --- a/views/profileView/leftSection.js +++ b/views/profileView/leftSection.js @@ -4,17 +4,33 @@ import {stringifyDate} from '../../utils/utils.js'; export default class LeftSection extends React.Component { render () { + let company, blog, location, email, bio; + if (this.props.profileInfo.company){ + company =
        {this.props.profileInfo.company}
        ; + }; + if (this.props.profileInfo.blog){ + blog =
        {this.props.profileInfo.blog}
        ; + }; + if (this.props.profileInfo.location){ + location =
        {this.props.profileInfo.location}
        ; + }; + if (this.props.profileInfo.email){ + email =
        {this.props.profileInfo.email}
        ; + }; + if (this.props.profileInfo.bio){ + bio =
        {this.props.profileInfo.bio}
        ; + }; return (

        {this.props.profileInfo.login}

        {this.props.profileInfo.name}
        -
        {this.props.profileInfo.company}
        -
        {this.props.profileInfo.blog}
        -
        {this.props.profileInfo.location}
        -
        {this.props.profileInfo.email}
        -
        {this.props.profileInfo.bio}
        + {company} + {blog} + {location} + {email} + {bio}
        profile created at: {stringifyDate(this.props.profileInfo.created_at)}
        ) From 528bb81d50958957788e273fa34731c70632d592 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Sat, 28 May 2016 13:56:00 -0700 Subject: [PATCH 19/26] clicking on any of the followers displays a new profile --- styles.css | 16 +++++++++++----- views/RootView/index.js | 21 +++++++++++++++------ views/profileView/centerSection.js | 2 +- views/profileView/index.js | 4 +++- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/styles.css b/styles.css index 7b2bb25..7d92133 100644 --- a/styles.css +++ b/styles.css @@ -19,10 +19,6 @@ body { z-index: 1; } -.title-container { - padding-top: 10px; -} - .results-display-container { display: flex; justify-content: center; @@ -73,14 +69,19 @@ body { padding: 20px; } +.list-group-item { + padding: 0; +} + /*profile left section*/ .profile-left-container { display: flex; - justify-content: center; + justify-content: flex-start; flex-direction: column; border: 1px solid #e5e5e5; border-radius: 0.7em; padding: 25px 20px; + height: 450px; } .profile-left-section-picture { @@ -102,6 +103,11 @@ body { justify-content: space-between; } +.followers-list-entry:hover { + cursor: pointer; + background-color: #f5f5f5; +} + .followers-list-image { height: 40px; width: 40px; diff --git a/views/RootView/index.js b/views/RootView/index.js index 493717a..2b7443b 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -15,7 +15,8 @@ export default class RootView extends React.Component { searchResults : [], currentFocus : null, currentFocusRepos: [], - currentFocusFollowers: [] + currentFocusFollowers: [], + dirtySearch: false }; } @@ -38,13 +39,20 @@ export default class RootView extends React.Component { this.debouncedGithubSearch(event.target.value); } - handleClick (event) { + handleSearchClick (event) { const person_clicked = event.currentTarget.firstChild.nextSibling.innerHTML; console.log('clicked on', person_clicked) fetchUserData(person_clicked, this); - // this.setState({ - // searchResults : [] - // }); + this.setState({ + searchResults : [], + dirtySearch: false + }); + } + + handleFollowersClick (event) { + const person_clicked = event.currentTarget.firstChild.firstChild.nextSibling.innerHTML; + console.log('clicked on', person_clicked); + fetchUserData(person_clicked, this); } render () { @@ -54,6 +62,7 @@ export default class RootView extends React.Component { currentProfile={this.state.currentFocus} currentProfileFollowers={this.state.currentFocusFollowers} currentProfileRepos={this.state.currentFocusRepos} + handleClick={this.handleFollowersClick.bind(this)} />; } @@ -68,7 +77,7 @@ export default class RootView extends React.Component {
        + handleClick={this.handleSearchClick.bind(this)}/> {this.props.children}
      • {profilePage} diff --git a/views/profileView/centerSection.js b/views/profileView/centerSection.js index 449ed97..ab9dcf6 100644 --- a/views/profileView/centerSection.js +++ b/views/profileView/centerSection.js @@ -7,7 +7,7 @@ export default class CenterSection extends React.Component { if (this.props.currentProfileFollowers.length > 0) { followers = this.props.currentProfileFollowers.map((follower) => { return ( -
      • +
      • {follower.login}
        diff --git a/views/profileView/index.js b/views/profileView/index.js index d54a6db..4856154 100644 --- a/views/profileView/index.js +++ b/views/profileView/index.js @@ -13,7 +13,9 @@ export default class ProfileView extends React.Component {
        Followers
        - +
        Repos
        From fa7702e9a5cae2aa7d37156a450028affd031cc2 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Sat, 28 May 2016 14:24:08 -0700 Subject: [PATCH 20/26] adds style and makes search results disappear when user is selected --- styles.css | 9 +++++---- utils/utils.js | 1 - views/RootView/index.js | 2 +- views/profileView/centerSection.js | 2 +- views/profileView/leftSection.js | 14 +++++++------- views/profileView/rightSection.js | 3 ++- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/styles.css b/styles.css index 7d92133..bbd4214 100644 --- a/styles.css +++ b/styles.css @@ -69,10 +69,6 @@ body { padding: 20px; } -.list-group-item { - padding: 0; -} - /*profile left section*/ .profile-left-container { display: flex; @@ -98,9 +94,14 @@ body { overflow: scroll; } +#follower-entry-container { + padding: 0; +} + .followers-list-entry { display: flex; justify-content: space-between; + padding: 8px 10px; } .followers-list-entry:hover { diff --git a/utils/utils.js b/utils/utils.js index ad774df..27bc642 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -28,7 +28,6 @@ export function fetchData (query, context) { searchResults : responseData.items, dirtySearch : true }); - console.log('state changed ', context.state); }) .catch((err) => { throw new Error(err); diff --git a/views/RootView/index.js b/views/RootView/index.js index 2b7443b..32d2e55 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -70,7 +70,7 @@ export default class RootView extends React.Component {
        -

        Welcome To The Exercise

        +

        Search GitHub Users

        diff --git a/views/profileView/centerSection.js b/views/profileView/centerSection.js index ab9dcf6..d9fbaf6 100644 --- a/views/profileView/centerSection.js +++ b/views/profileView/centerSection.js @@ -7,7 +7,7 @@ export default class CenterSection extends React.Component { if (this.props.currentProfileFollowers.length > 0) { followers = this.props.currentProfileFollowers.map((follower) => { return ( -
      • +
      • {follower.login}
        diff --git a/views/profileView/leftSection.js b/views/profileView/leftSection.js index 65fd972..a37e844 100644 --- a/views/profileView/leftSection.js +++ b/views/profileView/leftSection.js @@ -6,32 +6,32 @@ export default class LeftSection extends React.Component { render () { let company, blog, location, email, bio; if (this.props.profileInfo.company){ - company =
        {this.props.profileInfo.company}
        ; + company =
        {this.props.profileInfo.company}
        ; }; if (this.props.profileInfo.blog){ - blog =
        {this.props.profileInfo.blog}
        ; + blog =
        {this.props.profileInfo.blog}
        ; }; if (this.props.profileInfo.location){ - location =
        {this.props.profileInfo.location}
        ; + location =
        {this.props.profileInfo.location}
        ; }; if (this.props.profileInfo.email){ - email =
        {this.props.profileInfo.email}
        ; + email =
        {this.props.profileInfo.email}
        ; }; if (this.props.profileInfo.bio){ - bio =
        {this.props.profileInfo.bio}
        ; + bio =
        {this.props.profileInfo.bio}
        ; }; return (

        {this.props.profileInfo.login}

        -
        {this.props.profileInfo.name}
        +
        {this.props.profileInfo.name}
        {company} {blog} {location} {email} {bio} -
        profile created at: {stringifyDate(this.props.profileInfo.created_at)}
        +
        profile created at: {stringifyDate(this.props.profileInfo.created_at)}
        ) } diff --git a/views/profileView/rightSection.js b/views/profileView/rightSection.js index 8e67497..3b24740 100644 --- a/views/profileView/rightSection.js +++ b/views/profileView/rightSection.js @@ -6,11 +6,12 @@ export default class RightSection extends React.Component { let repos; if (this.props.currentProfileRepos.length > 0) { repos = this.props.currentProfileRepos.map((repo) => { + console.log(repo) return (
      • {repo.name}
        - {repo.forks} forks + {repo.stargazers_count} stars
      • ) From 00c078c7c9c8b9cfb86927e497bc9aef12b4a165 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Sat, 28 May 2016 15:48:01 -0700 Subject: [PATCH 21/26] fixes search github results being off-center --- routes.js | 1 - styles.css | 8 +++++++- views/FishView/index.js | 26 -------------------------- views/RootView/index.js | 7 ++++--- views/RootView/searchResultView.js | 8 ++++---- 5 files changed, 15 insertions(+), 35 deletions(-) delete mode 100644 views/FishView/index.js diff --git a/routes.js b/routes.js index b41fbd3..40866c3 100644 --- a/routes.js +++ b/routes.js @@ -1,7 +1,6 @@ import React from 'react'; import { Route } from 'react-router'; import HomeView from './views/RootView'; -import FishView from './views/FishView'; var styles = require('./styles.css'); var bootstrap = require('./node_modules/bootstrap/dist/css/bootstrap.css'); diff --git a/styles.css b/styles.css index bbd4214..a894191 100644 --- a/styles.css +++ b/styles.css @@ -13,10 +13,16 @@ body { min-width: 1100px; } +.search-container { + position: relative; +} + .search-results-container { position: absolute; - left: 558px; + left: 400px; + top: 37px; z-index: 1; + padding: 0; } .results-display-container { diff --git a/views/FishView/index.js b/views/FishView/index.js deleted file mode 100644 index 642747f..0000000 --- a/views/FishView/index.js +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react'; - -let people = [ - 'egan', - 'mark', - 'alash' -]; - -export default class FishView extends React.Component { - render () { - - let searchResults = people.map((person) => { - return ( -
        -

        {person}

        -
        - ) - }); - - return ( -
        - {searchResults} -
        - ); - } -} diff --git a/views/RootView/index.js b/views/RootView/index.js index 32d2e55..1573fa9 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -74,10 +74,11 @@ export default class RootView extends React.Component {
        +
        - {this.props.children}
        {profilePage} diff --git a/views/RootView/searchResultView.js b/views/RootView/searchResultView.js index f9411ee..020ce87 100644 --- a/views/RootView/searchResultView.js +++ b/views/RootView/searchResultView.js @@ -8,13 +8,13 @@ export default class SearchResultView extends React.Component { if (this.props.searchResults.length > 0) { githubSearchResults = this.props.searchResults.slice(0, 10).map((person) => { return ( -
        +
      • {person.login}
        -
      • +
      • ); }); } else if (this.props.dirtySearch){ @@ -22,9 +22,9 @@ export default class SearchResultView extends React.Component { } return ( -
        +
          {githubSearchResults} -
        +
      ); } From c2a7e6475a2259c422a81b4904bffe256dd73082 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Sat, 28 May 2016 17:16:32 -0700 Subject: [PATCH 22/26] adds sass scss file --- routes.js | 3 +- styles.scss | 145 +++++++++++++++++++++++++++++ stylesheet.css | 114 +++++++++++++++++++++++ utils/utils.js | 1 - views/RootView/searchResultView.js | 1 + views/profileView/rightSection.js | 1 - 6 files changed, 261 insertions(+), 4 deletions(-) create mode 100644 styles.scss create mode 100644 stylesheet.css diff --git a/routes.js b/routes.js index 40866c3..a1b2a87 100644 --- a/routes.js +++ b/routes.js @@ -1,8 +1,7 @@ import React from 'react'; import { Route } from 'react-router'; import HomeView from './views/RootView'; - -var styles = require('./styles.css'); +var styles = require('./stylesheet.css.css'); var bootstrap = require('./node_modules/bootstrap/dist/css/bootstrap.css'); const routes = ( diff --git a/styles.scss b/styles.scss new file mode 100644 index 0000000..000abef --- /dev/null +++ b/styles.scss @@ -0,0 +1,145 @@ +$min-width :1100px; +$super-light-grey:#f5f5f5; +$light-grey :#e5e5e5; + +@mixin flex-centered() { + display : flex; + justify-content : center; +} + + +body { + display: flex; + justify-content: center; +} + +#search-box { + width: 300px; +} + +.search-container, .title-container { + @include flex-centered; + min-width: $min-width; +} + +.search-container { + position: relative; +} + +.search-results-container { + position: absolute; + left: 400px; + top: 37px; + z-index: 1; + padding: 0; +} + +.results-display-container { + @include flex-centered; + flex-direction: column; + background-color: $super-light-grey; + border: 1px solid $light-grey; + padding: 30px; + height: 172px; + min-width: $min-width; +} + +.person-entry-view-holder { + @include flex-centered; + background-color: white; +} + +.person-entry-view-holder:hover { + cursor: pointer; + background-color: $super-light-grey; +} + +.person-entry-view { + display: flex; + justify-content: space-between; + padding: 5px; + border: 1px solid $light-grey; + width: 300px; +} + +.person-entry-view-image, .person-entry-view-spacer { + height: 50px; + width: 50px; +} + +.person-entry-view-no-results { + @include flex-centered; +} + + +/*profile partial css below*/ +.profile-container, .title-container { + min-width: $min-width; +} + +.profile-left-section, .profile-center-section, .profile-right-section { + padding: 20px; +} + +/*profile left section*/ +.profile-left-container { + display: flex; + justify-content: flex-start; + flex-direction: column; + border: 1px solid $light-grey; + border-radius: 0.7em; + padding: 25px 20px; + height: 450px; +} + +.profile-left-section-picture { + height: 150px; + width: 150px; + background-color: red; + align-self: center; + margin: 20px; +} + +/*profile center section*/ +.followers-list-container { + max-height: 400px; + overflow: scroll; +} + +#follower-entry-container { + padding: 0; +} + +.followers-list-entry { + display: flex; + justify-content: space-between; + padding: 8px 10px; +} + +.followers-list-entry:hover { + cursor: pointer; + background-color: $super-light-grey; +} + +.followers-list-image { + height: 40px; + width: 40px; +} + +/*profile right section*/ +.repo-container { + max-height: 400px; + overflow: scroll; +} + +.repo-entry { + div { + display : flex; + justify-content: space-between; + span { + border-radius: 0.7em; + height: 24px; + } + } +} + diff --git a/stylesheet.css b/stylesheet.css new file mode 100644 index 0000000..6d7acfc --- /dev/null +++ b/stylesheet.css @@ -0,0 +1,114 @@ +body { + display: flex; + justify-content: center; } + +#search-box { + width: 300px; } + +.search-container, .title-container { + display: flex; + justify-content: center; + min-width: 1100px; } + +.search-container { + position: relative; } + +.search-results-container { + position: absolute; + left: 400px; + top: 37px; + z-index: 1; + padding: 0; } + +.results-display-container { + display: flex; + justify-content: center; + flex-direction: column; + background-color: #f5f5f5; + border: 1px solid #e5e5e5; + padding: 30px; + height: 172px; + min-width: 1100px; } + +.person-entry-view-holder { + display: flex; + justify-content: center; + background-color: white; } + +.person-entry-view-holder:hover { + cursor: pointer; + background-color: #f5f5f5; } + +.person-entry-view { + display: flex; + justify-content: space-between; + padding: 5px; + border: 1px solid #e5e5e5; + width: 300px; } + +.person-entry-view-image, .person-entry-view-spacer { + height: 50px; + width: 50px; } + +.person-entry-view-no-results { + display: flex; + justify-content: center; } + +/*profile partial css below*/ +.profile-container, .title-container { + min-width: 1100px; } + +.profile-left-section, .profile-center-section, .profile-right-section { + padding: 20px; } + +/*profile left section*/ +.profile-left-container { + display: flex; + justify-content: flex-start; + flex-direction: column; + border: 1px solid #e5e5e5; + border-radius: 0.7em; + padding: 25px 20px; + height: 450px; } + +.profile-left-section-picture { + height: 150px; + width: 150px; + background-color: red; + align-self: center; + margin: 20px; } + +/*profile center section*/ +.followers-list-container { + max-height: 400px; + overflow: scroll; } + +#follower-entry-container { + padding: 0; } + +.followers-list-entry { + display: flex; + justify-content: space-between; + padding: 8px 10px; } + +.followers-list-entry:hover { + cursor: pointer; + background-color: #f5f5f5; } + +.followers-list-image { + height: 40px; + width: 40px; } + +/*profile right section*/ +.repo-container { + max-height: 400px; + overflow: scroll; } + +.repo-entry div { + display: flex; + justify-content: space-between; } + .repo-entry div span { + border-radius: 0.7em; + height: 24px; } + +/*# sourceMappingURL=stylesheet.css.map */ diff --git a/utils/utils.js b/utils/utils.js index 27bc642..3af8b2a 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -69,7 +69,6 @@ const fetchUserFollowersRepos = (query, context, update) => { currentFocusFollowers : responseData }); } - console.log('state changed', context.state); }) .catch((err) => { throw new Error(err); diff --git a/views/RootView/searchResultView.js b/views/RootView/searchResultView.js index 020ce87..13f13e8 100644 --- a/views/RootView/searchResultView.js +++ b/views/RootView/searchResultView.js @@ -7,6 +7,7 @@ export default class SearchResultView extends React.Component { let githubSearchResults; if (this.props.searchResults.length > 0) { githubSearchResults = this.props.searchResults.slice(0, 10).map((person) => { + console.log(person) return (
    • diff --git a/views/profileView/rightSection.js b/views/profileView/rightSection.js index 3b24740..75305de 100644 --- a/views/profileView/rightSection.js +++ b/views/profileView/rightSection.js @@ -6,7 +6,6 @@ export default class RightSection extends React.Component { let repos; if (this.props.currentProfileRepos.length > 0) { repos = this.props.currentProfileRepos.map((repo) => { - console.log(repo) return (
    • From 0015cfac37c38004bb1c9dd8294eb7969e45d716 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Sat, 28 May 2016 17:27:28 -0700 Subject: [PATCH 23/26] converting styles to SASS --- styles.scss | 40 ++++++++++++++++++---------------------- stylesheet.css | 33 ++++++++++++++------------------- 2 files changed, 32 insertions(+), 41 deletions(-) diff --git a/styles.scss b/styles.scss index 000abef..d9b6136 100644 --- a/styles.scss +++ b/styles.scss @@ -13,17 +13,13 @@ body { justify-content: center; } -#search-box { - width: 300px; -} .search-container, .title-container { @include flex-centered; min-width: $min-width; -} - -.search-container { - position: relative; + #search-box { + width: 300px; + } } .search-results-container { @@ -42,6 +38,9 @@ body { padding: 30px; height: 172px; min-width: $min-width; + .search-container { + position: relative; + } } .person-entry-view-holder { @@ -52,19 +51,17 @@ body { .person-entry-view-holder:hover { cursor: pointer; background-color: $super-light-grey; -} - -.person-entry-view { - display: flex; - justify-content: space-between; - padding: 5px; - border: 1px solid $light-grey; - width: 300px; -} - -.person-entry-view-image, .person-entry-view-spacer { - height: 50px; - width: 50px; + .person-entry-view { + display: flex; + justify-content: space-between; + padding: 5px; + border: 1px solid $light-grey; + width: 300px; + .person-entry-view-image, .person-entry-view-spacer { + height: 50px; + width: 50px; + } + } } .person-entry-view-no-results { @@ -73,7 +70,7 @@ body { /*profile partial css below*/ -.profile-container, .title-container { +.profile-container { min-width: $min-width; } @@ -95,7 +92,6 @@ body { .profile-left-section-picture { height: 150px; width: 150px; - background-color: red; align-self: center; margin: 20px; } diff --git a/stylesheet.css b/stylesheet.css index 6d7acfc..becd0b8 100644 --- a/stylesheet.css +++ b/stylesheet.css @@ -2,16 +2,12 @@ body { display: flex; justify-content: center; } -#search-box { - width: 300px; } - .search-container, .title-container { display: flex; justify-content: center; min-width: 1100px; } - -.search-container { - position: relative; } + .search-container #search-box, .title-container #search-box { + width: 300px; } .search-results-container { position: absolute; @@ -29,6 +25,8 @@ body { padding: 30px; height: 172px; min-width: 1100px; } + .results-display-container .search-container { + position: relative; } .person-entry-view-holder { display: flex; @@ -38,24 +36,22 @@ body { .person-entry-view-holder:hover { cursor: pointer; background-color: #f5f5f5; } - -.person-entry-view { - display: flex; - justify-content: space-between; - padding: 5px; - border: 1px solid #e5e5e5; - width: 300px; } - -.person-entry-view-image, .person-entry-view-spacer { - height: 50px; - width: 50px; } + .person-entry-view-holder:hover .person-entry-view { + display: flex; + justify-content: space-between; + padding: 5px; + border: 1px solid #e5e5e5; + width: 300px; } + .person-entry-view-holder:hover .person-entry-view .person-entry-view-image, .person-entry-view-holder:hover .person-entry-view .person-entry-view-spacer { + height: 50px; + width: 50px; } .person-entry-view-no-results { display: flex; justify-content: center; } /*profile partial css below*/ -.profile-container, .title-container { +.profile-container { min-width: 1100px; } .profile-left-section, .profile-center-section, .profile-right-section { @@ -74,7 +70,6 @@ body { .profile-left-section-picture { height: 150px; width: 150px; - background-color: red; align-self: center; margin: 20px; } From 8f1c7e1d4b54d780f40e617157ea32cfc8589ffd Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Sun, 29 May 2016 12:11:07 -0700 Subject: [PATCH 24/26] fixes sass styling and adds overflow to deal with long repo / user names --- routes.js | 2 +- styles.scss | 16 +++++++++++----- stylesheet.css | 16 ++++++++++------ utils/utils.js | 2 -- views/RootView/index.js | 2 -- views/RootView/searchResultView.js | 1 - 6 files changed, 22 insertions(+), 17 deletions(-) diff --git a/routes.js b/routes.js index a1b2a87..f4fbb56 100644 --- a/routes.js +++ b/routes.js @@ -1,7 +1,7 @@ import React from 'react'; import { Route } from 'react-router'; import HomeView from './views/RootView'; -var styles = require('./stylesheet.css.css'); +var styles = require('./stylesheet.css'); var bootstrap = require('./node_modules/bootstrap/dist/css/bootstrap.css'); const routes = ( diff --git a/styles.scss b/styles.scss index d9b6136..dae4800 100644 --- a/styles.scss +++ b/styles.scss @@ -46,11 +46,6 @@ body { .person-entry-view-holder { @include flex-centered; background-color: white; -} - -.person-entry-view-holder:hover { - cursor: pointer; - background-color: $super-light-grey; .person-entry-view { display: flex; justify-content: space-between; @@ -64,6 +59,11 @@ body { } } +.person-entry-view-holder:hover { + cursor: pointer; + background-color: $super-light-grey; +} + .person-entry-view-no-results { @include flex-centered; } @@ -110,6 +110,9 @@ body { display: flex; justify-content: space-between; padding: 8px 10px; + h6 { + overflow: scroll; + } } .followers-list-entry:hover { @@ -136,6 +139,9 @@ body { border-radius: 0.7em; height: 24px; } + h6 { + overflow: scroll; + } } } diff --git a/stylesheet.css b/stylesheet.css index becd0b8..0c84658 100644 --- a/stylesheet.css +++ b/stylesheet.css @@ -32,20 +32,20 @@ body { display: flex; justify-content: center; background-color: white; } - -.person-entry-view-holder:hover { - cursor: pointer; - background-color: #f5f5f5; } - .person-entry-view-holder:hover .person-entry-view { + .person-entry-view-holder .person-entry-view { display: flex; justify-content: space-between; padding: 5px; border: 1px solid #e5e5e5; width: 300px; } - .person-entry-view-holder:hover .person-entry-view .person-entry-view-image, .person-entry-view-holder:hover .person-entry-view .person-entry-view-spacer { + .person-entry-view-holder .person-entry-view .person-entry-view-image, .person-entry-view-holder .person-entry-view .person-entry-view-spacer { height: 50px; width: 50px; } +.person-entry-view-holder:hover { + cursor: pointer; + background-color: #f5f5f5; } + .person-entry-view-no-results { display: flex; justify-content: center; } @@ -85,6 +85,8 @@ body { display: flex; justify-content: space-between; padding: 8px 10px; } + .followers-list-entry h6 { + overflow: scroll; } .followers-list-entry:hover { cursor: pointer; @@ -105,5 +107,7 @@ body { .repo-entry div span { border-radius: 0.7em; height: 24px; } + .repo-entry div h6 { + overflow: scroll; } /*# sourceMappingURL=stylesheet.css.map */ diff --git a/utils/utils.js b/utils/utils.js index 3af8b2a..db33e9f 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -36,7 +36,6 @@ export function fetchData (query, context) { export function fetchUserData (query, context) { const request_url = 'https://api.github.com/users/' + query; - console.log(request_url); fetch(request_url) .then((response) => { return response.json(); @@ -45,7 +44,6 @@ export function fetchUserData (query, context) { context.setState({ currentFocus : responseData }); - console.log('state changed ', context.state.currentFocus); fetchUserFollowersRepos(context.state.currentFocus.repos_url, context, 'repos'); fetchUserFollowersRepos(context.state.currentFocus.followers_url, context, 'followers'); }) diff --git a/views/RootView/index.js b/views/RootView/index.js index 1573fa9..4aa7ee9 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -41,7 +41,6 @@ export default class RootView extends React.Component { handleSearchClick (event) { const person_clicked = event.currentTarget.firstChild.nextSibling.innerHTML; - console.log('clicked on', person_clicked) fetchUserData(person_clicked, this); this.setState({ searchResults : [], @@ -51,7 +50,6 @@ export default class RootView extends React.Component { handleFollowersClick (event) { const person_clicked = event.currentTarget.firstChild.firstChild.nextSibling.innerHTML; - console.log('clicked on', person_clicked); fetchUserData(person_clicked, this); } diff --git a/views/RootView/searchResultView.js b/views/RootView/searchResultView.js index 13f13e8..020ce87 100644 --- a/views/RootView/searchResultView.js +++ b/views/RootView/searchResultView.js @@ -7,7 +7,6 @@ export default class SearchResultView extends React.Component { let githubSearchResults; if (this.props.searchResults.length > 0) { githubSearchResults = this.props.searchResults.slice(0, 10).map((person) => { - console.log(person) return (
    • From 56c91f6cd52a8fafb7287a7ef39fb9be90d661b9 Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Sun, 29 May 2016 13:29:47 -0700 Subject: [PATCH 25/26] fixing code style --- views/RootView/index.js | 14 ++++++++------ views/profileView/index.js | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/views/RootView/index.js b/views/RootView/index.js index 4aa7ee9..66147e0 100644 --- a/views/RootView/index.js +++ b/views/RootView/index.js @@ -56,11 +56,12 @@ export default class RootView extends React.Component { render () { let profilePage; if (this.state.currentFocus) { - profilePage = ; } @@ -72,7 +73,8 @@ export default class RootView extends React.Component {
      - diff --git a/views/profileView/index.js b/views/profileView/index.js index 4856154..d73862e 100644 --- a/views/profileView/index.js +++ b/views/profileView/index.js @@ -15,7 +15,8 @@ export default class ProfileView extends React.Component {
      Followers
      + currentProfileFollowers={this.props.currentProfileFollowers} + />
      Repos
      From e3d5f6353011a849edb62bc959cd0c714da69aad Mon Sep 17 00:00:00 2001 From: Egan Tamashiro Date: Mon, 30 May 2016 10:46:50 -0700 Subject: [PATCH 26/26] remove unused style sheet --- styles.css | 137 ----------------------------------------------------- 1 file changed, 137 deletions(-) delete mode 100644 styles.css diff --git a/styles.css b/styles.css deleted file mode 100644 index a894191..0000000 --- a/styles.css +++ /dev/null @@ -1,137 +0,0 @@ -body { - display: flex; - justify-content: center; -} - -#search-box { - width: 300px; -} - -.search-container, .title-container { - display: flex; - justify-content: center; - min-width: 1100px; -} - -.search-container { - position: relative; -} - -.search-results-container { - position: absolute; - left: 400px; - top: 37px; - z-index: 1; - padding: 0; -} - -.results-display-container { - display: flex; - justify-content: center; - flex-direction: column; - background-color: #f5f5f5; - border: 1px solid #e5e5e5; - padding: 30px; - height: 172px; - min-width: 1100px; -} - -.person-entry-view-holder { - display: flex; - justify-content: center; - background-color: white; -} - -.person-entry-view-holder:hover { - cursor: pointer; - background-color: #f5f5f5; -} - -.person-entry-view { - display: flex; - justify-content: space-between; - padding: 5px; - border: 1px solid #e5e5e5; - width: 300px; -} - -.person-entry-view-image, .person-entry-view-spacer { - height: 50px; - width: 50px; -} - -.person-entry-view-no-results { - display: flex; - justify-content: center; -} - - -/*profile partial css below*/ -.profile-container, .title-container { - min-width: 1100px; -} - -.profile-left-section, .profile-center-section, .profile-right-section { - padding: 20px; -} - -/*profile left section*/ -.profile-left-container { - display: flex; - justify-content: flex-start; - flex-direction: column; - border: 1px solid #e5e5e5; - border-radius: 0.7em; - padding: 25px 20px; - height: 450px; -} - -.profile-left-section-picture { - height: 150px; - width: 150px; - background-color: red; - align-self: center; - margin: 20px; -} - -/*profile center section*/ -.followers-list-container { - max-height: 400px; - overflow: scroll; -} - -#follower-entry-container { - padding: 0; -} - -.followers-list-entry { - display: flex; - justify-content: space-between; - padding: 8px 10px; -} - -.followers-list-entry:hover { - cursor: pointer; - background-color: #f5f5f5; -} - -.followers-list-image { - height: 40px; - width: 40px; -} - -/*profile right section*/ -.repo-container { - max-height: 400px; - overflow: scroll; -} - -.repo-entry > div { - display: flex; - justify-content: space-between; -} - -.repo-entry > div > span { - border-radius: 0.7em; - height: 24px; -}