Skip to content

Commit

Permalink
feat: add link to blog post (#1994)
Browse files Browse the repository at this point in the history
https://www.notion.so/Homepage-add-link-to-blog-post-723ba95d32c14ee0bcf91ddc1f7459b5

I looked into this a little yesterday. It looks like it's going to
involve changing blockbuilder two understand multiple ctas. It's doable
just more involved than I was looking for. I'm going to come back to it
tomorrow.


![image](https://user-images.githubusercontent.com/22156330/194428340-6a18fc8b-9dca-419c-8ca8-c6c522e2a20e.png)
  • Loading branch information
drewdelano committed Oct 10, 2022
1 parent fa61edf commit 2204ad5
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/website/components/textblock/textblock.js
Expand Up @@ -16,6 +16,7 @@ export default function TextBlock({ block }) {
const format = block.format || 'medium';
const hasDescription = typeof block.description === 'string' || Array.isArray(block.description);
const tracking = {};
const tracking2 = {};
if (typeof block.cta === 'object') {
if (block.cta.event) {
tracking.event = countly.events[block.cta.event];
Expand All @@ -27,6 +28,17 @@ export default function TextBlock({ block }) {
tracking.action = block.cta.action;
}
}
if (typeof block.cta22 === 'object') {
if (block.cta2.event) {
tracking2.event = countly.events[block.cta2.event];
}
if (block.cta2.ui) {
tracking2.ui = countly.ui[block.cta2.ui];
}
if (block.cta2.action) {
tracking2.action = block.cta2.action;
}
}

// ================================================================= Functions
const formatDescription = text => {
Expand Down Expand Up @@ -90,6 +102,17 @@ export default function TextBlock({ block }) {
{block.cta.text}
</Button>
)}
{typeof block.cta2 === 'object' && (
<Button
className={'cta cta2'}
variant={block.cta2.theme}
tracking={tracking2}
onClick={() => handleButtonClick(block.cta2)}
onKeyPress={() => handleButtonClick(block.cta2)}
>
{block.cta2.text}
</Button>
)}
</div>
);
}
4 changes: 4 additions & 0 deletions packages/website/components/textblock/textblock.scss
Expand Up @@ -47,3 +47,7 @@
}
}
}

.cta2 {
margin-left: 1rem;
}
7 changes: 7 additions & 0 deletions packages/website/content/pages/index.json
Expand Up @@ -34,6 +34,13 @@
"event": "",
"ui": "HOME_HERO",
"action": "Get Started"
},
"cta2": {
"url": "https://blog.web3.storage/posts/say-hello-to-the-data-layer-1-3-intro-to-web3-storage",
"text": "WHAT'S THE DATA LAYER?",
"event": "",
"ui": "HOME_HERO",
"action": "Data Layer Blog Link"
}
}
]
Expand Down

0 comments on commit 2204ad5

Please sign in to comment.