section title component

This commit is contained in:
VividTruthKeeper 2023-01-29 20:45:20 +05:00
parent e053a54977
commit be4f90d4f2
2 changed files with 20 additions and 2 deletions

View File

@ -3,7 +3,7 @@ import { Link } from "react-router-dom";
// Types
interface Props {
givenClass: string;
givenClass?: string;
title: string;
linkData?: {
title: string;
@ -13,7 +13,7 @@ interface Props {
const SectionTitle: React.FC<Props> = ({ givenClass, title, linkData }) => {
return (
<div className={`${givenClass}-title`}>
<div className={`${givenClass ? givenClass + "-title" : ""} section-title`}>
<h2>{title}</h2>
{linkData ? <Link to={linkData.link}>{linkData.title}</Link> : null}
</div>

View File

@ -0,0 +1,18 @@
.section-title {
display: flex;
align-items: center;
justify-content: space-between;
gap: 4rem;
h2 {
font-size: 2.4rem;
}
a {
display: block;
padding: 1rem;
background: $main;
color: $white;
font-size: 1.6rem;
}
}