diff --git a/apps/web/app/docs/[[...slug]]/page.tsx b/apps/web/app/docs/[[...slug]]/page.tsx index f040d0319..0f85ce5de 100644 --- a/apps/web/app/docs/[[...slug]]/page.tsx +++ b/apps/web/app/docs/[[...slug]]/page.tsx @@ -62,7 +62,6 @@ export default function DocPage({ params }: Props) { - @@ -150,103 +149,6 @@ function DocsPager({ doc }: { doc: Doc }) { ); } -function DocFooter() { - return ( -
-
-
-
- - - Flowbite React - -

- Flowbite is an ecosystem built on top of Tailwind CSS including a component library, block sections, a - Figma design system and other resources. -

-

- Code licensed{" "} - - MIT - - , docs{" "} - - CC BY 3.0 - -

-
-
-
- - - - GitHub - - - Flowbite - - - Tailwind CSS - - - Figma - - -
-
- - - - Discord - - - Github Discussions - - -
-
- - - - License - - - Brand guideline - - -
-
-
- -
- -
-
-
- ); -} - function ToC({ doc }: { doc: Doc }) { return (
diff --git a/apps/web/app/docs/layout.tsx b/apps/web/app/docs/layout.tsx index 6d612d1a2..8c91b406d 100644 --- a/apps/web/app/docs/layout.tsx +++ b/apps/web/app/docs/layout.tsx @@ -9,6 +9,7 @@ import { useEffect, useState } from "react"; import { HiMenuAlt1, HiX } from "react-icons/hi"; import { twMerge } from "tailwind-merge"; import { DocSearchInput } from "~/components/docsearch-input"; +import { MainFooter } from "~/components/main-footer"; import { NavbarIcons, NavbarLinks } from "~/components/navbar"; import { DOCS_SIDEBAR, type DocsSidebarItem } from "~/data/docs-sidebar"; @@ -36,6 +37,7 @@ export default function DocsLayout({ children }: PropsWithChildren) {
{children}
+ ); diff --git a/apps/web/app/page.tsx b/apps/web/app/page.tsx index 11ba98e32..dfb6d2c50 100644 --- a/apps/web/app/page.tsx +++ b/apps/web/app/page.tsx @@ -1,4 +1,3 @@ -import { Banner } from "~/components/banner"; import { ComponentsSection, ContributorsSection, @@ -7,11 +6,11 @@ import { FigmaSection, HeroSection, HomeNavbar, - MainFooter, ReactSection, SocialProofSection, TailwindSection, } from "~/components/homepage"; +import { MainFooter } from "~/components/main-footer"; export default function HomePage() { return ( diff --git a/apps/web/components/code-demo.tsx b/apps/web/components/code-demo.tsx index c07041bce..15faa9a84 100644 --- a/apps/web/components/code-demo.tsx +++ b/apps/web/components/code-demo.tsx @@ -244,12 +244,11 @@ function CodePreview({ children, }: PropsWithChildren<{ view: View; isRTL: boolean; isDarkMode: boolean | null; iframe?: IFrameData }>) { return ( -
+
-
+
{ try { - const result = await fetch("https://api.github.com/repos/themesberg/flowbite-react/contributors?per_page=21"); + const result = await fetchSafe( + "https://api.github.com/repos/themesberg/flowbite-react/contributors?per_page=21", + ); - return safeResJson(result); + return result.filter((contributor) => contributor.login !== "github-actions[bot]"); } catch (error) { return []; } diff --git a/apps/web/components/homepage/index.ts b/apps/web/components/homepage/index.ts index f9e0f8deb..f5d8a28b0 100644 --- a/apps/web/components/homepage/index.ts +++ b/apps/web/components/homepage/index.ts @@ -5,7 +5,6 @@ export { FeaturedSection } from "./featured-section"; export { FigmaSection } from "./figma-section"; export { HeroSection } from "./hero-section"; export { HomeNavbar } from "./home-navbar"; -export { MainFooter } from "./main-footer"; export { ReactSection } from "./react-section"; export { SocialProofSection } from "./social-proof-section"; export { TailwindSection } from "./tailwind-section"; diff --git a/apps/web/components/homepage/social-proof-section.tsx b/apps/web/components/homepage/social-proof-section.tsx index cd80f3dc2..04d27ef06 100644 --- a/apps/web/components/homepage/social-proof-section.tsx +++ b/apps/web/components/homepage/social-proof-section.tsx @@ -1,9 +1,5 @@ import Image from "next/image"; -import { safeResJson } from "~/helpers/http"; - -async function fetchSafe(endpoint: string): Promise { - return safeResJson(await fetch(endpoint)); -} +import { fetchSafe } from "~/helpers/http"; async function fetchStargazers(): Promise { try { diff --git a/apps/web/components/homepage/main-footer.tsx b/apps/web/components/main-footer.tsx similarity index 74% rename from apps/web/components/homepage/main-footer.tsx rename to apps/web/components/main-footer.tsx index 02859c2df..f59070688 100644 --- a/apps/web/components/homepage/main-footer.tsx +++ b/apps/web/components/main-footer.tsx @@ -20,6 +20,8 @@ export function MainFooter() { Code licensed{" "} MIT @@ -28,6 +30,7 @@ export function MainFooter() { CC BY 3.0 @@ -41,16 +44,26 @@ export function MainFooter() { className="mb-6 text-sm font-semibold uppercase text-gray-900 dark:text-white" /> - + GitHub - + Flowbite - + Tailwind CSS - + Figma @@ -61,10 +74,20 @@ export function MainFooter() { className="mb-6 text-sm font-semibold uppercase text-gray-900 dark:text-white" /> - + Discord - + Github Discussions @@ -75,10 +98,10 @@ export function MainFooter() { className="mb-6 text-sm font-semibold uppercase text-gray-900 dark:text-white" /> - + License - + Brand guideline diff --git a/apps/web/components/navbar.tsx b/apps/web/components/navbar.tsx index 2a76f06dd..f7fe4faaf 100644 --- a/apps/web/components/navbar.tsx +++ b/apps/web/components/navbar.tsx @@ -45,6 +45,7 @@ export function NavbarIcons() {
- + v{version} diff --git a/apps/web/helpers/http.ts b/apps/web/helpers/http.ts index 2a5605219..0a93c1703 100644 --- a/apps/web/helpers/http.ts +++ b/apps/web/helpers/http.ts @@ -1,5 +1,9 @@ -export function safeResJson(res: Response) { - if (res.ok) return res.json() as Promise; +export async function fetchSafe(endpoint: string): Promise { + const response = await fetch(endpoint); - throw new Error("Internal server error!"); + if (!response.ok) { + throw new Error("Internal server error!"); + } + + return response.json(); } diff --git a/apps/web/styles/docs.css b/apps/web/styles/docs.css index b1fe73e19..ec7cc776a 100644 --- a/apps/web/styles/docs.css +++ b/apps/web/styles/docs.css @@ -666,7 +666,7 @@ code.language-html .token.comment { @apply text-gray-500; } - :not(.light) & .code-responsive-wrapper { + .code-responsive-wrapper { background-color: #111827; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fillRule='evenodd'%3E%3Cg fill='%236b7280' fill-opacity='0.4'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v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9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3Cpath d='M6 5V0H5v5H0v1h5v94h1V6h94V5H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); } diff --git a/packages/ui/src/components/Datepicker/Datepicker.spec.tsx b/packages/ui/src/components/Datepicker/Datepicker.spec.tsx index 81f5814c1..21d913a75 100644 --- a/packages/ui/src/components/Datepicker/Datepicker.spec.tsx +++ b/packages/ui/src/components/Datepicker/Datepicker.spec.tsx @@ -80,7 +80,7 @@ describe("Components / Datepicker", () => { it("should render 1990 - 2100 year range when selecting decade", async () => { const testDate = new Date(2024, 6, 20); - render(); + render(); const textBox = screen.getByRole("textbox"); await userEvent.click(textBox); @@ -96,7 +96,7 @@ describe("Components / Datepicker", () => { it("should allow selecting earlier decades when setting max date", async () => { const testDate = new Date(2024, 6, 20); - render(); + render(); const textBox = screen.getByRole("textbox"); await userEvent.click(textBox); @@ -113,7 +113,7 @@ describe("Components / Datepicker", () => { it("should disallow selecting later decades when setting max date", async () => { const testDate = new Date(2024, 6, 20); - render(); + render(); const textBox = screen.getByRole("textbox"); await userEvent.click(textBox); @@ -130,7 +130,7 @@ describe("Components / Datepicker", () => { it("should disallow selecting earlier decades when setting min date", async () => { const testDate = new Date(2024, 6, 20); - render(); + render(); const textBox = screen.getByRole("textbox"); await userEvent.click(textBox); @@ -147,7 +147,7 @@ describe("Components / Datepicker", () => { it("should allow selecting later decades when setting min date", async () => { const testDate = new Date(2024, 6, 20); - render(); + render(); const textBox = screen.getByRole("textbox"); await userEvent.click(textBox); @@ -167,7 +167,7 @@ describe("Components / Datepicker", () => { const maxDate = new Date(2030, 1, 1); const testDate = new Date(2024, 6, 1); - render(); + render(); const textBox = screen.getByRole("textbox"); await userEvent.click(textBox);