forked from reactplay/react-play
-
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.
[#2PlaysAMonth]:Github UserFinder Completed (reactplay#943)
* Fixes-Bug#903: Fixed Server break due to linting issues * [#2PlaysAMonth]:Github UserFinder Completed * [#2PlaysAMonth]:Done with asked changes * Made changes as requested * Made Styles Changes so that it doesn't overlap and override other styles. * Done with requested changes and edited play and uploaded the stackstream video. * Fix:Fixed Linting issues --------- Co-authored-by: Tapas Adhikary <[email protected]> Co-authored-by: Sachin Chaurasiya <[email protected]>
- Loading branch information
1 parent
135976f
commit 8c241ff
Showing
21 changed files
with
763 additions
and
258 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
.app-header-btn { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
border: solid 1px var(--color-brand-primary); | ||
border-radius: 2rem; | ||
grid-gap: 0.4rem; | ||
padding: 0.4rem 1.2rem; | ||
font-size: var(--fs-sm); | ||
text-decoration: none; | ||
width: unset; | ||
height: unset; | ||
transition: all 0.12s ease-in-out; | ||
} | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
border: solid 1px var(--color-brand-primary); | ||
border-radius: 2rem; | ||
grid-gap: 0.4rem; | ||
padding: 0.4rem 1.2rem; | ||
font-size: var(--fs-sm); | ||
text-decoration: none; | ||
width: unset; | ||
height: unset; | ||
transition: all 0.12s ease-in-out; | ||
} | ||
|
||
.app-header-btn--primary { | ||
border: solid 2px var(--color-brand-primary); | ||
background-color: var(--color-brand-primary); | ||
color: var(--color-neutral-80); | ||
grid-gap: 0.3rem; | ||
margin-left: 0.4rem; | ||
} | ||
.app-header-btn--primary { | ||
border: solid 2px var(--color-brand-primary); | ||
background-color: var(--color-brand-primary); | ||
color: var(--color-neutral-80); | ||
grid-gap: 0.3rem; | ||
margin-left: 0.4rem; | ||
} |
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,37 +1,39 @@ | ||
.leaderboard-container { | ||
border: 0 solid black; | ||
border-radius: 5px; | ||
background-color: white; | ||
margin-top: 10px; | ||
margin-bottom: 20px; | ||
padding: 5px 2rem 1rem 2rem; | ||
--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); | ||
--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color); | ||
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); | ||
border: 0 solid black; | ||
border-radius: 5px; | ||
background-color: white; | ||
margin-top: 10px; | ||
margin-bottom: 20px; | ||
padding: 5px 2rem 1rem 2rem; | ||
--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); | ||
--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), | ||
0 8px 10px -6px var(--tw-shadow-color); | ||
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), | ||
var(--tw-shadow); | ||
} | ||
|
||
.leaderboard-table-cell { | ||
padding: 6px !important; | ||
padding: 6px !important; | ||
} | ||
|
||
.leaderboard-table-header { | ||
font-weight: 700 !important; | ||
font-family: var(--ff-accent) !important; | ||
font-weight: 700 !important; | ||
font-family: var(--ff-accent) !important; | ||
} | ||
|
||
.leaderboard-heading { | ||
font-family: var(--ff-accent); | ||
font-size: 32px !important; | ||
font-family: var(--ff-accent); | ||
font-size: 32px !important; | ||
} | ||
|
||
.leaderboard-text { | ||
font-family: var(--ff-accent) !important; | ||
font-size: var(--fs-md) !important; | ||
font-family: var(--ff-accent) !important; | ||
font-size: var(--fs-md) !important; | ||
} | ||
|
||
.leaderboard-loader { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100vh; | ||
} | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100vh; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import PlayHeader from 'common/playlists/PlayHeader'; | ||
import InputCard from './components/InputCard'; | ||
import ProfileCard from './components/ProfileCard'; | ||
import { ResultContextProvider } from './context/ResultContext'; | ||
import './styles.css'; | ||
|
||
// WARNING: Do not change the entry componenet name | ||
function GithubUserFinder(props) { | ||
// Your Code Start below. | ||
|
||
return ( | ||
<> | ||
<div className="play-details"> | ||
<PlayHeader play={props} /> | ||
<div className="play-details-body"> | ||
{/* Your Code Starts Here */} | ||
<ResultContextProvider> | ||
<div className="flex justify-center flex-col p-8 m-8 App guf"> | ||
<InputCard /> | ||
<ProfileCard /> | ||
</div> | ||
</ResultContextProvider> | ||
|
||
{/* Your Code Ends Here */} | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
export default GithubUserFinder; |
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,31 @@ | ||
# Github User Finder | ||
|
||
So user will be asked to input a valid github username and user data will be shown in a card component. | ||
|
||
## Play Demographic | ||
|
||
- Language: js | ||
- Level: Intermediate | ||
|
||
## Creator Information | ||
|
||
- User: ANKIT9761 | ||
- Gihub Link: https://github.com/ANKIT9761 | ||
- Blog: | ||
- Video: | ||
|
||
## Implementation Details | ||
|
||
So basically this could be done in normal js much faster i guess due to no major reusable components in this.But for this splitting logic between components and way to communicate and manage state between two childrens is hectic. | ||
So usecontext api is used for global state management. | ||
Then an Api client is required to fetch the user data from github api so i have used axios or this. | ||
Then it is just how you present the data. | ||
|
||
## Consideration | ||
|
||
Although i wanna do the repo part also one thing i noticed when batching 2 updates on find button as 2 calls are made to change so component rerenders 2 time. | ||
Maybe we can add another button later saying fetch repos and then it will make a call later. | ||
|
||
## Resources | ||
|
||
[GitHub Search API](https://docs.github.com/en/rest/search) |
Oops, something went wrong.