-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip: basic cms preview * feat: refactor styles Co-authored-by: Alexander Lee <[email protected]> * feat: enable previews on text-cards * fix: lint issues * feat: update previews to match template Co-authored-by: Alexander Lee <[email protected]> --------- Co-authored-by: Alexander Lee <[email protected]>
- Loading branch information
1 parent
19c1ae9
commit 1e7d218
Showing
6 changed files
with
197 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
@import "./announcements.scss"; | ||
@import "./hero.scss"; | ||
@import "./text-cards.scss"; |
62 changes: 62 additions & 0 deletions
62
src/styles/isomer-template/components/homepage/_text-cards.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
.textcards-section { | ||
flex-direction: column; | ||
align-items: center; | ||
text-align: center; | ||
|
||
@media screen and (min-width: 1408px) { | ||
max-width: 1440px; | ||
margin: auto; | ||
} | ||
} | ||
|
||
.textcards-card-section { | ||
justify-content: center; | ||
align-items: flex-start; | ||
gap: 2rem; | ||
width: 100%; | ||
flex-wrap: wrap; | ||
flex-direction: column; | ||
|
||
@media screen and (min-width: 770px) { | ||
flex-direction: row; | ||
} | ||
|
||
.textcards-card-body { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 1rem; | ||
flex: 1 0 0; | ||
align-self: stretch; | ||
color: #484848; | ||
|
||
border-radius: 4px; | ||
border: 1px solid $stroke-default; | ||
background: var(--white, #FFF); | ||
box-shadow: 0px 0px 10px 0px rgba(191, 191, 191, 0.50); | ||
|
||
@media screen and (min-width: 770px) { | ||
max-width: 50%; | ||
} | ||
|
||
@media screen and (min-width: 1280px) { | ||
max-width: 40%; | ||
} | ||
|
||
@media screen and (min-width: 770px) and (max-width: 1279px) { | ||
flex: 0 0 calc(50% - 24px); | ||
} | ||
|
||
&:hover { | ||
background-color: $interaction-hover; | ||
cursor: pointer; | ||
> .link { | ||
color: var(--site-secondary-color-hover); | ||
} | ||
} | ||
|
||
.textcards-card-description { | ||
flex-grow: 1; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@charset 'UTF-8'; | ||
|
||
$stroke-default-color: #D0D5DD; | ||
$interaction-hover-color: #F9F9F9; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import { ForwardedRef, forwardRef, RefObject } from "react" | ||
|
||
import editorStyles from "styles/isomer-cms/pages/Editor.module.scss" | ||
|
||
import { getClassNames } from "templates/utils/stylingUtils" | ||
|
||
import { TextcardsSection } from "types/homepage" | ||
|
||
interface TemplateTextCardsSectionProps extends TextcardsSection { | ||
sectionIndex: number | ||
} | ||
|
||
const TemplateTextCardsSection = forwardRef< | ||
HTMLDivElement, | ||
TemplateTextCardsSectionProps | ||
>( | ||
( | ||
{ | ||
title, | ||
subtitle, | ||
description, | ||
cards, | ||
sectionIndex, | ||
}: TemplateTextCardsSectionProps, | ||
ref: ForwardedRef<HTMLDivElement> | ||
) => { | ||
return ( | ||
<section | ||
className={getClassNames(editorStyles, [ | ||
"px-8", | ||
"px-sm-16", | ||
"px-md-24", | ||
"py-24", | ||
sectionIndex % 2 === 1 ? "bg-newssection" : "", | ||
])} | ||
ref={ref} | ||
> | ||
<div | ||
className={getClassNames(editorStyles, [ | ||
"textcards-section", | ||
"is-flex", | ||
])} | ||
> | ||
<p className={getClassNames(editorStyles, ["subtitle-2", "pb-4"])}> | ||
{subtitle} | ||
</p> | ||
<h1 className="h1 has-text-secondary has-text-centered pb-4"> | ||
{title} | ||
</h1> | ||
<p | ||
className={getClassNames(editorStyles, [ | ||
"body-1", | ||
"has-text-centered", | ||
"pb-12", | ||
])} | ||
> | ||
{description} | ||
</p> | ||
<div | ||
className={getClassNames(editorStyles, [ | ||
"textcards-card-section", | ||
"has-text-left", | ||
"is-flex", | ||
])} | ||
> | ||
{!!cards && | ||
cards.map((card) => ( | ||
<> | ||
<a | ||
className={getClassNames(editorStyles, [ | ||
"textcards-card-body", | ||
"is-flex", | ||
"p-6", | ||
])} | ||
href="{{ card.url }}" | ||
> | ||
<h3 className={editorStyles.h3}>{card.title}</h3> | ||
<p | ||
className={getClassNames(editorStyles, [ | ||
"body-1", | ||
"textcards-card-description", | ||
])} | ||
> | ||
{card.description} | ||
</p> | ||
<p className={editorStyles.link}>{card.linktext}</p> | ||
</a> | ||
</> | ||
))} | ||
</div> | ||
</div> | ||
</section> | ||
) | ||
} | ||
) | ||
|
||
export default TemplateTextCardsSection |