-
-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from oslabs-beta/emailAlerts
Added new email component
- Loading branch information
Showing
6 changed files
with
65 additions
and
1 deletion.
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
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,45 @@ | ||
/** | ||
* create an input box | ||
* create a password andusername checker -- | ||
* if correct send them the shit | ||
*/ | ||
|
||
import { type NextPage } from "next"; | ||
import { useState } from "react"; | ||
import Head from "next/head"; | ||
import Link from "next/link"; | ||
import LandingPage from "./components/LandingPage"; | ||
import NavBar from "./components/NavBar"; | ||
import Blogs from "./components/Blogs"; | ||
import { trpc } from "../utils/trpc"; | ||
|
||
const secret: NextPage = () => { | ||
const [isAdmin, setIsAdmin] = useState<boolean>(false); | ||
const [password, setPassword] = useState<string>(""); | ||
|
||
const clickHandler = () => { | ||
if (process.env.NEXT_PUBLIC_ADMIN_PASSWORD === password) { | ||
setIsAdmin(true); | ||
} | ||
}; | ||
|
||
return ( | ||
<> | ||
{!isAdmin && <div className = 'flex h-screen items-center justify-center'> | ||
<input | ||
type="password" | ||
value={password} | ||
onChange={(e)=>setPassword(e.target.value)} | ||
required | ||
placeholder="password" | ||
className="block w-50 rounded-md border border-gray-300 px-5 py-3 text-base text-gray-900 placeholder-gray-500 shadow-sm focus:border-rose-500 focus:ring-rose-500 mr-8"> | ||
</input> | ||
<button onClick={clickHandler} className="blockrounded-md border rounded border-transparent bg-rose-500 px-5 py-3 text-base font-medium text-white shadow hover:bg-rose-600 focus:outline-none focus:ring-2 focus:ring-rose-500 focus:ring-offset-2 sm:px-10">Submit</button> | ||
</div>} | ||
{isAdmin && <div>You logged in!</div>} | ||
|
||
</> | ||
); | ||
}; | ||
|
||
export default secret; |