From 7c6943e05aecf2d1fe825be9fe6e3f2466b00716 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Thu, 18 Jun 2026 07:21:32 +0000 Subject: [PATCH] Legal Downtown --- frontend/src/components/NavBarItem.tsx | 3 +- frontend/src/layouts/Authenticated.tsx | 3 +- frontend/src/pages/index.tsx | 323 ++++++++++++++----------- 3 files changed, 185 insertions(+), 144 deletions(-) diff --git a/frontend/src/components/NavBarItem.tsx b/frontend/src/components/NavBarItem.tsx index 6548433..2ef67e9 100644 --- a/frontend/src/components/NavBarItem.tsx +++ b/frontend/src/components/NavBarItem.tsx @@ -1,6 +1,5 @@ -import React, {useEffect, useRef} from 'react' +import React, { useEffect, useRef, useState } from 'react' import Link from 'next/link' -import { useState } from 'react' import { mdiChevronUp, mdiChevronDown } from '@mdi/js' import BaseDivider from './BaseDivider' import BaseIcon from './BaseIcon' diff --git a/frontend/src/layouts/Authenticated.tsx b/frontend/src/layouts/Authenticated.tsx index 1b9907d..73d8391 100644 --- a/frontend/src/layouts/Authenticated.tsx +++ b/frontend/src/layouts/Authenticated.tsx @@ -1,5 +1,4 @@ -import React, { ReactNode, useEffect } from 'react' -import { useState } from 'react' +import React, { ReactNode, useEffect, useState } from 'react' import jwt from 'jsonwebtoken'; import { mdiForwardburger, mdiBackburger, mdiMenu } from '@mdi/js' import menuAside from '../menuAside' diff --git a/frontend/src/pages/index.tsx b/frontend/src/pages/index.tsx index 61d525d..f2b0b64 100644 --- a/frontend/src/pages/index.tsx +++ b/frontend/src/pages/index.tsx @@ -1,166 +1,209 @@ - -import React, { useEffect, useState } from 'react'; -import type { ReactElement } from 'react'; +import React, { ReactElement, useMemo, useState } from 'react'; import Head from 'next/head'; import Link from 'next/link'; import BaseButton from '../components/BaseButton'; -import CardBox from '../components/CardBox'; -import SectionFullScreen from '../components/SectionFullScreen'; -import LayoutGuest from '../layouts/Guest'; -import BaseDivider from '../components/BaseDivider'; import BaseButtons from '../components/BaseButtons'; +import LayoutGuest from '../layouts/Guest'; import { getPageTitle } from '../config'; -import { useAppSelector } from '../stores/hooks'; -import CardBoxComponentTitle from "../components/CardBoxComponentTitle"; -import { getPexelsImage, getPexelsVideo } from '../helpers/pexels'; +type Product = { + id: string; + title: string; + category: string; + price: string; + description: string; + badge: string; +}; + +type Inquiry = { + id: number; + name: string; + email: string; + firm: string; + products: string[]; + message: string; +}; + +const businessName = 'Texas Law Books Co.'; +const navItems = ['Catalog', 'Services', 'About', 'Contact']; +const products: Product[] = [ + { + id: 'civil', + title: 'Texas Civil Practice Library', + category: 'Practice Guides', + price: '$189', + description: 'Courthouse-ready procedure notes, pleadings checklists, and motion workflow references.', + badge: 'Best seller', + }, + { + id: 'probate', + title: 'Estate & Probate Deskbook', + category: 'Law Books', + price: '$145', + description: 'Texas-specific estate planning, probate administration, forms, and desk reference guidance.', + badge: 'New edition', + }, + { + id: 'business', + title: 'Texas Business Law Forms', + category: 'Forms & Products', + price: '$119', + description: 'Reusable entity formation, contract, compliance, and registered-office form templates.', + badge: 'Digital + print', + }, +]; + +const buildDownloadHtml = () => ` +${businessName} + +
Texas-based legal bookseller

Professional law books and legal products for serious Texas practice.

Curated law books, desk references, forms, and practice tools for attorneys, firms, libraries, and students who need reliable Texas-focused legal materials.

Business partner/dealer: Law Source

Browse products

Featured catalog

Select editions for immediate quote requests.

${products.map((product) => `
${product.badge}

${product.title}

${product.category}

${product.description}

${product.price}
Request this title
`).join('')}

Law library sourcing

Locate dependable Texas practice guides, statutes, supplements, and deskbooks.

Bulk firm orders

Request bundled pricing for firms, students, and library refreshes.

Product recommendations

Tell us your practice area and we will suggest a practical starting set.

Request product info

Send a demo inquiry and we will prepare a catalog recommendation, quote, and availability note.

`; export default function Starter() { - const [illustrationImage, setIllustrationImage] = useState({ - src: undefined, - photographer: undefined, - photographer_url: undefined, - }) - const [illustrationVideo, setIllustrationVideo] = useState({video_files: []}) - const [contentType, setContentType] = useState('image'); - const [contentPosition, setContentPosition] = useState('right'); - const textColor = useAppSelector((state) => state.style.linkColor); + const [selectedBookIds, setSelectedBookIds] = useState([products[0].id]); + const [form, setForm] = useState({ name: '', email: '', firm: '', message: '' }); + const [inquiries, setInquiries] = useState([]); + const [selectedInquiryId, setSelectedInquiryId] = useState(null); + const [formError, setFormError] = useState(''); + const [downloadReady, setDownloadReady] = useState(false); - const title = 'Texas Law Books Site' + const selectedProducts = useMemo( + () => products.filter((product) => selectedBookIds.includes(product.id)), + [selectedBookIds], + ); + const selectedInquiry = inquiries.find((inquiry) => inquiry.id === selectedInquiryId) ?? inquiries[0]; - // Fetch Pexels image/video - useEffect(() => { - async function fetchData() { - const image = await getPexelsImage(); - const video = await getPexelsVideo(); - setIllustrationImage(image); - setIllustrationVideo(video); - } - fetchData(); - }, []); - - const imageBlock = (image) => ( -
- -
+ const toggleProduct = (productId: string) => { + setSelectedBookIds((current) => + current.includes(productId) ? current.filter((id) => id !== productId) : [...current, productId], ); + }; - const videoBlock = (video) => { - if (video?.video_files?.length > 0) { - return ( -
- - -
) - } + const submitInquiry = (event: React.FormEvent) => { + event.preventDefault(); + setFormError(''); + if (!form.name.trim() || !form.email.trim()) { + setFormError('Please add your name and email before preparing the request.'); + return; + } + if (selectedProducts.length === 0) { + setFormError('Please select at least one law book or product.'); + return; + } + const newInquiry: Inquiry = { + id: Date.now(), + name: form.name.trim(), + email: form.email.trim(), + firm: form.firm.trim() || 'Independent buyer', + message: form.message.trim() || 'Please send availability and purchasing details.', + products: selectedProducts.map((product) => product.title), }; + setInquiries((current) => [newInquiry, ...current]); + setSelectedInquiryId(newInquiry.id); + setForm({ name: '', email: '', firm: '', message: '' }); + }; + + const downloadHtml = () => { + const blob = new Blob([buildDownloadHtml()], { type: 'text/html;charset=utf-8' }); + const url = URL.createObjectURL(blob); + const anchor = document.createElement('a'); + anchor.href = url; + anchor.download = 'texas-law-books-partner-website.html'; + document.body.appendChild(anchor); + anchor.click(); + anchor.remove(); + URL.revokeObjectURL(url); + setDownloadReady(true); + }; return ( -
+ <> - {getPageTitle('Starter Page')} + {getPageTitle('Texas Law Books Partner Website')} + - - -
- {contentType === 'image' && contentPosition !== 'background' - ? imageBlock(illustrationImage) - : null} - {contentType === 'video' && contentPosition !== 'background' - ? videoBlock(illustrationVideo) - : null} -
- - - -
-

This is a React.js/Node.js app generated by the Flatlogic Web App Generator

-

For guides and documentation please check - your local README.md and the Flatlogic documentation

+
+
+
+ + Texas Law Books + + +
+ + Admin login + +
- - - +
+
- - -
-
- -
-

© 2026 {title}. All rights reserved

- - Privacy Policy - -
+
+
+
+
+
Texas-based legal bookseller
+

Law books and legal products built for Texas practice.

+

A professional black, white, and light-green website for a law-focused retailer selling practice guides, deskbooks, forms, and firm-ready legal products.

+

+ Business partner/dealer:{' '} + Law Source +

+ + document.getElementById('request')?.scrollIntoView({ behavior: 'smooth' })} className='border-black bg-black px-6 py-3 text-white hover:bg-[#172018]' /> + + +
+ No extra external links + Single-file export +
+
+ +
+
-
+
+
+

Featured catalog

Select products for the quote flow

Choose products, prepare an inquiry, confirm the request, and download the static HTML file.

+
{products.map((product) => { const selected = selectedBookIds.includes(product.id); return (
{product.badge}{product.price}

{product.title}

{product.category}

{product.description}

); })}
+
+
+ +
+
+

End-to-end workflow

Prepare a customer request

The form validates required fields, creates a local confirmation, and shows a visible inquiry list before backend persistence is added.

Selected products

{selectedProducts.length > 0 ?
    {selectedProducts.map((product) => (
  • {product.title}{product.price}
  • ))}
:

Empty state: choose at least one product from the catalog.

}
+
+
+
+ +