Skip to content

Commit

Permalink
feat(plasma-new-hope): resolve circular dependency in Breadcrumb
Browse files Browse the repository at this point in the history
  • Loading branch information
TitanKuzmich committed Dec 22, 2024
1 parent 40612bf commit b50b34d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { HTMLAttributes, ReactNode, useState, KeyboardEvent } from 'react';

import { addSeparator } from '../../utils';
import { addSeparator } from '../../utils/addSeparator';

import { StyledHidden, StyledRoot, StyledShorter } from './BreadcrumbShorter.styles';
import { BreadcrumbShorterProps } from './BreadcrumbShorter.types';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { ReactNode } from 'react';

export const addSeparator = (items: ReactNode[], renderSeparator: ReactNode) => {
return items.flatMap((item, idx) => (idx < items.length - 1 ? [item, renderSeparator] : [item]));
};
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,3 @@ export const getRenderItems = (items: BreadcrumbsItem[], renderSeparator: ReactN

return renderItems;
};

export const addSeparator = (items: ReactNode[], renderSeparator: ReactNode) => {
return items.flatMap((item, idx) => (idx < items.length - 1 ? [item, renderSeparator] : [item]));
};

0 comments on commit b50b34d

Please sign in to comment.