Skip to content

Commit

Permalink
feat: enhance HeaderPost component,
Browse files Browse the repository at this point in the history
enhance the HeaderPost component by adjusting the classname used in the CSS,
see also: #12
  • Loading branch information
64J0 committed Oct 23, 2021
1 parent c32a067 commit fb5ea39
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
13 changes: 6 additions & 7 deletions components/HeaderPost/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,26 @@ import React from "react";
import Link from "next/link";
import { FiHome, FiChevronLeft } from "react-icons/fi";

import styles from "../Layout/styles.module.scss";
import utilStyles from "../../styles/utils.module.css";

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

const HeaderPost: React.FC = () => {
return (
<div className={headerStyles.container}>
<div className={headerStyles['header-post']}>
<Link href="/contato">
<a>
<img
src="/images/profile.jpg"
className={`${styles.headerImage} ${utilStyles.borderCircle} ${headerStyles.contactLink}`}
className={headerStyles['header-post__image']}
alt={"Uma foto minha"}
/>
</a>
</Link>
<h2 className={headerStyles.backToHome}>
<h2 className={headerStyles['header-post__back-home']}>
<Link href="/">
<a>
<FiChevronLeft size="4rem" className={headerStyles.moveToLeft} />
<FiChevronLeft size="4rem"
className={headerStyles['header-post__move-left']}
/>
<FiHome size="4rem" />
</a>
</Link>
Expand Down
29 changes: 16 additions & 13 deletions components/HeaderPost/styles.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.container {
$prefix: header-post;

.#{$prefix} {
display: flex;
flex-direction: row-reverse;
align-items: baseline;
Expand All @@ -21,29 +23,30 @@
}
}

.contactLink {
transition: transform 4s;
}
.#{$prefix}__image {
width: 7rem;
height: 7rem;
margin: 0 auto;

.contactLink:hover {
border-radius: 9999px;
transition: transform 4s;
transform: rotateZ(360deg);

&:hover {
transition: transform 4s;
transform: rotateZ(360deg);
}
}

.backToHome {
.#{$prefix}__back-home {
margin: 0;
height: 100%;

a {
color: inherit;
}

.moveToLeft {
.#{$prefix}__move-left {
transition: transform 1s;
}

&:hover {
.moveToLeft {
.#{$prefix}__move-left {
transform: translate(-1.2rem, 0);
}
}
Expand Down

0 comments on commit fb5ea39

Please sign in to comment.