I have a composed page with multiple components. Like the picture, I want to show Component B inside Component A. By default, when clicking on A, hide B and show C in the middle. After clicking again, it toggles to show B and hide C.
When C has been showing, also change the A's border color.
import React from "react";
import styled, { css } from "styled-components";
import {
ComponentA,
ComponentB,
ComponentC,
} from "~/components";
export const NewComponent: React.FC = ({
}) => {
return (
<>
<ComponentA>
<ComponentB>B</ComponentB>
<ComponentC>C</ComponentC>
</ComponentA>
</>
);
};
const ComponentA = styled()`
${({ theme }) => css`
&:active {
border-color: green;
bordor: 1px solid;
}
`}
`;
I tried to use CSS to control the border color, it works with background-color but does not work for border-color. Also, I'm not sure if CSS can control the showing between Component B and component C.
