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 2323 */
2424
2525/** @jsx jsx */
26- import { jsx , withFunctionalStyle } from '@instructure/emotion'
26+ import { jsx , useStyle , withFunctionalStyle } from '@instructure/emotion'
2727
28- import { generateStyles } from './styles'
28+ import { generateStyle } from './styles'
2929import { Link } from '@instructure/ui-link'
3030import { SubNavProps , MenuItem } from './props'
3131
@@ -34,11 +34,13 @@ import { SubNavProps, MenuItem } from './props'
3434category: components
3535---
3636 **/
37- const SubNav = ( { menuItems, styles } : SubNavProps ) => {
37+ const SubNav = ( { menuItems } : SubNavProps ) => {
38+ const styles = useStyle ( { generateStyle, params : { } } )
39+
3840 return (
39- < div style = { styles . container } >
41+ < div css = { styles . container } >
4042 { menuItems . map ( ( item : MenuItem ) => (
41- < div style = { styles . linkContainer ( item ) } key = { item . title } >
43+ < div css = { styles . linkContainer ( item ) } key = { item . title } >
4244 < Link
4345 key = { item . title }
4446 href = { item . href }
@@ -54,9 +56,5 @@ const SubNav = ({ menuItems, styles }: SubNavProps) => {
5456 )
5557}
5658
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 2121 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222 * SOFTWARE.
2323 */
24- import type { SubNavProps } from './props'
2524
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 => {
2730 return {
2831 container : {
2932 marginLeft : '20px' ,
@@ -57,4 +60,4 @@ const generateStyles = (_props: SubNavProps, theme: any) => {
5760 }
5861}
5962
60- export { generateStyles }
63+ export { generateStyle }
You can’t perform that action at this time.
0 commit comments