From 8dea9e9242aca8bf003a7c2f69c96abafbf77e6d Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Mon, 10 Apr 2023 16:29:48 +0700 Subject: page loader --- src/core/components/elements/Link/Link.jsx | 8 -------- 1 file changed, 8 deletions(-) (limited to 'src/core/components/elements') diff --git a/src/core/components/elements/Link/Link.jsx b/src/core/components/elements/Link/Link.jsx index 360444a6..b2dbd02f 100644 --- a/src/core/components/elements/Link/Link.jsx +++ b/src/core/components/elements/Link/Link.jsx @@ -1,14 +1,6 @@ import NextLink from 'next/link' -import { useRouter } from 'next/router' -import { useEffect } from 'react' const Link = ({ children, ...props }) => { - const router = useRouter() - - useEffect(() => { - router.events.on('routeChangeComplete', () => window.scrollTo({ top: 0, behavior: 'smooth' })) - }, [router]) - return ( Date: Mon, 10 Apr 2023 16:49:16 +0700 Subject: fix --- src/core/components/elements/Spinner/LogoSpinner.jsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/core/components/elements/Spinner/LogoSpinner.jsx (limited to 'src/core/components/elements') diff --git a/src/core/components/elements/Spinner/LogoSpinner.jsx b/src/core/components/elements/Spinner/LogoSpinner.jsx new file mode 100644 index 00000000..73b84e84 --- /dev/null +++ b/src/core/components/elements/Spinner/LogoSpinner.jsx @@ -0,0 +1,15 @@ +import Image from 'next/image' +import IndoteknikLogo from '@/images/LOGO-INDOTEKNIK-GEAR.png' + +const LogoSpinner = ({ ...props }) => ( + Indoteknik Logo +) + +export default LogoSpinner -- cgit v1.2.3 From 92c2a229d9c9b510d71b928978872a8b107e9d5a Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 11 Apr 2023 09:47:25 +0700 Subject: Documentation and refactor code --- src/core/components/elements/Alert/Alert.jsx | 10 ++++++++ src/core/components/elements/Appbar/Appbar.jsx | 29 +++++++++------------- src/core/components/elements/Divider/Divider.jsx | 8 ++++++ src/core/components/elements/Image/Image.jsx | 8 ++++++ src/core/components/elements/Link/Link.jsx | 8 ++++++ .../components/elements/Navbar/NavbarMobile.jsx | 12 ++------- src/core/components/elements/Navbar/Search.jsx | 10 ++------ .../components/elements/Pagination/Pagination.js | 5 +--- .../components/elements/Skeleton/BrandSkeleton.jsx | 5 +--- .../components/elements/Skeleton/ImageSkeleton.jsx | 10 ++------ .../elements/Skeleton/ProductCardSkeleton.jsx | 5 +--- 11 files changed, 55 insertions(+), 55 deletions(-) (limited to 'src/core/components/elements') diff --git a/src/core/components/elements/Alert/Alert.jsx b/src/core/components/elements/Alert/Alert.jsx index 695be8a3..cf84b591 100644 --- a/src/core/components/elements/Alert/Alert.jsx +++ b/src/core/components/elements/Alert/Alert.jsx @@ -1,3 +1,13 @@ +/** + * The Alert component is used to display different types of alerts or notifications + * with different styles based on the provided type prop. + * + * @param {Object} props - Props received by the component. + * @param {ReactNode} props.children - The content to be displayed inside the alert. + * @param {string} props.className - Additional CSS class names for the alert. + * @param {string} props.type - The type of the alert ('info', 'success', or 'warning'). + * @returns {JSX.Element} - Rendered Alert component. + */ const Alert = ({ children, className, type }) => { let typeClass = '' switch (type) { diff --git a/src/core/components/elements/Appbar/Appbar.jsx b/src/core/components/elements/Appbar/Appbar.jsx index 098d0a33..f1456a7c 100644 --- a/src/core/components/elements/Appbar/Appbar.jsx +++ b/src/core/components/elements/Appbar/Appbar.jsx @@ -2,38 +2,33 @@ import { useRouter } from 'next/router' import Link from '../Link/Link' import { HomeIcon, Bars3Icon, ShoppingCartIcon, ChevronLeftIcon } from '@heroicons/react/24/outline' +/** + * The AppBar component is a navigation component used to display a header or toolbar + * in a web application. + * + * @param {Object} props - Props received by the component. + * @param {string} props.title - The title to be displayed on the AppBar. + * @returns {JSX.Element} - Rendered AppBar component. + */ const AppBar = ({ title }) => { const router = useRouter() return (