-
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.
- Loading branch information
Showing
15 changed files
with
255 additions
and
22 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,2 +1,2 @@ | ||
backend/.env | ||
*/.env | ||
*/target/ |
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 |
---|---|---|
|
@@ -27,4 +27,10 @@ html, body { | |
small { | ||
@apply text-sm; | ||
} | ||
} | ||
|
||
@layer components { | ||
.tab-active { | ||
@apply text-sky-blue; | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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,7 @@ | ||
export default function Card({ project }) { | ||
return ( | ||
<div className="w-full h-fit p-4"> | ||
<a href={project.repo_origin}>{project.name}</a> | ||
</div> | ||
); | ||
} |
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,25 @@ | ||
import { useContext, useEffect, useState } from "react"; | ||
|
||
import SearchbarContext from "@/context/searchbar"; | ||
import fetchApi from "@/utils/fetchApi"; | ||
import Card from "./card"; | ||
|
||
export default function Cards({ children }) { | ||
const [data, setData] = useState([]); | ||
const { searchTerm } = useContext(SearchbarContext); | ||
|
||
useEffect(() => { | ||
fetchApi("104.248.58.127/api/repos").then((data) => { | ||
console.log(data); | ||
setData(data); | ||
}); | ||
}, [searchTerm]); | ||
|
||
return ( | ||
<> | ||
{data.map((project) => ( | ||
<Card key={project.id} project={project} /> | ||
))} | ||
</> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,22 +1,40 @@ | ||
import { useContext } from "react"; | ||
import { useContext, useRef } from "react"; | ||
import { AiOutlineSearch } from "react-icons/ai"; | ||
|
||
import SearchbarContext from "@/context/searchbar"; | ||
|
||
export default function Searchbar() { | ||
const inputRef = useRef(); | ||
|
||
const { searchTerm, setSearchTerm } = useContext(SearchbarContext); | ||
|
||
function handleSearchbarChange(e) { | ||
setSearchTerm(e.target.value); | ||
function handleSearchbarSubmit(e) { | ||
e.preventDefault(); | ||
setSearchTerm(inputRef.current.value); | ||
} | ||
|
||
return ( | ||
<> | ||
<label htmlFor="searchbar" /> | ||
<input | ||
id="searchbar" | ||
placeholder="search by project name, language, or technologies" | ||
className="my-12 w-full py-4 px-2 border-2 border-sky-blue rounded-lg bg-deep-blue font-quicksand text-mage-silver outline-none" | ||
onChange={handleSearchbarChange} | ||
/> | ||
</> | ||
<div className="join mt-12 mb-4 w-full h-full"> | ||
<span className="join-item w-full"> | ||
<label htmlFor="searchbar" /> | ||
<input | ||
id="searchbar" | ||
placeholder={ | ||
searchTerm | ||
? searchTerm | ||
: "search by project name, language, or technologies" | ||
} | ||
className="w-full py-4 px-2 border-2 border-r-0 rounded-e-none border-sky-blue rounded-lg bg-deep-blue flex items-center font-quicksand text-mage-silver outline-none" | ||
type="text" | ||
ref={inputRef} | ||
/> | ||
</span> | ||
<button | ||
onClick={handleSearchbarSubmit} | ||
className="join-item bg-night-blue border-2 border-l-0 px-4 border-sky-blue text-mage-silver" | ||
> | ||
<AiOutlineSearch /> | ||
</button> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.