From a9d284196cf3544503655abff768d08e8b5c4a62 Mon Sep 17 00:00:00 2001 From: literat Date: Mon, 11 Sep 2023 17:15:13 +0200 Subject: [PATCH 1/2] Refactor(web-react): Use class name prefix for utilities and helpers refs #DS-926 --- .../src/components/Breadcrumbs/Breadcrumbs.tsx | 15 ++++++++++----- .../FileUploader/FileUploaderAttachment.tsx | 4 ++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/web-react/src/components/Breadcrumbs/Breadcrumbs.tsx b/packages/web-react/src/components/Breadcrumbs/Breadcrumbs.tsx index 13bed3fbec..de13305702 100644 --- a/packages/web-react/src/components/Breadcrumbs/Breadcrumbs.tsx +++ b/packages/web-react/src/components/Breadcrumbs/Breadcrumbs.tsx @@ -1,10 +1,11 @@ -import React, { ElementType } from 'react'; import classNames from 'classnames'; -import { useBreadcrumbsStyleProps } from './useBreadcrumbsStyleProps'; -import { SpiritBreadcrumbsProps } from '../../types'; +import React, { ElementType } from 'react'; +import { useClassNamePrefix } from '../../hooks'; import { useStyleProps } from '../../hooks/styleProps'; +import { SpiritBreadcrumbsProps } from '../../types'; import { Icon } from '../Icon'; import { Link } from '../Link'; +import { useBreadcrumbsStyleProps } from './useBreadcrumbsStyleProps'; const defaultProps = { items: [], @@ -15,6 +16,10 @@ export const Breadcrumbs = (props: SpiritBreadcru const { classProps, props: modifiedProps } = useBreadcrumbsStyleProps({ ...restProps }); const { styleProps, props: otherProps } = useStyleProps(modifiedProps); + const displayTabletNoneClassName = useClassNamePrefix('d-tablet-none'); + const displayNoneClassName = useClassNamePrefix('d-none'); + const displayTabletFlexClassName = useClassNamePrefix('d-tablet-flex'); + const isLast = (index: number, itemsCount: number) => { return index === itemsCount - 1; }; @@ -31,14 +36,14 @@ export const Breadcrumbs = (props: SpiritBreadcru items?.map((item, index) => ( {index === items.length - 2 && goBackTitle && ( -
  • +
  • {goBackTitle}
  • )} -
  • +
  • {index !== 0 && } {