All files / src/apps/home/pages/docs DocsListing.tsx

16.66% Statements 4/24
50% Branches 1/2
16.66% Functions 2/12
16.66% Lines 4/24

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214                      1x 1x   1x                                                                                                                                                                             3x                                                                                                                                                                                                                                
import { usePageMeta } from "@/contexts/PageContext";
import { APP_NAME, APP_ROUTES } from "@/routes/const";
import { ArrowRight, BookText } from "lucide-react";
import React from "react";
import { Link } from "react-router-dom";
import { docsData } from "./docsData";
import { Reveal } from "@/components/reveal";
import { BRAND_BLUE } from "@/components/theme/accents";
 
// ─── Page ─────────────────────────────────────────────────────────────────────
 
const DocsListing: React.FC = () => {
  usePageMeta("Docs", false);
 
  return (
    <div className="overflow-hidden">
      {/* ─── Hero ──────────────────────────────────────────────────────────── */}
      <section className="py-20 px-8">
        <div className="max-w-4xl mx-auto text-center">
          <div
            className="inline-flex items-center gap-2 mb-6 px-4 py-1.5 rounded-full text-xs font-semibold tracking-widest uppercase"
            style={{
              background: "rgba(59,130,246,0.08)",
              border: "1px solid rgba(59,130,246,0.25)",
            }}
          >
            <BookText className="size-3" />
            Documentation
          </div>
          <h1
            className="text-4xl md:text-6xl font-black mb-5 leading-tight"
            style={{
              background:
                "linear-gradient(135deg, #1e40af 0%, #3b82f6 55%, #06b6d4 100%)",
              WebkitBackgroundClip: "text",
              WebkitTextFillColor: "transparent",
              backgroundClip: "text",
            }}
          >
            Everything You Need to Build with {APP_NAME}
          </h1>
          <p className="text-lg text-gray-500 max-w-2xl mx-auto mb-10 leading-relaxed">
            Guides, platform reference, and step-by-step walkthroughs — all in
            one place.
          </p>
          <div className="flex flex-col sm:flex-row gap-4 justify-center">
            <Link
              to={docsData[0].url}
              className="px-8 py-3.5 rounded-xl font-bold text-sm"
              style={{
                background: "linear-gradient(135deg, #2563eb, #1d4ed8)",
                color: "white",
                boxShadow: "0 0 24px rgba(37,99,235,0.4)",
                transition: "transform 0.15s, box-shadow 0.15s",
              }}
              onMouseEnter={(e) => {
                e.currentTarget.style.transform = "scale(1.03)";
                e.currentTarget.style.boxShadow =
                  "0 0 40px rgba(37,99,235,0.65)";
              }}
              onMouseLeave={(e) => {
                e.currentTarget.style.transform = "scale(1)";
                e.currentTarget.style.boxShadow =
                  "0 0 24px rgba(37,99,235,0.4)";
              }}
            >
              Get Started
            </Link>
            <Link
              to={docsData[2].url}
              className="px-8 py-3.5 rounded-xl font-bold text-sm flex items-center gap-2"
              style={{
                border: "1px solid rgba(37,99,235,0.3)",
                color: "#2563eb",
                transition: "background 0.15s, transform 0.15s",
              }}
              onMouseEnter={(e) => {
                e.currentTarget.style.background = "rgba(37,99,235,0.06)";
                e.currentTarget.style.transform = "scale(1.02)";
              }}
              onMouseLeave={(e) => {
                e.currentTarget.style.background = "transparent";
                e.currentTarget.style.transform = "scale(1)";
              }}
            >
              Reference <ArrowRight className="size-4" />
            </Link>
          </div>
        </div>
      </section>
 
      {/* ─── Category Cards ──────────────────────────────────────────────────── */}
      <section className="px-8 pb-24">
        <div className="max-w-5xl mx-auto">
          <Reveal>
            <p className="text-center text-xs font-semibold uppercase tracking-widest text-gray-400 mb-8">
              Browse by category
            </p>
          </Reveal>
          <div className="grid grid-cols-1 md:grid-cols-3 gap-6">
            {docsData.map((section, i) => (
              <Reveal key={i} delay={i * 0.1}>
                <Link
                  to={section.url}
                  className="group block rounded-2xl p-6 h-full"
                  style={{
                    border: "1px solid rgba(59,130,246,0.14)",
                    transition:
                      "transform 0.2s, border-color 0.2s, box-shadow 0.2s",
                    textDecoration: "none",
                  }}
                  onMouseEnter={(e) => {
                    e.currentTarget.style.transform = "translateY(-4px)";
                    e.currentTarget.style.borderColor = "rgba(37,99,235,0.4)";
                    e.currentTarget.style.boxShadow =
                      "0 12px 36px rgba(37,99,235,0.12)";
                  }}
                  onMouseLeave={(e) => {
                    e.currentTarget.style.transform = "translateY(0)";
                    e.currentTarget.style.borderColor = "rgba(59,130,246,0.14)";
                    e.currentTarget.style.boxShadow = "none";
                  }}
                >
                  <div
                    className="inline-flex p-2.5 rounded-xl mb-4"
                    style={{
                      background: "rgba(37,99,235,0.1)",
                      color: "#2563eb",
                    }}
                  >
                    {section.icon}
                  </div>
                  <div className="flex items-center justify-between mb-2">
                    <h3 className="font-bold text-base">{section.title}</h3>
                    <ArrowRight
                      className="size-4 opacity-30 group-hover:opacity-70 transition-opacity"
                      style={{ color: "#2563eb" }}
                    />
                  </div>
                  <p className="text-sm text-gray-500 leading-relaxed mb-3">
                    {section.description}
                  </p>
                  <span
                    className="text-xs font-semibold"
                    style={{ color: BRAND_BLUE }}
                  >
                    {section.children?.length ?? 0} articles
                  </span>
                </Link>
              </Reveal>
            ))}
          </div>
        </div>
      </section>
 
      {/* ─── CTA ─────────────────────────────────────────────────────────────── */}
      <Reveal>
        <section
          className="py-20 px-8 text-center text-white"
          style={{
            background:
              "linear-gradient(135deg, rgba(2,0,36,1) 0%, rgba(9,9,121,1) 50%, rgba(0,212,255,0.85) 100%)",
          }}
        >
          <h2 className="text-3xl md:text-4xl font-black mb-4">
            Something Not Covered?
          </h2>
          <p className="text-blue-100 text-lg mb-8 max-w-lg mx-auto leading-relaxed">
            Our team is happy to help. Reach out and we'll get back to you
            promptly.
          </p>
          <div className="flex flex-col sm:flex-row gap-4 justify-center">
            <Link
              to={APP_ROUTES.HOME.contact}
              className="px-8 py-4 rounded-xl font-bold text-lg bg-white text-blue-900"
              style={{ transition: "transform 0.15s" }}
              onMouseEnter={(e) =>
                (e.currentTarget.style.transform = "scale(1.04)")
              }
              onMouseLeave={(e) =>
                (e.currentTarget.style.transform = "scale(1)")
              }
            >
              Contact Support
            </Link>
            <Link
              to={APP_ROUTES.HOME.signup}
              className="px-8 py-4 rounded-xl font-bold text-lg"
              style={{
                background: "rgba(255,255,255,0.12)",
                border: "1px solid rgba(255,255,255,0.4)",
                color: "white",
                transition: "background 0.15s, transform 0.15s",
              }}
              onMouseEnter={(e) => {
                e.currentTarget.style.background = "rgba(255,255,255,0.22)";
                e.currentTarget.style.transform = "scale(1.02)";
              }}
              onMouseLeave={(e) => {
                e.currentTarget.style.background = "rgba(255,255,255,0.12)";
                e.currentTarget.style.transform = "scale(1)";
              }}
            >
              Get Started Free
            </Link>
          </div>
        </section>
      </Reveal>
    </div>
  );
};
 
export default DocsListing;