Skip to content

Commit

Permalink
improve folder icon styles
Browse files Browse the repository at this point in the history
  • Loading branch information
devcatalin committed Aug 10, 2021
1 parent d3946ab commit 74ad567
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,23 @@ const StyledContent = styled(Content)`
overflow-y: clip;
`;

const MenuIcon = (props: {icon: React.ElementType; active: boolean; isSelected: boolean}) => {
const {icon: IconComponent, active, isSelected} = props;
const MenuIcon = (props: {
icon: React.ElementType;
active: boolean;
isSelected: boolean;
style?: React.CSSProperties;
}) => {
const {icon: IconComponent, active, isSelected, style: customStyle = {}} = props;
const [isHovered, setIsHovered] = useState<boolean>(false);

const style = {
...customStyle,
fontSize: 25,
color: Colors.grey7,
};

if (isHovered || (active && isSelected)) {
style.color = Colors.whitePure;
style.color = Colors.grey400;
}

return (
Expand Down Expand Up @@ -155,6 +161,7 @@ const App = () => {
onClick={() => setActivePanes('left', 'file-explorer')}
icon={
<MenuIcon
style={{marginLeft: 4}}
icon={FolderOpenOutlined}
active={leftActive}
isSelected={leftMenuSelection === 'file-explorer'}
Expand Down

0 comments on commit 74ad567

Please sign in to comment.