Skip to content

Commit

Permalink
[Fix]: added the darktheme support for Action Column in Alerts Listin…
Browse files Browse the repository at this point in the history
…g Table. (#3844)

* refactor: added the darktheme support

* fix: typo

---------

Co-authored-by: Ankit Nayan <[email protected]>
  • Loading branch information
Rajat Dabade and ankitnayan authored Oct 31, 2023
1 parent 3341cb7 commit eddb607
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions frontend/src/components/DropDown/DropDown.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
color: #fff;
}

.Dropdown-button--dark {
color: #000;
}

.Dropdown-icon {
font-size: 1.2rem;
}
5 changes: 4 additions & 1 deletion frontend/src/components/DropDown/DropDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import './DropDown.styles.scss';

import { EllipsisOutlined } from '@ant-design/icons';
import { Button, Dropdown, MenuProps, Space } from 'antd';
import { useIsDarkMode } from 'hooks/useDarkMode';

function DropDown({ element }: { element: JSX.Element[] }): JSX.Element {
const isDarkMode = useIsDarkMode();

const items: MenuProps['items'] = element.map(
(e: JSX.Element, index: number) => ({
label: e,
Expand All @@ -15,7 +18,7 @@ function DropDown({ element }: { element: JSX.Element[] }): JSX.Element {
<Dropdown menu={{ items }} className="Dropdown-container">
<Button
type="link"
className="Dropdown-button"
className={!isDarkMode ? 'Dropdown-button--dark' : 'Dropdown-button'}
onClick={(e): void => e.preventDefault()}
>
<Space>
Expand Down

0 comments on commit eddb607

Please sign in to comment.