From ba413763c0216a3611e2f1b45f0c6f041639cb64 Mon Sep 17 00:00:00 2001 From: Md Ariful Islam <73895992+Arifulislam5577@users.noreply.github.com> Date: Wed, 27 Dec 2023 20:43:25 +0600 Subject: [PATCH] Documentation Page Design Updated. (#116) --- app/components/CodePreview.tsx | 10 +- app/components/Navbar.tsx | 52 +++--- app/docs.css | 22 +++ .../variant/DefaultNotification.tsx | 3 +- .../variant/NotificationWithIcon.tsx | 2 +- app/docs/layout.tsx | 154 +++++++++--------- app/globals.css | 13 +- app/page.tsx | 6 +- mdx-components.tsx | 2 +- 9 files changed, 148 insertions(+), 116 deletions(-) diff --git a/app/components/CodePreview.tsx b/app/components/CodePreview.tsx index b8dae092..a26c9944 100644 --- a/app/components/CodePreview.tsx +++ b/app/components/CodePreview.tsx @@ -15,16 +15,16 @@ interface CodePreviewProps { const CodePreview = ({ children, code, github }: CodePreviewProps) => { const [active, setActive] = useState(0) const { copy, copyToClipboard } = useCopy() - const githubUrl = `https://github.com/StaticMania/keep-react/tree/main/src/components/${github}` + const githubUrl = `https://github.com/StaticMania/keep-react/tree/main/app/src/components/${github}` return (
-
+
@@ -81,7 +81,7 @@ const CodePreview = ({ children, code, github }: CodePreviewProps) => {
) : ( -
+
{children}
)} diff --git a/app/components/Navbar.tsx b/app/components/Navbar.tsx index 1863bfe5..1d6c2b45 100644 --- a/app/components/Navbar.tsx +++ b/app/components/Navbar.tsx @@ -6,7 +6,7 @@ import { usePathname } from 'next/navigation' import { List, MagnifyingGlass, X } from 'phosphor-react' import Search from './Search' import { gettingStartedRoutes, navbarRoutes, routes } from '../../routes/routes' -import { Accordion } from '../src' +import { Accordion, Typography } from '../src' const Navbar = () => { const [active, setActive] = useState(false) @@ -143,77 +143,71 @@ const Navbar = () => { active ? 'translate-x-0' : 'translate-x-full' }`}>
- + - Quick Link + Quick Link -
    + {navbarRoutes.map((route) => ( -
  • + {route.name} -
  • +
    ))} -
+
- + Getting Started -
    + {gettingStartedRoutes.map((route) => ( -
  • + {route.name} -
  • +
    ))} -
+
- Components + Components -
    + {routes.map((route) => ( -
  • + {route.name} -
  • +
    ))} -
+
diff --git a/app/docs.css b/app/docs.css index 417aba24..10366297 100644 --- a/app/docs.css +++ b/app/docs.css @@ -63,7 +63,12 @@ @apply border-l-metal-900 text-metal-900 transition-colors duration-300 hover:text-metal-900 active:text-metal-900; } +#componentListSidebar::-webkit-scrollbar { + display: none; +} + #linkPage::-webkit-scrollbar { + display: none; width: 4px !important; } #linkPage::-webkit-scrollbar-track { @@ -74,6 +79,23 @@ background-color: #e9eff6 !important; } +body::-webkit-scrollbar { + width: 8px !important; +} +body::-webkit-scrollbar-track { + background-color: transparent !important; +} +body::-webkit-scrollbar-thumb { + border-radius: 3px; + background-color: #333 !important; +} + .tabActive { @apply border-b-metal-900 !text-metal-900; } + +.docs-page { + position: relative; + border-radius: 16px; + background-image: linear-gradient(0deg, #f2f5ff 0%, #fff 100%); +} diff --git a/app/docs/components/notification/variant/DefaultNotification.tsx b/app/docs/components/notification/variant/DefaultNotification.tsx index e20beeb7..8f88fc26 100644 --- a/app/docs/components/notification/variant/DefaultNotification.tsx +++ b/app/docs/components/notification/variant/DefaultNotification.tsx @@ -8,12 +8,13 @@ const DefaultNotification = () => { const onDismiss = () => { setShowNotification(!showNotification) } + return (
- + Can we store cookies? diff --git a/app/docs/components/notification/variant/NotificationWithIcon.tsx b/app/docs/components/notification/variant/NotificationWithIcon.tsx index 32380ad3..858adc65 100644 --- a/app/docs/components/notification/variant/NotificationWithIcon.tsx +++ b/app/docs/components/notification/variant/NotificationWithIcon.tsx @@ -14,7 +14,7 @@ const NotificationWithIcon = () => { - + diff --git a/app/docs/layout.tsx b/app/docs/layout.tsx index 2bb6391e..300eab06 100644 --- a/app/docs/layout.tsx +++ b/app/docs/layout.tsx @@ -1,7 +1,7 @@ /* eslint-disable no-undef */ 'use client' import Link from 'next/link' -import { Accordion } from '../src' +import { Accordion, Typography } from '../src' import { ReactNode, useEffect, useState } from 'react' import { usePathname } from 'next/navigation' import { gettingStartedRoutes, routes } from '../../routes/routes' @@ -15,7 +15,6 @@ const DocsLayout = ({ children }: { children: ReactNode }) => { const pathname = usePathname() const [activeSection, setActiveSection] = useState('') const [allSection, setAllSection] = useState | []>([]) - const [tableOfContents, setTableOfContents] = useState(null) // get the table of contents @@ -54,7 +53,6 @@ const DocsLayout = ({ children }: { children: ReactNode }) => { }) } - // On this page active section html const innerHtml = tableOfContents?.innerHTML useEffect(() => { @@ -80,81 +78,87 @@ const DocsLayout = ({ children }: { children: ReactNode }) => { }, [newIdArr]) return ( -
- -
-
{children}
-
- +
+ +
+
) } diff --git a/app/globals.css b/app/globals.css index 7c49c413..b43563a2 100644 --- a/app/globals.css +++ b/app/globals.css @@ -5,8 +5,9 @@ html { } body { - background-color: #f9fafb; + background-color: #f2f5ff; font-family: var(--font-inter), sans-serif; + @apply bg-white md:bg-primary-25; } .hero-text { @@ -79,3 +80,13 @@ pre::-webkit-scrollbar-thumb { border-radius: 10px; background-color: #d7dfe9; } + +.keep-shadow { + box-shadow: + 0px 1px 2px 0px rgba(45, 54, 67, 0.05), + 0px -4px 0px 0px rgba(215, 223, 233, 0.5) inset, + 0px -3px 0px 0px #f0f4f9 inset; + border: 1px solid #d7dfe9; + border-radius: 16px; + background: #fff; +} diff --git a/app/page.tsx b/app/page.tsx index 60a6a6e0..ad5e9cb7 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -198,7 +198,7 @@ const FAQ = () => {
- + {faqs.map((faq) => ( @@ -214,7 +214,7 @@ const FAQ = () => {
- + {faqs.slice(0, 3).map((faq) => ( @@ -229,7 +229,7 @@ const FAQ = () => {
- + {faqs.slice(3, 6).map((faq) => ( diff --git a/mdx-components.tsx b/mdx-components.tsx index 4ea8da02..7316427d 100644 --- a/mdx-components.tsx +++ b/mdx-components.tsx @@ -5,7 +5,7 @@ export const useMDXComponents: (components: MDXComponents) => MDXComponents = (c return { h2: (props) => (

{props.children}