Skip to content

Commit 2259cbb

Browse files
committed
wrap up tryit
1 parent fc67e8f commit 2259cbb

File tree

3 files changed

+50
-7
lines changed

3 files changed

+50
-7
lines changed

src/components/CodeSample/CodeSample.astro

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ export type Props = {
1010
showButtonOnly?: boolean
1111
optimize?: boolean
1212
runs?: number
13+
showButtons?: boolean
1314
}
14-
const { src, lang, showButtonOnly, optimize, runs } = Astro.props as Props
15+
const { src, lang, showButtonOnly, optimize, runs, showButtons = true } = Astro.props as Props
1516
1617
const data = (await fs.readFile(path.join(process.cwd(), "public", src), "utf-8")).toString()
1718
@@ -31,7 +32,7 @@ const remixUrl = `https://remix.ethereum.org/#url=https://docs.chain.link/${clea
3132

3233
{!showButtonOnly && <Prism code={data} lang={lang ?? "solidity"} />}
3334
{
34-
isSample && (
35+
isSample && showButtons && (
3536
<div class="remix-callout">
3637
<a href={remixUrl} target="_blank">
3738
Open in Remix

src/components/TryItOut/TryItOut.astro

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { TryItOutAccordion } from "./TryItOutAccordion"
1010
<Typography variant="h2" className={styles.title}> Try it out </Typography>
1111

1212
<section class={styles.content}>
13-
<div>
13+
<div class={styles.contentLeft}>
1414
<TryItOutAccordion client:only="react" />
1515

1616
<footer class={styles.contentFooter}>
@@ -19,7 +19,14 @@ import { TryItOutAccordion } from "./TryItOutAccordion"
1919
</footer>
2020
</div>
2121

22-
<!-- <CodeSample src="/samples/ChainlinkFunctions/AutomatedFunctionsConsumerExample.sol" /> -->
22+
<section class={styles.image}>
23+
<CodeSample showButtons={false} src="/samples/ChainlinkFunctions/AutomatedFunctionsConsumerExample.sol" />
24+
</section>
25+
26+
<footer class={styles.contentFooterMobile}>
27+
<Button>Create CRE account</Button>
28+
<Button variant="tertiary" className={styles.secondaryBtn}> Get the SDK </Button>
29+
</footer>
2330
</section>
2431
</section>
2532
</div>

src/components/TryItOut/styles.module.css

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
.content {
2323
display: grid;
24-
grid-template-columns: 492px 735px;
24+
grid-template-columns: 1fr 1fr;
2525
justify-content: space-between;
2626
gap: var(--space-24x);
2727
}
@@ -37,6 +37,12 @@
3737
}
3838
}
3939

40+
.contentLeft {
41+
display: flex;
42+
flex-direction: column;
43+
justify-content: center;
44+
}
45+
4046
.text {
4147
color: var(--muted-more-foreground);
4248
}
@@ -57,11 +63,18 @@
5763
& svg {
5864
display: none;
5965
}
66+
67+
& span {
68+
word-wrap: normal;
69+
}
6070
}
6171

6272
.image {
6373
width: 100%;
64-
object-fit: cover;
74+
max-height: 412px;
75+
overflow: hidden;
76+
border-bottom: 1.5px solid var(--stepper-counter-pending-foreground);
77+
border-radius: 6.317px;
6578
}
6679

6780
.accordionItem[data-state="open"] {
@@ -81,9 +94,31 @@
8194
margin: 0 auto;
8295
}
8396

97+
.contentFooterMobile {
98+
display: none;
99+
gap: var(--space-6x);
100+
}
101+
102+
@media screen and (max-width: 425px) {
103+
.contentFooterMobile {
104+
flex-direction: column;
105+
}
106+
}
107+
84108
@media screen and (max-width: 768px) {
85109
.content {
86110
grid-template-columns: 1fr;
87-
padding: 0 var(--space-8x);
111+
gap: var(--space-8x);
112+
}
113+
114+
.title {
115+
font-size: 28px;
116+
}
117+
.contentFooter {
118+
display: none;
119+
}
120+
121+
.contentFooterMobile {
122+
display: flex;
88123
}
89124
}

0 commit comments

Comments
 (0)