forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
react-examples - Updates styles from makeStylesCompat to makeStyles (m…
…icrosoft#17522) * react-examples - Updates styles from makeStylesCompat to makeStyle * Change files
- Loading branch information
1 parent
c12b006
commit 097a7c3
Showing
6 changed files
with
149 additions
and
154 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-examples-98100a6e-20e0-4f27-a6ac-b2f144542ef6.json
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "react-examples - Updates styles from makeStylesCompat to makeStyle", | ||
"packageName": "@fluentui/react-examples", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
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
52 changes: 23 additions & 29 deletions
52
packages/react-examples/src/react-avatar/utils/StoryExample.tsx
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,32 +1,26 @@ | ||
import * as React from 'react'; | ||
import { makeStylesCompat } from '@fluentui/react-make-styles'; | ||
import { makeStyles } from '@fluentui/react-make-styles'; | ||
|
||
const useStoryExampleRoot = makeStylesCompat([ | ||
[ | ||
null, | ||
theme => ({ | ||
padding: '10px', | ||
fontFamily: theme.global.type.fontFamilies.base, | ||
color: theme.alias.color.neutral.neutralForeground1, | ||
background: theme.alias.color.neutral.neutralBackground1, | ||
}), | ||
], | ||
]); | ||
const useStyles = makeStyles({ | ||
root: theme => ({ | ||
padding: '10px', | ||
fontFamily: theme.global.type.fontFamilies.base, | ||
color: theme.alias.color.neutral.neutralForeground1, | ||
background: theme.alias.color.neutral.neutralBackground1, | ||
}), | ||
content: { | ||
display: 'flex', | ||
flexWrap: 'wrap', | ||
'> *': { margin: '4px' }, | ||
}, | ||
}); | ||
|
||
const useStoryExampleContent = makeStylesCompat([ | ||
[ | ||
null, | ||
{ | ||
display: 'flex', | ||
flexWrap: 'wrap', | ||
'> *': { margin: '4px' }, | ||
}, | ||
], | ||
]); | ||
|
||
export const StoryExample = ({ title, children }: React.PropsWithChildren<{ title: string }>) => ( | ||
<div className={useStoryExampleRoot({})}> | ||
<h2>{title}</h2> | ||
<div className={useStoryExampleContent({})}>{children}</div> | ||
</div> | ||
); | ||
export const StoryExample = ({ title, children }: React.PropsWithChildren<{ title: string }>) => { | ||
const styles = useStyles(); | ||
return ( | ||
<div className={styles.root}> | ||
<h2>{title}</h2> | ||
<div className={styles.content}>{children}</div> | ||
</div> | ||
); | ||
}; |
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
55 changes: 22 additions & 33 deletions
55
packages/react-examples/src/react-make-styles/MakeStylesCompat/Basic.stories.tsx
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
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