Skip to content

Commit

Permalink
feat: created SignInButton and styled it
Browse files Browse the repository at this point in the history
  • Loading branch information
mstarkRules committed Dec 6, 2021
1 parent 15ab904 commit 840e305
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"next": "11.1.2",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-icons": "^4.3.1",
"sass": "^1.44.0"
},
"devDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions src/components/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SignInButton } from "../SignInButton";
import styles from "./styles.module.scss";

export function Header() {
Expand All @@ -9,6 +10,7 @@ export function Header() {
<a className={styles.active}>Home</a>
<a>Posts</a>
</nav>
<SignInButton />
</div>
</header>
);
Expand Down
4 changes: 4 additions & 0 deletions src/components/Header/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@
}
}
}

button {
margin-left: auto;
}
}
20 changes: 20 additions & 0 deletions src/components/SignInButton/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { FaGithub } from "react-icons/fa";
import { FiX } from "react-icons/fi";

import styles from "./styles.module.scss";

export function SignInButton() {
const isUserLoggedIn = true;
return isUserLoggedIn ? (
<button type="button" className={styles.signInButton}>
<FaGithub color="#04d361" />
Marcos Paulo
<FiX color="#737388" className={styles.closeIcon} />
</button>
) : (
<button type="button" className={styles.signInButton}>
<FaGithub color="#eba417" />
Sign In with Github
</button>
);
}
33 changes: 33 additions & 0 deletions src/components/SignInButton/styles.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.signInButton {
height: 3rem;
border-radius: 3rem;
background: var(--gray-850);
border: 0;
padding: 0 1.5rem;

display: flex;
align-items: center;
justify-content: center;

color: var(--white);
font-weight: bold;

svg {
width: 20px;
height: 20px;
}

svg:first-child {
margin-right: 1rem;
}

svg.closeIcon {
margin-left: 1rem;
}

transition: filter 0.2s;

&:hover {
filter: brightness(0.8);
}
}
1 change: 1 addition & 0 deletions src/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
--gray-100: #e1e1e6;
--gray-300: #a8a8b3;
--gray-800: #29292e;
--gray-850: #1f2729;
--gray-900: #121214;

--cyan-500: #61bafb;
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2543,6 +2543,11 @@ [email protected]:
object-assign "^4.1.1"
scheduler "^0.20.2"

react-icons@^4.3.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.3.1.tgz#2fa92aebbbc71f43d2db2ed1aed07361124e91ca"
integrity sha512-cB10MXLTs3gVuXimblAdI71jrJx8njrJZmNMEMC+sQu5B/BIOmlsAjskdqpn81y8UBVEGuHODd7/ci5DvoSzTQ==

[email protected]:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
Expand Down

0 comments on commit 840e305

Please sign in to comment.