fix: warning on bypass visible value in switch button (#1607)

This commit is contained in:
Himself65
2023-03-18 01:03:32 -04:00
committed by GitHub
parent 74fc43020a
commit 37a135d49e
@@ -1,10 +1,12 @@
import { IconButton, styled } from '@affine/component'; import { IconButton, styled } from '@affine/component';
export const StyledSidebarSwitch = styled(IconButton)<{ visible: boolean }>( export const StyledSidebarSwitch = styled(IconButton, {
({ visible }) => { shouldForwardProp(propName: PropertyKey) {
return { return propName !== 'visible';
opacity: visible ? 1 : 0, },
transition: 'all 0.2s ease-in-out', })<{ visible: boolean }>(({ visible }) => {
}; return {
} opacity: visible ? 1 : 0,
); transition: 'all 0.2s ease-in-out',
};
});