fix: update dropdown item text color to use theme text color for consistency; enhance ExampleItem dropdown behavior with fixed positioning (#6543)

This commit is contained in:
Abhishek S Lal
2025-12-29 19:29:53 +05:30
committed by GitHub
parent 018f39239f
commit 63d31825ff
3 changed files with 6 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ const StyledWrapper = styled.div`
}
div.dropdown-item.menu-item {
color: ${(props) => props.theme.colors.danger};
color: ${(props) => props.theme.colors.text.danger};
&:hover {
background-color: ${(props) => props.theme.colors.bg.danger};
color: white;

View File

@@ -19,8 +19,10 @@ import DeleteResponseExampleModal from './DeleteResponseExampleModal';
import GenerateCodeItem from '../GenerateCodeItem';
import toast from 'react-hot-toast';
import StyledWrapper from './StyledWrapper';
import { useSidebarAccordion } from 'components/Sidebar/SidebarAccordionContext';
const ExampleItem = ({ example, item, collection }) => {
const { dropdownContainerRef } = useSidebarAccordion();
const dispatch = useDispatch();
// Check if this example is the active tab
const activeTabUid = useSelector((state) => state.tabs?.activeTabUid);
@@ -206,6 +208,8 @@ const ExampleItem = ({ example, item, collection }) => {
ref={menuDropdownRef}
items={buildMenuItems()}
placement="bottom-start"
appendTo={dropdownContainerRef?.current || document.body}
popperOptions={{ strategy: 'fixed' }}
data-testid="response-example-menu"
>
<IconDots size={22} data-testid="response-example-menu-icon" />

View File

@@ -149,7 +149,7 @@ const Wrapper = styled.div`
}
div.dropdown-item.delete-item {
color: ${(props) => props.theme.colors.danger};
color: ${(props) => props.theme.colors.text.danger};
&:hover {
background-color: ${(props) => props.theme.colors.bg.danger} !important;
color: white;