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
20 changes: 12 additions & 8 deletions @theme/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -559,18 +559,22 @@ html:not(.light) .feature-event {
color: #FFF;
}

/* Fix Card Buttons Alignment */
.redocly-card-filled {
min-height: 155px;
display: flex;
flex-direction: column;
/* Align card buttons to the bottom of each card */
.card-variant-filled > div:last-child > div:last-child {
flex-grow: 1;
}

.redocly-card-filled > p {
.card-variant-filled > div:last-child > div:last-child > div:last-child {
display: flex;
flex-direction: column;
flex-grow: 1;
}

.redocly-card-filled button {
.card-variant-filled > div:last-child > div:last-child > div:last-child > button:last-child,
.card-variant-filled > div:last-child > div:last-child > div:last-child > .card-actions:last-child {
margin-top: auto;
display: inline-flex;
}

.card-variant-filled > div:last-child > div:last-child > div:last-child > button:last-child {
align-self: flex-start;
}
53 changes: 53 additions & 0 deletions components/landing.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import styled from "styled-components";
import * as React from "react";
import { H1, H2, Button } from "@redocly/theme";
import { GithubIcon } from "@redocly/theme/icons/GithubIcon/GithubIcon";

const Header1 = styled(H1)`
color: white !important;
Expand Down Expand Up @@ -76,6 +77,56 @@ function ButtonToXRPL({ children }) {
</XRPLStyledButton>
}

const GitHubStyledButton = styled(Button)`
margin-left: auto;
flex-shrink: 0;
color: var(--card-text-color);

svg path {
fill: currentColor;
}

&:hover {
color: var(--color-primary-base);
}
`;

// A button, not an anchor: the enclosing Card is already a link.
function ButtonToGitHub({ to, label = "GitHub" }) {
return (
<GitHubStyledButton
variant="text"
size="large"
icon={<GithubIcon />}
title="View the source on GitHub"
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
window.open(to, "_blank", "noopener,noreferrer");
}}
>
{label}
</GitHubStyledButton>
);
}

const CardActionsRow = styled.div`
display: flex;
align-items: center;
gap: var(--spacing-sm);
width: 100%;
`;

// Card CTA row, with an optional right-aligned GitHub link.
function CardActions({ github, children }) {
return (
<CardActionsRow className="card-actions">
{children}
{github && <ButtonToGitHub to={github} />}
</CardActionsRow>
);
}

// Key Dates component for feature pages
function KeyDatesCard(props: {
title:string,
Expand Down Expand Up @@ -141,6 +192,8 @@ export {
LandingLayout,
Jumbotron,
ButtonToXRPL,
ButtonToGitHub,
CardActions,
KeyDatesCard,
KeyDate,
FeatureHeader,
Expand Down
11 changes: 7 additions & 4 deletions docs/xls-65-single-asset-vault/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
LandingLayout,
FeatureHeader,
FeatureContent,
ButtonToXRPL
ButtonToXRPL,
CardActions
} from "../../components/landing";
import { AmendmentTracker } from "../../components/AmendmentTracker";
import { Button } from "@redocly/theme";
Expand Down Expand Up @@ -106,9 +107,11 @@ export default function Page() {
<p>
Explore a full lending platform built on the Lending Protocol and Single Asset Vaults, featuring dedicated dashboards for brokers, depositors, and borrowers.
</p>
<Button size="large" variant="primary">
Try the Demo App
</Button>
<CardActions github="https://github.com/ripple/xrpl-reference-app-lending-sav">
<Button size="large" variant="primary">
Try the Demo App
</Button>
</CardActions>
</Card>
<Card
title="Security Audit"
Expand Down
11 changes: 7 additions & 4 deletions docs/xls-66-lending-protocol/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
LandingLayout,
FeatureHeader,
FeatureContent,
ButtonToXRPL
ButtonToXRPL,
CardActions
} from "../../components/landing";
import { AmendmentTracker } from "../../components/AmendmentTracker";
import { Button } from "@redocly/theme";
Expand Down Expand Up @@ -103,9 +104,11 @@ export default function Page() {
<p>
Explore a full lending platform built on the Lending Protocol and Single Asset Vaults, featuring dedicated dashboards for brokers, depositors, and borrowers.
</p>
<Button size="large" variant="primary">
Try the Demo App
</Button>
<CardActions github="https://github.com/ripple/xrpl-reference-app-lending-sav">
<Button size="large" variant="primary">
Try the Demo App
</Button>
</CardActions>
Comment thread
oeggert marked this conversation as resolved.
</Card>
<Card title="Security Audit" to="https://www.halborn.com/audits/ripple/lending-protocol-re-audit-2769d2">
<p>
Expand Down