Skip to content

Commit

Permalink
feat(dropdown): remove dropdown left special style
Browse files Browse the repository at this point in the history
  • Loading branch information
uyarn committed Dec 14, 2023
1 parent d5b3cc7 commit 421fa0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
18 changes: 4 additions & 14 deletions src/dropdown/DropdownMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ReactElement, useEffect, useRef, useState } from 'react';
import classNames from 'classnames';
import throttle from 'lodash/throttle';
import { ChevronRightIcon as TdIconChevronRight, ChevronLeftIcon as TdIconChevronLeft } from 'tdesign-icons-react';
import { ChevronRightIcon as TdIconChevronRight } from 'tdesign-icons-react';
import useConfig from '../hooks/useConfig';
import { DropdownProps } from './Dropdown';
import TDivider from '../divider';
Expand All @@ -24,9 +24,8 @@ const DropdownMenu: React.FC<DropdownProps> = (props) => {
const dropdownClass = `${classPrefix}-dropdown`;
const dropdownMenuClass = `${dropdownClass}__menu`;
const [panelTopContentHeight, setPanelTopContentHeight] = useState(null);
const { ChevronRightIcon, ChevronLeftIcon } = useGlobalIcon({
const { ChevronRightIcon } = useGlobalIcon({
ChevronRightIcon: TdIconChevronRight,
ChevronLeftIcon: TdIconChevronLeft,
});

const menuRef = useRef<HTMLDivElement>();
Expand Down Expand Up @@ -89,17 +88,8 @@ const DropdownMenu: React.FC<DropdownProps> = (props) => {
isSubmenu={true}
>
<div className={`${dropdownClass}__item-content`}>
{direction === 'right' ? (
<>
<span className={`${dropdownClass}__item-text`}>{optionItem.content}</span>
<ChevronRightIcon className={`${dropdownClass}__item-direction`} size="16" />
</>
) : (
<>
<ChevronLeftIcon className={`${dropdownClass}__item-direction`} size="16" />
<span className={`${dropdownClass}__item-text`}>{optionItem.content}</span>
</>
)}
<span className={`${dropdownClass}__item-text`}>{optionItem.content}</span>
<ChevronRightIcon className={`${dropdownClass}__item-direction`} size="16" />
</div>
<div
className={classNames(`${dropdownClass}__submenu-wrapper`, {
Expand Down

0 comments on commit 421fa0e

Please sign in to comment.