Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c6d5d36
adds simple debounced function that runs on input field change
etAtBat May 25, 2016
d958a59
adds function that makes call to GitHub api with value from input fie…
etAtBat May 25, 2016
b6f4cd4
searching returns ten results fomr GitHub, displays picture and user-…
etAtBat May 25, 2016
b60336d
state updates with information of the person who is clicked in the dr…
etAtBat May 26, 2016
e22dc3c
adds a css file and gets rid of inline react styles
etAtBat May 27, 2016
e4ad843
adds relevant user information to the state (the user that was clicke…
etAtBat May 27, 2016
1a11e71
adds basic layout for profile page, gets bootstrap involved
etAtBat May 27, 2016
ee66449
profile page not loads only if there is something in the current stat…
etAtBat May 28, 2016
f131ead
clicking on a search result fills the profile page with user info
etAtBat May 28, 2016
3b4868c
adds profile user's followers and repo list to state
etAtBat May 28, 2016
ef9aea0
adds formatting function for the funny format the GitHub returns the …
etAtBat May 28, 2016
e9f41a9
adds right and center sections to profile view
etAtBat May 28, 2016
c285473
current profile followers now render
etAtBat May 28, 2016
8ef29f9
adds styles to the list of followers
etAtBat May 28, 2016
e010143
all repos for a profile are rendering and style added
etAtBat May 28, 2016
8c2df09
adds style to the profile page
etAtBat May 28, 2016
5be7e3d
adds dirty checking for search results if nothing found
etAtBat May 28, 2016
d5b1f03
adds style for serach results dropdown
etAtBat May 28, 2016
528bb81
clicking on any of the followers displays a new profile
etAtBat May 28, 2016
fa7702e
adds style and makes search results disappear when user is selected
etAtBat May 28, 2016
00c078c
fixes search github results being off-center
etAtBat May 28, 2016
c2a7e64
adds sass scss file
etAtBat May 29, 2016
0015cfa
converting styles to SASS
etAtBat May 29, 2016
8f1c7e1
fixes sass styling and adds overflow to deal with long repo / user names
etAtBat May 29, 2016
56c91f6
fixing code style
etAtBat May 29, 2016
e3d5f63
remove unused style sheet
etAtBat May 30, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions routes.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
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('./stylesheet.css');
var bootstrap = require('./node_modules/bootstrap/dist/css/bootstrap.css');

const routes = (
<Route path="/" component={HomeView} >
<Route path='fish' component={FishView} />
<Route path="/" component={HomeView}>
</Route>
);

Expand Down
147 changes: 147 additions & 0 deletions styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
$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-container, .title-container {
@include flex-centered;
min-width: $min-width;
#search-box {
width: 300px;
}
}

.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;
.search-container {
position: relative;
}
}

.person-entry-view-holder {
@include flex-centered;
background-color: white;
.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-holder:hover {
cursor: pointer;
background-color: $super-light-grey;
}

.person-entry-view-no-results {
@include flex-centered;
}


/*profile partial css below*/
.profile-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;
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;
h6 {
overflow: scroll;
}
}

.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;
}
h6 {
overflow: scroll;
}
}
}

113 changes: 113 additions & 0 deletions stylesheet.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

96 changes: 96 additions & 0 deletions utils/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
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);
}
};
};

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) => {
context.setState({
searchResults : responseData.items,
dirtySearch : true
});
})
.catch((err) => {
throw new Error(err);
})
};

export function fetchUserData (query, context) {
const request_url = 'https://api.github.com/users/' + query;
fetch(request_url)
.then((response) => {
return response.json();
})
.then((responseData) => {
context.setState({
currentFocus : responseData
});
fetchUserFollowersRepos(context.state.currentFocus.repos_url, context, 'repos');
fetchUserFollowersRepos(context.state.currentFocus.followers_url, context, 'followers');
})
.catch((err) => {
throw new Error(err);
})
};

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
});
}
})
.catch((err) => {
throw new Error(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'
}

let formattedDate = stringDate.substr(0, 10).split('-');
formattedDate = months[formattedDate[1]]+' '+formattedDate[2]+' '+formattedDate[0];

return formattedDate;
};
11 changes: 0 additions & 11 deletions views/FishView/index.js

This file was deleted.

Loading