Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 40 additions & 6 deletions src/components/ClickToZoom.astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,58 @@ export type Props = {
src: string
alt?: string
style?: string
caption?: string
}
const { src, alt, style } = Astro.props as Props
const { src, alt, style, caption } = Astro.props as Props

/**
* This component adds the classNames required by the scripts/click-to-zoom.ts script.
*/
---

<img src={src} alt={alt} style={style} class="click-to-zoom" />
<div class="click-to-zoom-container">
<img src={src} alt={alt} style={style} class="click-to-zoom" data-caption={caption} />
{caption && <p class="click-to-zoom-caption">{caption}</p>}
</div>

<style>
.click-to-zoom-container {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 2rem;
}
.click-to-zoom {
margin-top: 1em;
max-height: 50vh; /* Use viewport units for better adaptability */
max-height: 50vh;
cursor: zoom-in;
display: block;
margin-left: auto;
margin-right: auto;
}
.click-to-zoom-caption {
font-size: 0.8rem;
text-align: center;
margin-top: 0.5rem;
color: var(--color-text-secondary);
}
</style>
<style is:global>
#expanded-image-preview {
max-height: 90vh; /* Increased for more visibility on larger screens */
max-width: 95vw; /* Increased for a better experience */
max-height: 90vh;
max-width: 95vw;
}
#expanded-image-wrapper {
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.214);
background: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(5px);
-webkit-backdrop-filter: blur(5px);
z-index: 100;
flex-direction: column;
justify-content: center;
align-content: center;
align-items: center;
Expand All @@ -45,4 +67,16 @@ const { src, alt, style } = Astro.props as Props
display: flex;
}
}

.expanded-image-caption {
background-color: rgba(0, 0, 0, 0.7);
color: white;
padding: 8px 15px;
border-radius: 5px;
font-size: 0.9rem;
text-align: center;
max-width: 80%;
z-index: 101;
margin-top: 1rem;
}
</style>
1 change: 1 addition & 0 deletions src/components/CopyText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const CopyContainer = ({ text, code, format, formatType, eventName, additionalIn
text-overflow: ellipsis;
word-break: break-all;
margin-top: 0;
margin-bottom: 0 !important;
}

.copyBtn {
Expand Down
108 changes: 64 additions & 44 deletions src/config/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,56 +342,38 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
],
},
{
section: "Streams Trade",
contents: [
{
title: "Overview",
url: "data-streams/streams-trade",
},
{
title: "Getting Started",
url: "data-streams/getting-started",
highlightAsCurrent: ["data-streams/getting-started-hardhat"],
},
{
title: "Handle StreamsLookup errors",
url: "data-streams/tutorials/streams-trade/streams-trade-lookup-error-handler",
},
],
},
{
section: "Streams Direct",
section: "Tutorials",
contents: [
{
title: "Overview",
url: "data-streams/streams-direct",
url: "data-streams/tutorials/overview",
},
{
title: "Fetch and decode reports",
url: "data-streams/tutorials/streams-direct/streams-direct-api-go",
url: "data-streams/tutorials/api-go",
highlightAsCurrent: [
"data-streams/tutorials/streams-direct/streams-direct-api-rust",
"data-streams/tutorials/streams-direct/streams-direct-api-rwa-go",
"data-streams/tutorials/streams-direct/streams-direct-api-rwa-rust",
"data-streams/tutorials/api-rust",
"data-streams/tutorials/api-rwa-go",
"data-streams/tutorials/api-rwa-rust",
],
},
{
title: "Stream and decode reports (WebSocket)",
url: "data-streams/tutorials/streams-direct/streams-direct-ws-go",
url: "data-streams/tutorials/ws-go",
highlightAsCurrent: [
"data-streams/tutorials/streams-direct/streams-direct-ws-rust",
"data-streams/tutorials/streams-direct/streams-direct-ws-rwa-go",
"data-streams/tutorials/streams-direct/streams-direct-ws-rwa-rust",
"data-streams/tutorials/ws-rust",
"data-streams/tutorials/ws-rwa-go",
"data-streams/tutorials/ws-rwa-rust",
],
},
{
title: "Verify report data (EVM)",
url: "data-streams/tutorials/streams-direct/evm-onchain-report-verification",
url: "data-streams/tutorials/evm-onchain-report-verification",
},
{
title: "Verify report data (Solana)",
url: "data-streams/tutorials/streams-direct/solana-onchain-report-verification",
highlightAsCurrent: ["data-streams/tutorials/streams-direct/solana-offchain-report-verification"],
url: "data-streams/tutorials/solana-onchain-report-verification",
highlightAsCurrent: ["data-streams/tutorials/solana-offchain-report-verification"],
},
],
},
Expand All @@ -412,32 +394,70 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
section: "Reference",
contents: [
{
title: "Streams Trade",
url: "data-streams/reference/streams-trade-interface",
title: "Overview",
url: "data-streams/reference/overview",
},
{
title: "REST API",
url: "data-streams/reference/interface-api",
},
{
title: "WebSocket",
url: "data-streams/reference/interface-ws",
},
{
title: "Streams Direct",
url: "data-streams/reference/streams-direct",
title: "Authentication",
url: "data-streams/reference/authentication",
children: [
{
title: "REST API",
url: "data-streams/reference/streams-direct/streams-direct-interface-api",
title: "JavaScript examples",
url: "data-streams/reference/authentication/javascript-examples",
},
{
title: "WebSocket",
url: "data-streams/reference/streams-direct/streams-direct-interface-ws",
title: "TypeScript examples",
url: "data-streams/reference/authentication/typescript-examples",
},
{
title: "SDK References",
url: "data-streams/reference/streams-direct/streams-direct-go-sdk",
highlightAsCurrent: ["data-streams/reference/streams-direct/streams-direct-rust-sdk"],
title: "Go examples",
url: "data-streams/reference/authentication/go-examples",
},
{
title: "Onchain report verification (EVM chains)",
url: "data-streams/reference/streams-direct/streams-direct-onchain-verification",
title: "Rust examples",
url: "data-streams/reference/authentication/rust-examples",
},
],
},
{
title: "SDK References",
url: "data-streams/reference/go-sdk",
highlightAsCurrent: ["data-streams/reference/rust-sdk"],
},
{
title: "Onchain report verification (EVM chains)",
url: "data-streams/reference/onchain-verification",
},
],
},
{
section: "Streams Trade",
contents: [
{
title: "Overview",
url: "data-streams/streams-trade",
},
{
title: "Getting Started",
url: "data-streams/tutorials/streams-trade/getting-started",
highlightAsCurrent: ["data-streams/tutorials/streams-trade/getting-started-hardhat"],
},
{
title: "Handle StreamsLookup errors",
url: "data-streams/tutorials/streams-trade/streams-trade-lookup-error-handler",
},
{
title: "Reference (Interfaces)",
url: "data-streams/streams-trade/interfaces",
},
],
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ If your upkeep performs **sensitive** functions in your protocol, consider using

### Verify Data Streams reports fetched with StreamsLookup

If your upkeep uses [StreamsLookup](/chainlink-automation/reference/automation-interfaces#streamslookupcompatibleinterface), ensure you use the [verification interface](/data-streams/reference/interfaces) to verify your reports onchain.
If your upkeep uses [StreamsLookup](/chainlink-automation/reference/automation-interfaces#streamslookupcompatibleinterface), ensure you use the [verification interface](/data-streams/streams-trade/interfaces) to verify your reports onchain.

### Avoid "flickering" custom logic upkeeps

Expand Down
Loading
Loading