Skip to content

Commit 7008d3c

Browse files
fixed expend table button icon on toggle state
1 parent b0ac839 commit 7008d3c

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/ui/layouts/pipelines/Pipelines/List/getHeaderCols.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ export const GetHeaderCols = ({
6868
}}
6969
>
7070
<FlexBox justifyContent="center">
71-
<icons.chevronDown color={iconColors.grey} size={iconSizes.sm} />
71+
{openPipelineIds.indexOf(pipeline.id) === -1 ? (
72+
<icons.rightArrow color={iconColors.grey} size={iconSizes.md} />
73+
) : (
74+
<icons.chevronDown color={iconColors.grey} size={iconSizes.md} />
75+
)}
7276
</FlexBox>
7377
</LinkBox>
7478
),

src/ui/layouts/stacks/Stacks/List/getHeaderCols.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import _ from 'lodash';
2-
import React from 'react';
2+
import React, { useState } from 'react';
33
import ReactTooltip from 'react-tooltip';
44
import { iconColors, iconSizes, ID_MAX_LENGTH } from '../../../../../constants';
55
import {
@@ -48,12 +48,15 @@ export const GetHeaderCols = ({
4848
activeSortingDirection,
4949
filteredStacks,
5050
});
51+
52+
const [toggle, setToggle] = useState(false);
5153
return [
5254
{
5355
width: '3%',
5456
renderRow: (stack: TStack) => (
5557
<LinkBox
5658
onClick={(e: Event) => {
59+
setToggle(!toggle);
5760
e.stopPropagation();
5861
if (openStackIds.indexOf(stack.id) === -1) {
5962
setOpenStackIds([...openStackIds, stack.id]);
@@ -65,7 +68,11 @@ export const GetHeaderCols = ({
6568
}}
6669
>
6770
<FlexBox justifyContent="center">
68-
<icons.rightArrow color={iconColors.grey} size={iconSizes.md} />
71+
{openStackIds.indexOf(stack.id) === -1 ? (
72+
<icons.rightArrow color={iconColors.grey} size={iconSizes.md} />
73+
) : (
74+
<icons.chevronDown color={iconColors.grey} size={iconSizes.md} />
75+
)}
6976
</FlexBox>
7077
</LinkBox>
7178
),

0 commit comments

Comments
 (0)