File tree Expand file tree Collapse file tree 2 files changed +15
-14
lines changed
packages/ui-top-nav-bar/src/SubNav Expand file tree Collapse file tree 2 files changed +15
-14
lines changed Original file line number Diff line number Diff line change 23
23
*/
24
24
25
25
/** @jsx jsx */
26
- import { jsx , withFunctionalStyle } from '@instructure/emotion'
26
+ import { jsx , useStyle , withFunctionalStyle } from '@instructure/emotion'
27
27
28
- import { generateStyles } from './styles'
28
+ import { generateStyle } from './styles'
29
29
import { Link } from '@instructure/ui-link'
30
30
import { SubNavProps , MenuItem } from './props'
31
31
@@ -34,11 +34,13 @@ import { SubNavProps, MenuItem } from './props'
34
34
category: components
35
35
---
36
36
**/
37
- const SubNav = ( { menuItems, styles } : SubNavProps ) => {
37
+ const SubNav = ( { menuItems } : SubNavProps ) => {
38
+ const styles = useStyle ( { generateStyle, params : { } } )
39
+
38
40
return (
39
- < div style = { styles . container } >
41
+ < div css = { styles . container } >
40
42
{ menuItems . map ( ( item : MenuItem ) => (
41
- < div style = { styles . linkContainer ( item ) } key = { item . title } >
43
+ < div css = { styles . linkContainer ( item ) } key = { item . title } >
42
44
< Link
43
45
key = { item . title }
44
46
href = { item . href }
@@ -54,9 +56,5 @@ const SubNav = ({ menuItems, styles }: SubNavProps) => {
54
56
)
55
57
}
56
58
57
- const SC : any = withFunctionalStyle ( generateStyles ) ( SubNav )
58
-
59
- SC . displayName = 'SubNav'
60
-
61
- export { SC as SubNav }
62
- export default SC
59
+ export { SubNav }
60
+ export default SubNav
Original file line number Diff line number Diff line change 21
21
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
* SOFTWARE.
23
23
*/
24
- import type { SubNavProps } from './props'
25
24
26
- const generateStyles = ( _props : SubNavProps , theme : any ) => {
25
+ import { ComponentStyle } from '@instructure/emotion'
26
+
27
+ type SubNavStyle = ComponentStyle
28
+
29
+ const generateStyle = ( theme : any , params : any ) : SubNavStyle => {
27
30
return {
28
31
container : {
29
32
marginLeft : '20px' ,
@@ -57,4 +60,4 @@ const generateStyles = (_props: SubNavProps, theme: any) => {
57
60
}
58
61
}
59
62
60
- export { generateStyles }
63
+ export { generateStyle }
You can’t perform that action at this time.
0 commit comments