Move separator into its own component
This commit is contained in:
parent
5b4e167c40
commit
e0f710a5e0
5 changed files with 27 additions and 20 deletions
|
@ -1,17 +1,14 @@
|
|||
export interface Props {
|
||||
heading: string;
|
||||
subheading?: string;
|
||||
comp: any;
|
||||
}
|
||||
|
||||
export default function(props: Props) {
|
||||
return (
|
||||
<header className="page-header">
|
||||
<h1>{ props.heading }</h1>
|
||||
<div className="separator">
|
||||
<span className="outer-outline"/>
|
||||
<span className="icon"></span>
|
||||
<span className="outer-outline"/>
|
||||
</div>
|
||||
{props.comp.separator()}
|
||||
<p className="subheading">{ props.subheading }</p>
|
||||
</header>
|
||||
)
|
||||
|
|
9
_components/separator.tsx
Normal file
9
_components/separator.tsx
Normal file
|
@ -0,0 +1,9 @@
|
|||
export default function () {
|
||||
return (
|
||||
<div className="separator">
|
||||
<span className="outer-outline"/>
|
||||
<span className="icon"></span>
|
||||
<span className="outer-outline"/>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -89,21 +89,6 @@ .page-header {
|
|||
.subheading {
|
||||
font-style: italic;
|
||||
}
|
||||
.separator {
|
||||
margin: 1rem 0;
|
||||
span {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.outer-outline {
|
||||
width: 40%;
|
||||
border: 1px solid var(--color-black);
|
||||
}
|
||||
.icon {
|
||||
font-size: 2rem;
|
||||
color: var(--color-black);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@for $i from 1 to 3 {
|
||||
|
|
15
_includes/styles/components/separator.scss
Normal file
15
_includes/styles/components/separator.scss
Normal file
|
@ -0,0 +1,15 @@
|
|||
.separator {
|
||||
margin: 1rem 0;
|
||||
span {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.outer-outline {
|
||||
width: 40%;
|
||||
border: 1px solid var(--color-black);
|
||||
}
|
||||
.icon {
|
||||
font-size: 2rem;
|
||||
color: var(--color-black);
|
||||
}
|
||||
}
|
|
@ -9,3 +9,4 @@
|
|||
|
||||
// Components
|
||||
@import "styles/components/navbar";
|
||||
@import "styles/components/separator";
|
||||
|
|
Loading…
Reference in a new issue