Skip to content

Commit

Permalink
Merge pull request #39 from EmanuelGF/minor-fixes
Browse files Browse the repository at this point in the history
Fixes and enhancements.
  • Loading branch information
version0chiro authored Jul 1, 2021
2 parents 65d405c + b2d482a commit e0afbae
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 29 deletions.
Binary file modified client/public/favicon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
content="Find github repositories containing good firs issues"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
Expand All @@ -27,7 +27,7 @@
<!--Fontawesome icons-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<title>React App</title>
<title>Find Me Issues</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
4 changes: 2 additions & 2 deletions client/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "Find Me Issues",
"name": "Find repositories containing good firs issues.",
"icons": [
{
"src": "favicon.ico",
Expand Down
11 changes: 6 additions & 5 deletions client/src/components/CardSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ const CardSet = (props) => {
const [isLoading, setIsLoading] = useState(false);
const [wasRejected, setWasRejected] = useState(false);
const { theme } = useContext(ThemeContext);

let url = `https://api.github.com/search/repositories?q=good-first-issues:>0+language:${
props.language
}${props.inputSearch !== "" ? `:${props.inputSearch}+in%3Atitle` : ""}&page=${
}${!isEmpty(props.inputSearch) ? `:${props.inputSearch}+in%3Atitle` : ""}&page=${
props.pageNumber
}&per_page=10`;

let urlSuffix = "";
if (props.sortByStars == "desc") urlSuffix = "&sort=stars&order=desc";
else if (props.sortByStars == "asc") urlSuffix = "&sort=stars&order=asc";
else if (props.sortByForks == "desc") urlSuffix = "&sort=forks&order=desc";
else if (props.sortByForks == "asc") urlSuffix = "&sort=forks&order=asc";
if (props.sortByStars === "desc") urlSuffix = "&sort=stars&order=desc";
else if (props.sortByStars === "asc") urlSuffix = "&sort=stars&order=asc";
else if (props.sortByForks === "desc") urlSuffix = "&sort=forks&order=desc";
else if (props.sortByForks === "asc") urlSuffix = "&sort=forks&order=asc";

useEffect(() => {
// console.log("stars", props.sortByStars, "forks", props.sortByForks);
Expand Down
33 changes: 14 additions & 19 deletions client/src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ const Header = (props) => {

const handleSortByStars = () => {
props.setSortByForks("");
if (props.sortByStars == "desc") props.setSortByStars("asc");
if (props.sortByStars === "desc") props.setSortByStars("asc");
else props.setSortByStars("desc");
};
const handleSortByForks = () => {
props.setSortByStars("");
if (props.sortByForks == "desc") props.setSortByForks("asc");
if (props.sortByForks === "desc") props.setSortByForks("asc");
else props.setSortByForks("desc");
};

Expand All @@ -39,42 +39,36 @@ const Header = (props) => {
<Navbar bg={theme.mode} variant={theme.mode} expand="lg">
<Navbar.Brand href="#home">Find Me Issues</Navbar.Brand>
{theme.mode === "light" ? (
<Button onClick={changeTheme}>
<Button onClick={changeTheme} size="sm">
<i className="fa fa-moon-o" aria-hidden="true"></i>
</Button>
) : (
<Button onClick={changeTheme}>
<Button onClick={changeTheme} size="sm">
<i className="fa fa-sun-o" aria-hidden="true"></i>
</Button>
)}
<Nav className="mr-auto"></Nav>

<button
<Button size="sm"
style={{
margin: "3px",
borderRadius: "5px",
backgroundColor: "blue",
color: "white",
margin: "0px 3px",
}}
onClick={handleSortByStars}
>
sort by stars
</button>
<button
Sort by stars
</Button>
<Button size="sm"
style={{
margin: "3px",
borderRadius: "5px",
backgroundColor: "blue",
color: "white",
margin: "0px 3px",
}}
onClick={handleSortByForks}
>
sort by forks
</button>
Sort by forks
</Button>

<Form inline>
<label className="mr-sm-3">
<span>Find specific content in the project description</span>
<span className="ml-2 mr-1">Find specific content in the project description: </span>
<input
type="text"
value={inputSearch}
Expand Down Expand Up @@ -103,6 +97,7 @@ const Header = (props) => {
})}
</div>
</NavDropdown>

</Form>
</Navbar>
</div>
Expand Down
2 changes: 2 additions & 0 deletions client/src/components/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import {ThemeContext} from '../Context/themeContext'

const useStyles = makeStyles({
navBar: {
margin: '0px',
paddingTop: '25px',
paddingBottom: '10px',
justifyContent: 'center',
'& a': {
color: 'black',
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/SingleCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const SingleCard = (props) => {
<Card.Text>Issue description:</Card.Text>
<Card.Text>{props.repo.title}</Card.Text>
<Card.Text> Language: {repo.language}</Card.Text>
<a href={`${props.repo.html_url}/labels/good%20first%20issue`}>
<a href={`${props.repo.html_url}/labels/good%20first%20issue`} target="__blank">
<Button
variant="outline-info"
onClick={() => setOpen(!openIssues)}
Expand Down
5 changes: 5 additions & 0 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11210,6 +11210,11 @@ url@^0.11.0:
punycode "1.3.2"
querystring "0.2.0"

use-debounce@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/use-debounce/-/use-debounce-6.0.1.tgz#ed1eb2b30189408fb9792ea2887f4c6c3cb401a3"
integrity sha512-kpvIxpa0vOLz/2I2sfNJ72mUeaT2CMNCu5BT1f2HkV9qZK27UVSOFf1sSSu+wjJE4TcR2VTXS2SM569+m3TN7Q==

use@^3.1.0:
version "3.1.1"
resolved "https://registry.npmjs.org/use/-/use-3.1.1.tgz"
Expand Down

0 comments on commit e0afbae

Please sign in to comment.