-
Notifications
You must be signed in to change notification settings - Fork 29
removed chakra-ui & revamped website #171
base: main
Are you sure you want to change the base?
Changes from all commits
137fffd
818f66b
6f30b30
67b4d3c
727b4a0
35983d7
9c7038b
acbc1ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.button { | ||
padding: 0.5rem; | ||
display: block; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import Link from "next/link"; | ||
|
||
import styles from "./styles.module.scss"; | ||
import React from "react"; | ||
|
||
interface Props { | ||
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. Can we use Type Aliases instead of Interfaces just for following a uniform standard practice across the project's source code? I used Type Aliases elsewhere mainly because I don't need them to be extended & composed for say a third-party user. Generally speaking for internal usages (as in not to be imported in to a third-party project), Type Aliases are the way to go. |
||
isLink: boolean; | ||
isExternal: boolean; | ||
href: string; | ||
onClick: Function; | ||
text: string; | ||
} | ||
|
||
const defaultProps: Props = { | ||
isLink: false, | ||
isExternal: false, | ||
href: "", | ||
onClick: () => {}, | ||
text: "Button Text", | ||
}; | ||
|
||
function Button(props: Props) { | ||
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 Here's an example: function Button({ props }: PropTypes) {
return <>Some JSX Element</>
} |
||
const { isLink, isExternal, href, onClick, text } = props; | ||
|
||
let button; | ||
|
||
let style = styles.button; | ||
console.log(style); | ||
|
||
if (isLink) { | ||
button = ( | ||
<Link className={style} href={href}> | ||
<a target={isExternal ? "_blank" : "_self"}>{text}</a> | ||
</Link> | ||
); | ||
} else { | ||
button = ( | ||
<button | ||
className={style} | ||
onClick={() => { | ||
onClick(); | ||
}} | ||
> | ||
{text} | ||
</button> | ||
); | ||
} | ||
|
||
return <>{button}</>; | ||
} | ||
|
||
Button.defaultProps = defaultProps; | ||
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. Moving forward with Functional Components, using function Button({
isLink = false,
isExternal = false,
href = "",
onClick: () => {},
text = "Button Text"
}: PropTypes) {
return <>Some JSX Elemet</>
} This is way MORE readable, has less code to write & follows the uniform standard across the rest of the source code. For more information on the same, refer to the official documentations. |
||
|
||
export default Button; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.cta { | ||
padding-top: 20px; | ||
h2 { | ||
padding: 0 2rem; | ||
} | ||
|
||
.divider { | ||
width: 100%; | ||
height: 10px; | ||
|
||
background: linear-gradient( | ||
90deg, | ||
#f27750 -0.03%, | ||
#ffffff 50.5%, | ||
#22f576 100% | ||
); | ||
|
||
margin-bottom: 10rem; | ||
} | ||
|
||
.divider2 { | ||
width: 100%; | ||
height: 10px; | ||
|
||
background: linear-gradient( | ||
90deg, | ||
#f27750 -0.03%, | ||
#ffffff 50.5%, | ||
#22f576 100% | ||
); | ||
|
||
margin-top: 10rem; | ||
} | ||
|
||
.text { | ||
text-align: center; | ||
margin-bottom: 2rem; | ||
padding: 0 2rem; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
.footer { | ||
padding: 10rem 2rem 0; | ||
|
||
.sitemap { | ||
display: flex; | ||
justify-content: space-between; | ||
padding-bottom: 6rem; | ||
margin-bottom: 6rem; | ||
border-bottom: 1px solid lightgray; | ||
|
||
@media screen and (max-width: 1024px) { | ||
display: block; | ||
} | ||
.nav { | ||
.devsindia { | ||
display: flex; | ||
align-items: center; | ||
font-weight: bold; | ||
margin-bottom: 2rem; | ||
.logo { | ||
border-radius: 50%; | ||
} | ||
} | ||
|
||
.links { | ||
.link { | ||
text-decoration: none; | ||
margin-right: 15px; | ||
color: gray; | ||
font-weight: 500; | ||
} | ||
} | ||
} | ||
|
||
.signup { | ||
@media screen and (max-width: 1024px) { | ||
margin-top: 2rem; | ||
} | ||
label { | ||
display: block; | ||
margin-bottom: 1rem; | ||
padding-left: 5px; | ||
color: gray; | ||
|
||
@media screen and (max-width: 1024px) { | ||
padding-left: 0; | ||
} | ||
} | ||
.input { | ||
padding: 1rem 2rem; | ||
border-radius: 10rem; | ||
font-family: inherit; | ||
border: 1px solid gray; | ||
} | ||
} | ||
} | ||
|
||
.copyright { | ||
display: flex; | ||
justify-content: space-between; | ||
padding-bottom: 6rem; | ||
color: gray; | ||
|
||
@media screen and (max-width: 1024px) { | ||
display: block; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,92 @@ | ||
import { Stack, Text } from "@chakra-ui/react"; | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
|
||
import styles from "./footer.module.scss"; | ||
import React, { useState } from "react"; | ||
|
||
function FooterSection() { | ||
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. This is the "newsletter" section of the footer area right? Can you add a TODO comment here for future reference? It's easier to lookup for TODO comments across all the files in the source code & fix the issues later on. My justification for doing so is because we need to setup some mailing list service before this function can hook in to it. Like add a comment on the lines of: TODO: Setup a Mailchimp account & see if it works. |
||
const [email, setEmail] = useState(""); | ||
|
||
function handleOnSubmit(e: React.SyntheticEvent) { | ||
e.preventDefault(); | ||
console.log(email); | ||
} | ||
|
||
function handleOnChange(e: React.FormEvent<HTMLInputElement>) { | ||
setEmail(e.currentTarget.value); | ||
} | ||
|
||
return ( | ||
<> | ||
<Stack | ||
marginTop={32} | ||
direction={{ base: "column", md: "row" }} | ||
justify="space-between" | ||
align="center" | ||
> | ||
<Text as="small" color="#98A2B3"> | ||
© 2022-{new Date().getFullYear()} DevelopersIndia | ||
</Text> | ||
<Text as="small" color="#98A2B3"> | ||
Made in India with{" "} | ||
<span> | ||
<a | ||
style={{ textDecoration: "underline" }} | ||
href="https://github.com/developersIndia" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
Open-Source | ||
</a> | ||
</span>{" "} | ||
❤️ | ||
</Text> | ||
</Stack> | ||
</> | ||
<footer className={styles.footer}> | ||
<div className="container-xl"> | ||
<div className={styles.sitemap}> | ||
<div className={styles.nav}> | ||
<div className={styles.devsindia}> | ||
<Image | ||
src="https://raw.githubusercontent.com/developersIndia/assets/main/logo.svg" | ||
alt="Developers India Logo" | ||
layout="fixed" | ||
width="30px" | ||
className={styles.logo} | ||
height="30px" | ||
/> | ||
Developers India | ||
</div> | ||
|
||
<div className={styles.links}> | ||
<Link href=""> | ||
<a className={styles.link}>Reddit</a> | ||
</Link> | ||
<Link href=""> | ||
<a className={styles.link}>Discord</a> | ||
</Link> | ||
<Link href=""> | ||
<a className={styles.link}>Github</a> | ||
</Link> | ||
<Link href=""> | ||
<a className={styles.link}>Careers</a> | ||
</Link> | ||
<Link href=""> | ||
<a className={styles.link}>About Us</a> | ||
</Link> | ||
</div> | ||
</div> | ||
<div className={styles.signup}> | ||
<form onSubmit={handleOnSubmit}> | ||
<label>Stay up to date</label> | ||
<input | ||
placeholder="Your Email Address" | ||
type="text" | ||
className={styles.input} | ||
onChange={handleOnChange} | ||
></input> | ||
|
||
<button type="submit" className="button-dark"> | ||
Submit | ||
</button> | ||
</form> | ||
</div> | ||
</div> | ||
|
||
<div className={styles.copyright}> | ||
<p>© 2022-{new Date().getFullYear()} Developers India</p> | ||
<p> | ||
Made in India with{" "} | ||
<span> | ||
<a | ||
style={{ textDecoration: "underline", color: "#2A3268" }} | ||
href="https://github.com/developersIndia" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
Open-Source | ||
</a> | ||
</span>{" "} | ||
❤️ | ||
</p> | ||
</div> | ||
</div> | ||
</footer> | ||
); | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.