Skip to content

Commit e692ac0

Browse files
committed
update try it out component
1 parent 615b2fc commit e692ac0

File tree

7 files changed

+73
-64
lines changed

7 files changed

+73
-64
lines changed

src/components/CodeSample/CodeSampleReact.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const CodeSampleReact: React.FC<CodeSampleReactProps> = ({ src, showButto
1313

1414
const isSolidityFile = src.match(/\.sol/)
1515
const isSample = isSolidityFile && (src.indexOf("samples/") === 0 || src.indexOf("/samples/") === 0)
16-
16+
console.log(!isSample || !showButtonOnly || !remixUrl)
1717
if (!isSample || !showButtonOnly || !remixUrl) return null
1818

1919
return (

src/components/LeftSidebar/leftSidebar.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
.navGroups {
1111
padding: 0 var(--space-10x) var(--space-10x) 0;
12+
height: calc(100vh - var(--space-16x) - var(--space-16x)); /* Subtract header and footer height */
1213

1314
overflow-y: auto;
1415
scrollbar-width: thin;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
import { Button, Typography } from "@chainlink/blocks"
3+
import styles from "./styles.module.css"
4+
import CodeSample from "../CodeSample/CodeSample.astro"
5+
import { TryItOutAccordion } from "./TryItOutAccordion"
6+
---
7+
8+
<div class={styles.container}>
9+
<section class={styles.body}>
10+
<Typography variant="h2" className={styles.title}> Try it out </Typography>
11+
12+
<section class={styles.content}>
13+
<div>
14+
<TryItOutAccordion client:only="react" />
15+
16+
<footer class={styles.contentFooter}>
17+
<Button>Create CRE account</Button>
18+
<Button variant="tertiary" className={styles.secondaryBtn}> Get the SDK </Button>
19+
</footer>
20+
</div>
21+
22+
<!-- <CodeSample src="/samples/ChainlinkFunctions/AutomatedFunctionsConsumerExample.sol" /> -->
23+
</section>
24+
</section>
25+
</div>

src/components/TryItOut/TryItOut.tsx

Lines changed: 0 additions & 60 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Typography } from "@chainlink/blocks"
2+
import styles from "./styles.module.css"
3+
4+
export const TryItOutAccordion = () => {
5+
const tabs = [
6+
{
7+
title: "Transfer Tokens Between Chains",
8+
text: "Use Chainlink CCIP to transfer tokens from a smart contract to an account on a different blockchain.",
9+
},
10+
{
11+
title: "Leverage MVR feeds",
12+
text: "Use Multiple-Variable Response (MVR) feeds data in your consumer contracts on EVM chains using Solidity.",
13+
},
14+
{
15+
title: "Fetch and Decode Real World Asset Streams",
16+
text: "Use the Data Streams SDK for Go/Rust to fetch and decode reports from the Data Streams Aggregation Network.",
17+
},
18+
{
19+
title: "Automate your Functions",
20+
text: "Use Chainlink Automation to trigger the same functions regularly, such as fetching weather data daily or fetching an asset price on every block.",
21+
},
22+
]
23+
24+
return (
25+
<Accordion collapsible type="single">
26+
{tabs.map((tab, idx) => (
27+
<AccordionItem key={idx} value={String(idx)} className={styles.accordionItem}>
28+
<AccordionTrigger className={styles.accordionTrigger}>
29+
{tab.title}{" "}
30+
<Typography variant="code" className={styles.indicator}>
31+
0{idx + 1}
32+
</Typography>
33+
</AccordionTrigger>
34+
<AccordionContent className={styles.text}>{tab.text}</AccordionContent>
35+
</AccordionItem>
36+
))}
37+
</Accordion>
38+
)
39+
}

src/components/TryItOut/styles.module.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.container {
22
background-color: var(--tertiary-foreground);
33
padding: var(--space-10x) var(--space-16x);
4+
margin: 86px 0;
45
}
56

67
.title {
@@ -30,7 +31,10 @@
3031
border-top: 1px solid var(--segment-button-foreground);
3132
display: flex;
3233
flex-direction: column;
33-
transition: all 0.3s ease-in-out;
34+
35+
* {
36+
transition: all 0.2s linear;
37+
}
3438
}
3539

3640
.text {

src/pages/index.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as CONFIG from "../config"
77
import Demos from "~/components/Demos.astro"
88
import { Typography } from "@chainlink/blocks"
99
import LandingHero from "~/components/LandingHero/LandingHero.astro"
10-
import TryItOut from "~/components/TryItOut/TryItOut"
10+
import TryItOut from "~/components/TryItOut/TryItOut.astro"
1111
1212
const formattedContentTitle = `${CONFIG.PAGE.titleFallback} | ${CONFIG.SITE.title}`
1313
---
@@ -20,7 +20,7 @@ const formattedContentTitle = `${CONFIG.PAGE.titleFallback} | ${CONFIG.SITE.titl
2020
<JourneyCards />
2121
</div>
2222

23-
<TryItOut client:only="react" />
23+
<TryItOut />
2424

2525
<div class="wrapper">
2626
<Demos />

0 commit comments

Comments
 (0)