From e738a5d932f323a6b2fcd49f85beabbe47bbbb72 Mon Sep 17 00:00:00 2001 From: Rushi Vishavadia Date: Mon, 23 Dec 2024 10:09:09 +0530 Subject: [PATCH] Prettier --- src/components/DatePicker/DatePicker.jsx | 14 +++++++------- src/components/DatePicker/RangeDatePicker.jsx | 4 ++-- src/components/Drawer.jsx | 4 +++- src/components/Search.jsx | 2 +- src/components/Sidebar/Sidebar.Link.jsx | 1 - src/icons/vite.config.js | 6 +++--- src/stories/Navigation/Sidebar.stories.js | 12 +++++++++++- src/utils/index.js | 10 +++++----- 8 files changed, 32 insertions(+), 21 deletions(-) diff --git a/src/components/DatePicker/DatePicker.jsx b/src/components/DatePicker/DatePicker.jsx index 94b825e0..5014affc 100644 --- a/src/components/DatePicker/DatePicker.jsx +++ b/src/components/DatePicker/DatePicker.jsx @@ -188,13 +188,13 @@ export const DatePicker = ({ const CaptionElement = useMemo(() => { return shouldShowYearPicker && currentMonth ? ({ date }) => ( - - ) + + ) : undefined; // Adding `handleMonthChange` causes a lot of re-renders, and closes drop-down. // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/src/components/DatePicker/RangeDatePicker.jsx b/src/components/DatePicker/RangeDatePicker.jsx index d0c5ccba..25fc54d1 100644 --- a/src/components/DatePicker/RangeDatePicker.jsx +++ b/src/components/DatePicker/RangeDatePicker.jsx @@ -34,8 +34,8 @@ const RangeDatePicker = ({ const createCaptionElement = (currentMonth, handleChange) => shouldShowYearPicker && currentMonth ? ({ date }) => ( - - ) + + ) : undefined; const CaptionStartElement = createCaptionElement(startMonth, handleStartMonthChange); diff --git a/src/components/Drawer.jsx b/src/components/Drawer.jsx index 77aa7149..63fb4a9b 100644 --- a/src/components/Drawer.jsx +++ b/src/components/Drawer.jsx @@ -80,7 +80,9 @@ export const Drawer = forwardRef( {/* eslint-disable-next-line react/jsx-max-depth */} {title} -
{content}
+
+ {content} +
{position === "left" ? : null} diff --git a/src/components/Search.jsx b/src/components/Search.jsx index 2620e105..66bfd74c 100644 --- a/src/components/Search.jsx +++ b/src/components/Search.jsx @@ -185,7 +185,7 @@ export const Search = ({ ? itemList.map((item, index) => (
  • {item === submitValueItem ? ( - isLoading ? ( + isLoading && !hasResults ? (
    diff --git a/src/components/Sidebar/Sidebar.Link.jsx b/src/components/Sidebar/Sidebar.Link.jsx index 4ab840f8..5038fa02 100644 --- a/src/components/Sidebar/Sidebar.Link.jsx +++ b/src/components/Sidebar/Sidebar.Link.jsx @@ -39,7 +39,6 @@ export const SidebarLink = ({ isActive = false, icon: Icon, children, isSubMenuI {isSubMenuItem ? null : } - ); }; diff --git a/src/icons/vite.config.js b/src/icons/vite.config.js index 3a446dda..70efe399 100644 --- a/src/icons/vite.config.js +++ b/src/icons/vite.config.js @@ -12,12 +12,12 @@ export default defineConfig({ entry: path.resolve(__dirname, "./index.js"), name: "XolaIcons", fileName: (format) => `icons.${format}.js`, - formats: ["es"] + formats: ["es"], }, rollupOptions: { // Make sure none of the dependencies are bundled. external: dependencies, - } - } + }, + }, }); diff --git a/src/stories/Navigation/Sidebar.stories.js b/src/stories/Navigation/Sidebar.stories.js index 056b6518..62efc4eb 100644 --- a/src/stories/Navigation/Sidebar.stories.js +++ b/src/stories/Navigation/Sidebar.stories.js @@ -1,5 +1,15 @@ import React, { useState } from "react"; -import { AnnounceIcon, CheckIcon, HelpCenterIcon, LogoutIcon, PiggyBankIcon, PolicyIcon, Sidebar, StarIcon, UserIcon } from "../.."; +import { + AnnounceIcon, + CheckIcon, + HelpCenterIcon, + LogoutIcon, + PiggyBankIcon, + PolicyIcon, + Sidebar, + StarIcon, + UserIcon, +} from "../.."; const SidebarStories = { title: "Navigation/Sidebar", diff --git a/src/utils/index.js b/src/utils/index.js index 32b86ad8..287f46c4 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,5 +1,5 @@ -export * from "./avatar.js" -export * from "./currency.js" -export * from "./date.js" -export * from "./numbers.js" -export * from "./phone.js" +export * from "./avatar.js"; +export * from "./currency.js"; +export * from "./date.js"; +export * from "./numbers.js"; +export * from "./phone.js";