-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(MessageBar): delete and deprecate unused CSS animation code
- Loading branch information
1 parent
56708e0
commit ee1613c
Showing
2 changed files
with
3 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 1 addition & 41 deletions
42
...act-message-bar/library/src/components/MessageBarGroup/useMessageBarGroupStyles.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,17 @@ | ||
import { makeStyles, mergeClasses } from '@griffel/react'; | ||
import { tokens } from '@fluentui/react-theme'; | ||
import { mergeClasses } from '@griffel/react'; | ||
import type { SlotClassNames } from '@fluentui/react-utilities'; | ||
import type { MessageBarGroupSlots, MessageBarGroupState } from './MessageBarGroup.types'; | ||
|
||
export const messageBarGroupClassNames: SlotClassNames<MessageBarGroupSlots> = { | ||
root: 'fui-MessageBarGroup', | ||
}; | ||
|
||
// TODO: delete this obsolete code to save bytes? | ||
/** | ||
* Styles for the root slot | ||
*/ | ||
const useStyles = makeStyles({ | ||
base: { | ||
animationFillMode: 'forwards', | ||
animationDuration: tokens.durationNormal, | ||
}, | ||
|
||
enter: { | ||
animationName: { | ||
from: { | ||
opacity: 0, | ||
transform: 'translateY(-100%)', | ||
}, | ||
to: { | ||
opacity: 1, | ||
transform: 'translateY(0)', | ||
}, | ||
}, | ||
}, | ||
|
||
exit: { | ||
animationName: { | ||
from: { | ||
opacity: 1, | ||
}, | ||
to: { | ||
opacity: 0, | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
/** | ||
* Apply styling to the MessageBarGroup slots based on the state | ||
*/ | ||
export const useMessageBarGroupStyles_unstable = (state: MessageBarGroupState): MessageBarGroupState => { | ||
'use no memo'; | ||
|
||
const styles = useStyles(); | ||
state.root.className = mergeClasses(messageBarGroupClassNames.root, state.root.className); | ||
// TODO: delete these 2 lines to save bytes? | ||
state.enterStyles = mergeClasses(styles.base, styles.enter); | ||
state.exitStyles = mergeClasses(styles.base, styles.exit); | ||
return state; | ||
}; |