Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Empty file added src/Context/AppProvider.jsx
Empty file.
6 changes: 5 additions & 1 deletion src/components/CardSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import SingleCard from "./SingleCard";
import { makeStyles } from "@material-ui/core/styles";
import axios from "axios";
import { isEmpty } from "lodash";

// import { dotenv } from "dotenv";
// dotenv.config();
//Context
import { useAppStates } from "../Context/AppProvider";
import { ThemeContext } from "../Context/themeContext";
import Loading from "./Loading/index";

Expand All @@ -16,6 +18,8 @@ const useStyles = makeStyles((theme) => ({
}));

const CardSet = ({
}) => {
const {
language,
inputSearch,
pageNumber,
Expand All @@ -24,7 +28,7 @@ const CardSet = ({
sortByForks,
setMaxPageNumber,
setHidePagination,
}) => {
} = useAppStates()
const [repositores, setRepositories] = useState([]);
const classes = useStyles();
const [isLoading, setIsLoading] = useState(false);
Expand Down
8 changes: 7 additions & 1 deletion src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ import { useDebouncedCallback } from "use-debounce";
import { ThemeContext } from "../Context/themeContext";
import Darkmode from "./Buttons/Darkmode";
import CustomSelect from "./Buttons/Language";
import { useAppStates } from "../Context/AppProvider";

const Header = ({ language, setLanguage, setInputSearch }) => {
const Header = () => {
const {
language,
setLanguage,
setInputSearch
} = useAppStates()
const { theme, changeTheme } = useContext(ThemeContext);
const [input, setInput] = useState(""); // Mirrors inputSearch and setInputSearch

Expand Down
9 changes: 7 additions & 2 deletions src/components/Navigation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useContext, useState } from "react";
import { Container, Pagination } from "react-bootstrap";
import { useAppStates } from "../Context/AppProvider";

import Filter from "./Buttons/Filter";
import Sort from "./Buttons/Sort";
Expand All @@ -9,7 +10,11 @@ import "./Navigation.css";
import Darkmode from "./Buttons/Darkmode";

const Navigation = ({
setPageNumber,

}) => {

const {
setPageNumber,
pageNumber,
maxPageNumber,
setSortByForks,
Expand All @@ -19,7 +24,7 @@ const Navigation = ({
hidePagination,
hasFilters,
removePagination,
}) => {
}= useAppStates()
const { theme, changeTheme } = useContext(ThemeContext);
let paginationItems = [];
const [selectedPage, setSelectedPage] = useState();
Expand Down