Skip to content

Commit 77e2c62

Browse files
committed
v4
1 parent 45f3863 commit 77e2c62

8 files changed

Lines changed: 36 additions & 90 deletions

File tree

src/components/Home/DashFeatures.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const DashFeatures = () => {
88
return (
99
<StyledDashFeature>
1010
<Container>
11-
<h2>And there is more! the 3-<b>POWERS</b>..</h2>
11+
<h2>And there is more!</h2>
1212
<Flex justifyCenter gap='2rem'>
1313
<Flex alignCenter spaceBetween flexColumn gap='4rem'>
1414
<h4>Profile</h4>
@@ -38,18 +38,8 @@ const StyledDashFeature = styled.section`
3838
width: 100%;
3939
background: ${({ theme }) => theme.text};
4040
text-align: center;
41-
padding-block: 10rem 6rem;
41+
padding-block: 5rem;
4242
z-index: 1;
43-
&::before {
44-
content: '';
45-
position: absolute;
46-
top: -2px;
47-
left: 0;
48-
width: 100%;
49-
height: 1.5rem;
50-
border-radius: 0 0 10rem 10rem;
51-
background: ${({ theme }) => theme.background};
52-
}
5343
&::after {
5444
content: '';
5545
position: absolute;
@@ -69,7 +59,7 @@ const StyledDashFeature = styled.section`
6959
margin-inline: auto;
7060
color: ${({ theme }) => theme.background};
7161
& + div {
72-
padding: 4rem 10vw;
62+
padding: 4rem 10vw 0;
7363
& > * {
7464
flex: 1;
7565
height: auto;

src/components/Home/DashLook.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const DashLook = () => {
1010
<Container>
1111
<img src={DashIMG} alt="nvnn mbjb" />
1212
<div>
13-
<h2>It’s all about making things happen.</h2>
1413
<Flex alignCenter spaceBetween gap="2rem">
1514
<Flex alignCenter justifyCenter flexColumn gap='1rem'>
1615
<IoLogoReact />
@@ -40,15 +39,15 @@ export default DashLook;
4039
const StyleDashLook = styled.section`
4140
width: 100%;
4241
text-align: center;
43-
padding-block: 6rem;
42+
padding-block: 2rem;
4443
& > div > img {
4544
display: block;
4645
width: min(1080px, 100%);
4746
height: auto;
4847
margin-inline: auto;
4948
}
5049
& > div > div {
51-
padding-block: 15rem 0;
50+
padding-block: 2rem 0;
5251
& > div {
5352
padding-block: 4rem;
5453
& > * {

src/components/Home/Footer.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,8 @@ const Footer = () => {
4545
export default Footer;
4646

4747
const StyledFooter = styled.footer`
48-
position: relative;
49-
padding-block: 12.5rem 4rem;
48+
padding-block: 5rem;
5049
text-align: center;
51-
&::before {
52-
content: "";
53-
position: absolute;
54-
top: -2px;
55-
left: 0;
56-
width: 100%;
57-
height: 1.5rem;
58-
border-radius: 0 0 10rem 10rem;
59-
background: ${({ theme }) => theme.text};
60-
}
6150
& form {
6251
position: relative;
6352
width: min(500px, 90%);

src/components/Home/Hero.js

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,30 @@
1-
import { useState, useContext, useRef } from "react";
1+
import { useContext } from "react";
22
import UserContext from "../../Hooks/userContext";
33
import { useNavigate } from "react-router-dom";
44
import styled from "styled-components";
5-
import { IconCircle, IconClose, IconSearch } from "../../assets/SVG";
5+
import { IconCircle, IconSearch } from "../../assets/SVG";
66
import { Flex } from "../Styles/Flexbox";
77

88
const Hero = () => {
9-
const { setUsername } = useContext(UserContext);
9+
const { username, setUsername } = useContext(UserContext);
1010

11-
const [isActive, setIsActive] = useState(false);
1211
const handleChange = (e) => setUsername(e.target.value);
1312
const navigate = useNavigate();
14-
const ref = useRef(null);
1513

16-
const handleClick = () => {
17-
ref.current.focus();
18-
setIsActive(!isActive);
19-
};
14+
const handleSubmit = event => {
15+
event.preventDefault();
16+
if (username) {
17+
return navigate("/dashboard");
18+
}
19+
}
2020

2121
return (
2222
<StyledHero>
2323
<Flex alignCenter justifyEnd flexColumn>
2424
<h1>Find Your Github Profile</h1>
2525
<form
26-
className={isActive ? "active" : ""}
27-
onSubmit={(e) => {
28-
e.preventDefault();
29-
navigate("/dashboard");
30-
}}
31-
>
26+
onSubmit={handleSubmit}>
3227
<input
33-
ref={ref}
3428
name="username"
3529
placeholder=":search username"
3630
type="text"
@@ -39,9 +33,7 @@ const Hero = () => {
3933
</form>
4034
</Flex>
4135
<StyledCircleButton>
42-
<button className={isActive ? "active" : null} onClick={handleClick}>
43-
{!isActive ? <IconSearch /> : <IconClose />}
44-
</button>
36+
<button onClick={handleSubmit}><IconSearch /></button>
4537
<IconCircle />
4638
<h2>A simple yet creative way to interact with your GitHub profile.</h2>
4739
<p>Scroll Down</p>
@@ -57,22 +49,14 @@ export default Hero;
5749
const StyledHero = styled.section`
5850
position: relative;
5951
text-align: center;
60-
height: 100%;
61-
min-height: 100vh;
52+
padding-top: 30vh;
6253
& > *:first-child {
63-
position: relative;
6454
margin-inline: auto;
6555
width: min(600px, 100%);
66-
padding-block: 22rem 2rem;
56+
padding-bottom: 2rem;
6757
& form {
6858
width: 100%;
69-
margin-block-end: -6rem;
70-
opacity: 0;
7159
transition: ${({ theme }) => theme.transPrime};
72-
&.active {
73-
margin-block-end: -1rem;
74-
opacity: 1;
75-
}
7660
& input {
7761
display: block;
7862
border: 0;

src/components/Home/Layout.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,15 @@
1-
import styled, { ThemeProvider } from "styled-components";
2-
import SmoothScrollbar from "../Global/smoothScroll";
1+
import { ThemeProvider } from "styled-components";
32
import { GlobalStyle, darkTheme } from "../Styles/GlobalStyle";
43
import Header from "./Header";
54

65
const Layout = ({ children }) => {
76
return (
87
<ThemeProvider theme={darkTheme}>
9-
<StyledHome className="Home">
10-
<SmoothScrollbar />
118
<GlobalStyle />
129
<Header />
1310
<main>{children}</main>
14-
</StyledHome>
1511
</ThemeProvider>
1612
);
1713
};
1814

1915
export default Layout;
20-
21-
const StyledHome = styled.div`
22-
width: 100vw;
23-
height: 100vh;
24-
& .scrollbar-track {
25-
background: transparent;
26-
& .scrollbar-thumb {
27-
background: ${({ theme }) => theme.pink};
28-
width: 2px;
29-
left: unset;
30-
right: 2px;
31-
}
32-
}
33-
`

src/components/Profile/Header.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useContext, useState } from "react";
22
import UserContext from "../../Hooks/userContext";
33
import styled from "styled-components";
44
import { Flex } from "../Styles/Flexbox";
5-
import { IconSun, IconMoon } from "../../assets/SVG";
5+
import { BiMoon, BiSun } from "react-icons/bi";
66
import RateLimit from "./RateLimit";
77
import UserInfo from "./UserInfo";
88

@@ -41,7 +41,7 @@ const Header = ({ theme, themeToggler, userData, rateLimit }) => {
4141
</form>
4242

4343
<button onClick={themeToggler}>
44-
{theme === "light" ? <IconMoon /> : <IconSun />}
44+
{theme === "light" ? <BiMoon /> : <BiSun />}
4545
</button>
4646
</Flex>
4747

@@ -102,14 +102,15 @@ const StyledHeader = styled.header`
102102
}
103103
}
104104
& button {
105-
width: 44px;
106-
height: 44px;
107-
background: ${({ theme }) => theme.text};
105+
background: transparent;
108106
border: 0;
109-
border-radius: 100%;
110107
cursor: pointer;
111-
& path {
112-
fill: ${({ theme }) => theme.background};
108+
& svg {
109+
width: 30px;
110+
height: 30px;
111+
& path {
112+
fill: ${({ theme }) => theme.text};
113+
}
113114
}
114115
}
115116
}

src/components/Profile/UserInfo.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const StyledUserInfo = styled.div`
8383
justify-content: center;
8484
gap: 1rem;
8585
width: min(750px, 90%);
86-
background-color: #f8f7ff;
86+
background-color: ${({ theme }) => theme.background};
8787
border-radius: 10px;
8888
padding: 4rem 2rem;
8989
text-align: center;
@@ -98,6 +98,7 @@ const StyledUserInfo = styled.div`
9898
& svg {
9999
width: 18px;
100100
height: auto;
101+
color: ${({ theme }) => theme.text};
101102
}
102103
}
103104
& .avatar {
@@ -138,14 +139,14 @@ const StyledStats = styled.ul`
138139
list-style: none;
139140
margin-block-start: 1rem;
140141
& > li {
141-
background: #fff;
142+
background: ${({ theme }) => theme.light};
142143
padding: 1rem 2rem;
143144
border-radius: 6px;
144145
& span {
145146
display: block;
146-
color: #777;
147+
color: ${({ theme }) => theme.textLighter};
147148
&:first-child {
148-
color: #121316;
149+
color: ${({ theme }) => theme.text};
149150
font-weight: 500;
150151
}
151152
}

src/components/Styles/GlobalStyle.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Mutant from "./Fonts/Mutant.otf";
44
export const lightTheme = {
55
purple: 'linear-gradient(120deg,#D270FF,#8338EC)',
66
pink: '#FF006E',
7-
background: 'radial-gradient(circle farthest-corner at 50% 50%,#f9fafe,#f9fafe 53%,#eff2f9)',
7+
background: '#f8f9fe',
88
text: '#121316',
99
textLight: 'hsl(0, 0%, 13%)',
1010
textLighter: 'hsl(0, 0%, 30%)',
@@ -62,7 +62,7 @@ a {
6262
cursor: pointer;
6363
}
6464
h1 {
65-
font-size: 3.052rem;
65+
font-size: 3.52rem;
6666
font-family: 'Mutant';
6767
}
6868
h2 {font-size: 2.074rem;}

0 commit comments

Comments
 (0)