-
Notifications
You must be signed in to change notification settings - Fork 0
feat: implement Main page #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
ebbd624
5782c5f
3489162
d2092c6
740573c
662c144
747b904
6aaed78
a191bb1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,3 +40,4 @@ coverage/ | |
| # Temporary files | ||
| *.tmp | ||
| *.temp | ||
| docs/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "$schema": "https://ui.shadcn.com/schema.json", | ||
| "style": "new-york", | ||
| "rsc": true, | ||
| "tsx": true, | ||
| "tailwind": { | ||
| "config": "", | ||
| "css": "src/app/globals.css", | ||
| "baseColor": "gray", | ||
| "cssVariables": true, | ||
| "prefix": "" | ||
| }, | ||
| "aliases": { | ||
| "components": "@/components", | ||
| "utils": "@/lib/utils", | ||
| "ui": "@/components/ui", | ||
| "lib": "@/lib", | ||
| "hooks": "@/hooks" | ||
| }, | ||
| "iconLibrary": "lucide" | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| .container { | ||
| display: flex; | ||
| height: 100vh; | ||
| font-family: -apple-system, blinkmacsystemfont, "Segoe UI", "Noto Sans", | ||
| Helvetica, Arial, sans-serif; | ||
| } | ||
|
|
||
| .left { | ||
| background-color: rgb(255, 218, 31); | ||
| flex: 1; | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: center; | ||
| justify-content: center; | ||
| padding: 2rem; | ||
| } | ||
|
|
||
| .left img { | ||
| max-width: 200px; | ||
| height: auto; | ||
| margin-bottom: 2rem; | ||
| } | ||
|
|
||
| .left p { | ||
| font-size: 1.2rem; | ||
| text-align: center; | ||
| color: #000; | ||
| } | ||
|
|
||
| .right { | ||
| flex: 1; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| } | ||
|
|
||
| .loginBox { | ||
| text-align: center; | ||
| } | ||
|
|
||
| .loginBox h1 { | ||
| margin-bottom: 2rem; | ||
| font-size: 2rem; | ||
| } | ||
|
|
||
| .githubButton { | ||
| padding: 1rem 2rem; | ||
| background-color: #24292e; | ||
| color: #fff; | ||
| border: none; | ||
| font-size: 1rem; | ||
| cursor: pointer; | ||
| border-radius: 5px; | ||
| transition: background-color 0.3s ease; | ||
| } | ||
|
|
||
| .githubButton:hover { | ||
| background-color: #000; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| "use client"; | ||
|
|
||
| import styles from "./LoginPage.module.css"; | ||
| import Image from "next/image"; | ||
|
|
||
| const GITHUB_CLIENT_ID = "YOUR_GITHUB_CLIENT_ID"; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be in the env |
||
|
|
||
| const LoginPage = () => { | ||
| const redirectToGitHub = () => { | ||
| const githubAuthUrl = "https://github.com/login/oauth/authorize"; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be in .env |
||
| const redirectUri = encodeURIComponent( | ||
| "http://localhost:3000/auth/github/callback" | ||
| ); | ||
| const scope = "read:user user:email"; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The scope should be configurable |
||
| window.location.href = `${githubAuthUrl}?client_id=${GITHUB_CLIENT_ID}&redirect_uri=${redirectUri}&scope=${scope}`; | ||
| }; | ||
|
|
||
| return ( | ||
| <div className={styles.container}> | ||
| <div className={styles.left}> | ||
| <Image | ||
| src="/logo-rsschool3.png" | ||
| alt="RS School Logo" | ||
| width={500} | ||
| height={500} | ||
| layout="responsive" | ||
| quality={75} | ||
| /> | ||
| <p> | ||
| Welcome to RS School! Learn, code, and grow with our open education | ||
| platform. | ||
| </p> | ||
| </div> | ||
| <div className={styles.right}> | ||
| <div className={styles.loginBox}> | ||
| <h1>Log In</h1> | ||
| <button className={styles.githubButton} onClick={redirectToGitHub}> | ||
| Sign up with GitHub | ||
| </button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default LoginPage; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import React from "react"; | ||
|
|
||
| class ContentLayout extends React.Component<any, any>{ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be functional component |
||
| render() { | ||
| return ( | ||
| <div> | ||
| <p>Title</p> | ||
| <ul> | ||
| <li>First element</li> | ||
| <li>Second element</li> | ||
| <li>Third element</li> | ||
| <li>Fourth element</li> | ||
| <li>Fifth element</li> | ||
| </ul> | ||
| </div> | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| export { ContentLayout }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { ContentLayout } from "./ContentLayout"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing emptyline