Skip to content

Commit 4f0848a

Browse files
committed
Improved UI/UX in the Github Fetch Example
1 parent 7af2a5d commit 4f0848a

File tree

6 files changed

+46
-4
lines changed

6 files changed

+46
-4
lines changed

examples/github-repos-demo/src/components/loading-card/loading-card.jsx

+16
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,29 @@ const LoadingCard = styled.div`
44
width: 33.33%;
55
padding: 20px;
66
7+
@media (max-width: 375px){
8+
width: 100%;
9+
}
10+
11+
@media (max-width: 667px){
12+
width: 100%;
13+
}
14+
715
> .content{
816
display: flex;
917
padding: 20px;
1018
background-color: #ffffff;
1119
box-shadow: 0 0 20px rgba(0,0,0,0.1);
1220
flex-direction: column;
1321
22+
@media (max-width: 375px){
23+
border-radius: 0;
24+
}
25+
26+
@media (max-width: 667px){
27+
border-radius: 0;
28+
}
29+
1430
.row{
1531
margin-bottom: 5px;
1632

examples/github-repos-demo/src/components/repo-card/stylesheets/repo-card.scss

+17
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
.repo-card{
22
width: 33.33%;
3+
max-width: 100%;
34
padding: 20px;
45

6+
@media (max-width: 375px){
7+
width: 100%;
8+
}
9+
10+
@media (max-width: 667px){
11+
width: 100%;
12+
}
13+
514
> .content{
615
display: flex;
716
padding: 20px;
@@ -10,6 +19,14 @@
1019
flex-direction: column;
1120
border-radius: 4px;
1221

22+
@media (max-width: 375px){
23+
border-radius: 0;
24+
}
25+
26+
@media (max-width: 667px){
27+
border-radius: 0;
28+
}
29+
1330
.row{
1431
margin-bottom: 5px;
1532
width: 100%;

examples/github-repos-demo/src/components/repos-grid/stylesheets/repos-grid.scss

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#ReposGrid{
22
width: 1300px;
3+
max-width: 100%;
34
margin: 0 auto;
45
margin-top: 20px;
56
margin-bottom: 50px;

examples/github-repos-demo/src/components/search-user/stylesheets/search-user.scss

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#SearchUser{
22

33
width: 600px;
4+
max-width: 100%;
45
margin: 0 auto;
56
margin-top: 50px;
67

@@ -17,6 +18,14 @@
1718
justify-content: center;
1819
border-radius: 4px;
1920

21+
@media (max-width: 375px){
22+
border-radius: 0;
23+
}
24+
25+
@media (max-width: 667px){
26+
border-radius: 0;
27+
}
28+
2029
input{
2130
width: 100%;
2231
border: 1px solid #E1DFDF;

examples/github-repos-demo/src/containers/app.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import DevTools from 'mobx-react-devtools';
2+
//import DevTools from 'mobx-react-devtools';
33

44
import Header from '../components/header/header';
55
import SearchUser from '../components/search-user/search-user';
@@ -10,7 +10,7 @@ import '../stylesheets/common.scss';
1010

1111
const App = () => (
1212
<div id="app">
13-
<DevTools />
13+
1414
<Header />
1515
<SearchUser />
1616
<ReposGrid />

examples/github-repos-demo/src/stores/github.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class GithubStore {
1515
}
1616

1717
async fetchFromGithub(endpoint) {
18-
const url = `https://api.github.com${endpoint}?client_id=my_key&client_secret=my_secret`;
18+
const url = `https://api.github.com${endpoint}?client_id=62b5dd81cbcb92f3cdf9&client_secret=1c41dfda0d56eb31b722049aa60d91eafeb6ebcf`;
1919
const response = await fetch(url);
2020
return await response.json();
2121
}
@@ -38,7 +38,6 @@ export default class GithubStore {
3838
this.user = user;
3939
this.repos = repos;
4040
this.fetchingData = false;
41-
console.log(this.repos);
4241
});
4342
};
4443
}

0 commit comments

Comments
 (0)