Files
xrpl-dev-portal/shared/components/CardTextIcon
Calvin b0db5b3a5c Perf pass + migrate home/payments page sections to shared (#3771)
* Perf pass + migrate home/payments page sections to shared

Performance work across every page plus a refactor moving home/payments
page sections into reusable shared components.

JavaScript
- Defer xrpl.js, jQuery, and Bootstrap in the global <head> (redocly.yaml)
  and on the 11 interactive tool pages' inline <script> tags — removes
  ~1MB of render-blocking JS from first paint on every page.
- Drop moment/moment-timezone from the client: remove the dead APEX-2025
  countdown in the navbar AlertBanner; format/parse dates with native
  Date/Intl in the blog and events pages.

Fonts & icons
- Remove render-blocking font-awesome.min.css + webfont. CSS glyphs
  (callouts, breadcrumbs, status labels, tutorials) now render as
  self-contained data-URI SVG masks (styles/_fa-icons.scss); markup icons
  use a shared inline-SVG <Icon> component (shared/components/Icon).
- Preconnect to Google Fonts / osano / GTM origins; preload the primary
  Booton UI font so text no longer waits on the 775KB stylesheet to parse.

Images & rendering
- Re-encode/resize oversized assets: new-york.jpeg 3.86MB→60KB,
  resources-icon.svg 4.2MB→150KB, event date/location SVGs ~1MB→0.5MB.
- Add loading=lazy/decoding=async to shared card components and the
  Video embed iframe.
- Add content-visibility to the events page's ~126-card grid to skip
  off-screen rendering.
- Earlier QA fixes: light-mode link color (#141414), events card grid
  layout, close nav menu on client-side navigation.

Home / payments refactor
- Move home page sections from page-local pages/home/sections/* to reusable
  shared/sections/* components (HomeHero relocated to shared/sections/HomeHero;
  home page now composes CalloutMediaBanner, CardStatsList, LinkTextDirectory,
  LogoSquareGrid, StandardCardGroupSection, FeatureSingleTopic, CarouselFeatured).
- Remove the now-unused pages/payments/sections/* in the same migration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Revert FontAwesome removal (keep it for open-source flexibility)

Restore the FontAwesome webfont + font-awesome.min.css and all FA icon
usages (markup fa-* classes and CSS ::before glyphs), reverting the
consolidation in d4cf4e8581. Other performance changes from that commit
(deferred head scripts, moment removal, image optimization, lazy-loading,
content-visibility, preconnect/preload) are retained.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* cleaning up breadcrumb styling

* sticky side nav

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 14:03:02 -07:00
..
2026-06-08 16:58:45 -07:00
2026-06-08 16:58:45 -07:00

CardTextIconCard Component

A card component featuring an icon, heading, and description. Built from Section Cards - Icon and Section Cards - Text Grid Figma designs.

Overview

CardTextIconCard displays an icon at the top, followed by a heading and description. The description accepts ReactNode, so it can include hyperlinks and other rich content. No buttons; links are inline within the description.

Features

  • Icon + Text Layout: Icon container, heading, and description in a vertical stack (optional)
  • Rich Description: description accepts ReactNode for inline links and formatted content
  • Aspect Ratio Foundation: Optional aspectRatio prop for future responsive sizing
  • Light/Dark Mode: Full theming support
  • Responsive Design: Adaptive icon size and spacing across breakpoints

Usage

Basic Usage

<CardTextIconCard
  icon="/icons/docs.svg"
  iconAlt="Documentation"
  heading="Documentation"
  description="Access everything you need to get started with the XRPL."
/>
<CardTextIconCard
  icon="/icons/docs.svg"
  heading="Documentation"
  description={
    <>
      Learn more in our{' '}
      <a href="/docs">documentation</a>.
    </>
  }
/>

Inline <a> tags in the description share the card’s description styles in CardTextIconCard.scss. In light mode, global html.light link rules can compete with those styles; use BdsLink with the design-system bds-link class if you need consistent BDS link behavior, or see CardTextIconCard.scss for .bds-card-text-icon-card__description link styling.

With Aspect Ratio

<CardTextIconCard
  icon="/icons/docs.svg"
  heading="Documentation"
  description="Access everything you need."
  aspectRatio={4 / 3}
/>

Props

CardTextIconCardProps

Prop Type Default Description
icon string Optional Icon image URL
iconAlt string '' Optional
heading string Required Card heading
description React.ReactNode Required Card description; accepts rich content (e.g., text with inline links)
aspectRatio number - Optional ratio for future use; applied via CSS variable
className string - Additional CSS classes

Component Structure

<>
  <div className="bds-card-text-icon-card__icon">
    {icon && (  
    <img
      src={icon}
      alt={iconAlt}
      {...(iconHeight != null && { height: iconHeight })}
      {...(iconWidth != null && { width: iconWidth })}
      className="bds-card-text-icon-card__icon-img"
    />
    )}
    <strong className="bds-card-text-icon-card__heading sh-md-r">{heading}</strong>
  </div>
  <p className="bds-card-text-icon-card__description body-l">
    {description}
  </p>  
</>

Responsive Sizing

Breakpoint Icon Size Padding Gap
Base (< 576px) 32px 16px 16px
MD (576px - 991px) 36px 20px 20px
LG (≥ 992px) 40px 32px 24px

Files

  • CardTextIconCard.tsx - React component with TypeScript
  • CardTextIconCard.scss - Styles with BEM naming
  • index.ts - Barrel exports
  • README.md - This file

Import

import { CardTextIconCard } from 'shared/components/CardTextIcon';
// or
import { CardTextIconCard, type CardTextIconCardProps } from 'shared/components/CardTextIcon';

Design System

Part of the Brand Design System (BDS) with bds- namespace prefix.