-
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
10 changed files
with
120 additions
and
11 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
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,11 +1,19 @@ | ||
import Image from "next/image"; | ||
"use client"; | ||
import React from "react"; | ||
|
||
import Searchbar from "@/components/searchbar"; | ||
|
||
export default function Home() { | ||
return ( | ||
<main className=""> | ||
<h1 className="text-5xl font-playfair-display"> | ||
<h2 className=""> | ||
celebrating open source projects. discover projects that interest you! | ||
</h1> | ||
</h2> | ||
<h3> | ||
making open source projects more discoverable. we set the standard for | ||
collaboration, so you can focus on the projects you love | ||
</h3> | ||
<Searchbar /> | ||
</main> | ||
); | ||
} |
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,3 @@ | ||
export default function Cards({ children }) { | ||
return <div className="flex flex-wrap justify-center">{children}</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,11 @@ | ||
import Link from "next/link"; | ||
|
||
export default function Nav() { | ||
return ( | ||
<nav className="flex my-12"> | ||
<Link href="/"> | ||
<h3>frieren.</h3> | ||
</Link> | ||
</nav> | ||
); | ||
} |
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,22 @@ | ||
import { useContext } from "react"; | ||
import SearchbarContext from "@/context/searchbar"; | ||
|
||
export default function Searchbar() { | ||
const { searchTerm, setSearchTerm } = useContext(SearchbarContext); | ||
|
||
function handleSearchbarChange(e) { | ||
setSearchTerm(e.target.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} | ||
/> | ||
</> | ||
); | ||
} |
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,14 @@ | ||
"use client"; | ||
|
||
import { SearchbarProvider } from "@/context/searchbar"; | ||
|
||
const providers = [SearchbarProvider]; | ||
|
||
/** | ||
* This component is used to wrap the entire application with all the context providers. | ||
*/ | ||
export default function ContextProvider({ children }) { | ||
return providers.reduce((acc, Provider) => { | ||
return <Provider>{acc}</Provider>; | ||
}, children); | ||
} |
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,15 @@ | ||
import React, { createContext, useState } from "react"; | ||
|
||
const SearchbarContext = createContext(); | ||
|
||
export function SearchbarProvider({ children }) { | ||
const [searchTerm, setSearchTerm] = useState(""); | ||
|
||
return ( | ||
<SearchbarContext.Provider value={{ searchTerm, setSearchTerm }}> | ||
{children} | ||
</SearchbarContext.Provider> | ||
); | ||
} | ||
|
||
export default SearchbarContext; |
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