11import React from 'react'
2- import type { IconProps } from '@primer/octicons-react'
32import {
43 CodeIcon ,
54 IssueOpenedIcon ,
@@ -23,7 +22,6 @@ import {
2322import type { Meta } from '@storybook/react-vite'
2423import { UnderlineNav } from './index'
2524import { Avatar , Button , Heading , Link , Text , StateLabel , BranchName } from '..'
26- import Octicon from '../Octicon'
2725import classes from './UnderlineNav.examples.stories.module.css'
2826
2927export default {
@@ -49,33 +47,33 @@ export const PullRequestPage = () => {
4947 </ div >
5048 </ div >
5149 < UnderlineNav aria-label = "Pull Request" >
52- < UnderlineNav . Item icon = { CommentDiscussionIcon } counter = "0" aria-current = "page" >
50+ < UnderlineNav . Item leadingVisual = { < CommentDiscussionIcon /> } counter = "0" aria-current = "page" >
5351 Conversation
5452 </ UnderlineNav . Item >
55- < UnderlineNav . Item counter = { 3 } icon = { GitCommitIcon } >
53+ < UnderlineNav . Item counter = { 3 } leadingVisual = { < GitCommitIcon /> } >
5654 Commits
5755 </ UnderlineNav . Item >
58- < UnderlineNav . Item counter = { 7 } icon = { ChecklistIcon } >
56+ < UnderlineNav . Item counter = { 7 } leadingVisual = { < ChecklistIcon /> } >
5957 Checks
6058 </ UnderlineNav . Item >
61- < UnderlineNav . Item counter = { 4 } icon = { FileDiffIcon } >
59+ < UnderlineNav . Item counter = { 4 } leadingVisual = { < FileDiffIcon /> } >
6260 Files Changes
6361 </ UnderlineNav . Item >
6462 </ UnderlineNav >
6563 </ div >
6664 )
6765}
6866
69- const items : { navigation : string ; icon : React . FC < IconProps > ; counter ?: number | string ; href ?: string } [ ] = [
70- { navigation : 'Code' , icon : CodeIcon , href : '#code' } ,
71- { navigation : 'Issues' , icon : IssueOpenedIcon , counter : '12K' , href : '#issues' } ,
72- { navigation : 'Pull Requests' , icon : GitPullRequestIcon , counter : 13 , href : '#pull-requests' } ,
73- { navigation : 'Discussions' , icon : CommentDiscussionIcon , counter : 5 , href : '#discussions' } ,
74- { navigation : 'Actions' , icon : PlayIcon , counter : 4 , href : '#actions' } ,
75- { navigation : 'Projects' , icon : ProjectIcon , counter : 9 , href : '#projects' } ,
76- { navigation : 'Insights' , icon : GraphIcon , counter : '0' , href : '#insights' } ,
77- { navigation : 'Settings' , icon : GearIcon , counter : 10 , href : '#settings' } ,
78- { navigation : 'Security' , icon : ShieldLockIcon , href : '#security' } ,
67+ const items : { navigation : string ; icon : React . ReactElement ; counter ?: number | string ; href ?: string } [ ] = [
68+ { navigation : 'Code' , icon : < CodeIcon /> , href : '#code' } ,
69+ { navigation : 'Issues' , icon : < IssueOpenedIcon /> , counter : '12K' , href : '#issues' } ,
70+ { navigation : 'Pull Requests' , icon : < GitPullRequestIcon /> , counter : 13 , href : '#pull-requests' } ,
71+ { navigation : 'Discussions' , icon : < CommentDiscussionIcon /> , counter : 5 , href : '#discussions' } ,
72+ { navigation : 'Actions' , icon : < PlayIcon /> , counter : 4 , href : '#actions' } ,
73+ { navigation : 'Projects' , icon : < ProjectIcon /> , counter : 9 , href : '#projects' } ,
74+ { navigation : 'Insights' , icon : < GraphIcon /> , counter : '0' , href : '#insights' } ,
75+ { navigation : 'Settings' , icon : < GearIcon /> , counter : 10 , href : '#settings' } ,
76+ { navigation : 'Security' , icon : < ShieldLockIcon /> , href : '#security' } ,
7977]
8078
8179export const ReposPage = ( ) => {
@@ -86,7 +84,7 @@ export const ReposPage = () => {
8684 { items . map ( ( item , index ) => (
8785 < UnderlineNav . Item
8886 key = { item . navigation }
89- icon = { item . icon }
87+ leadingVisual = { item . icon }
9088 aria-current = { index === selectedIndex ? 'page' : undefined }
9189 onSelect = { event => {
9290 event . preventDefault ( )
@@ -102,13 +100,13 @@ export const ReposPage = () => {
102100 )
103101}
104102
105- const profileItems : { navigation : string ; icon : React . FC < IconProps > ; counter ?: number | string ; href ?: string } [ ] = [
106- { navigation : 'Overview' , icon : BookIcon , href : '#overview' } ,
107- { navigation : 'Repositories' , icon : RepoIcon , counter : '12' , href : '#repositories' } ,
108- { navigation : 'Projects' , icon : ProjectIcon , counter : 3 , href : '#projects' } ,
109- { navigation : 'Packages' , icon : PackageIcon , counter : '0' , href : '#packages' } ,
110- { navigation : 'Stars' , icon : StarIcon , counter : '0' , href : '#stars' } ,
111- { navigation : 'Activity' , icon : ThreeBarsIcon , counter : 67 , href : '#activity' } ,
103+ const profileItems : { navigation : string ; icon : React . ReactElement ; counter ?: number | string ; href ?: string } [ ] = [
104+ { navigation : 'Overview' , icon : < BookIcon /> , href : '#overview' } ,
105+ { navigation : 'Repositories' , icon : < RepoIcon /> , counter : '12' , href : '#repositories' } ,
106+ { navigation : 'Projects' , icon : < ProjectIcon /> , counter : 3 , href : '#projects' } ,
107+ { navigation : 'Packages' , icon : < PackageIcon /> , counter : '0' , href : '#packages' } ,
108+ { navigation : 'Stars' , icon : < StarIcon /> , counter : '0' , href : '#stars' } ,
109+ { navigation : 'Activity' , icon : < ThreeBarsIcon /> , counter : 67 , href : '#activity' } ,
112110]
113111
114112export const ProfilePage = ( ) => {
@@ -120,7 +118,7 @@ export const ProfilePage = () => {
120118 { profileItems . map ( ( item , index ) => (
121119 < UnderlineNav . Item
122120 key = { item . navigation }
123- icon = { item . icon }
121+ leadingVisual = { item . icon }
124122 aria-current = { index === selectedIndex ? 'page' : undefined }
125123 onSelect = { event => {
126124 event . preventDefault ( )
@@ -151,7 +149,7 @@ export const ProfilePage = () => {
151149 < div className = { classes . ProfileEditSection } >
152150 < Button block > Edit Profile</ Button >
153151 < div className = { classes . ProfileFollowRow } >
154- < Octicon icon = { PeopleIcon } size = { 16 } className = { classes . ProfileFollowerIcon } />
152+ < PeopleIcon size = { 16 } className = { classes . ProfileFollowerIcon } />
155153 < Link href = "https://github.com" muted className = { classes . ProfileFollowerCount } >
156154 47 Followers
157155 </ Link >
0 commit comments