mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-03 18:40:00 +08:00
fix: warning on bypass visible value in switch button (#1607)
This commit is contained in:
@@ -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',
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user