File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -18,18 +18,26 @@ function NavItems() {
1818
1919 const tabs = [
2020 { id : 'projects' , label : 'Side Projects' } ,
21- { id : 'blog' , label : 'Blog' } ,
22- { id : 'research' , label : 'Research' } ,
23- { id : 'presentation' , label : 'Presentation' } ,
24- { id : 'teaching' , label : 'Teaching' } ,
21+ { id : 'blog' , label : 'Blog' , externalUrl : 'https://hariesramdhani.github.io/writing' } ,
22+ // { id: 'research', label: 'Research' },
23+ // { id: 'presentation', label: 'Presentation' },
24+ // { id: 'teaching', label: 'Teaching' },
2525 ] ;
2626
27+ const handleTabClick = ( tab : { id : string ; externalUrl ?: string } ) => {
28+ if ( tab . externalUrl ) {
29+ window . location . href = tab . externalUrl ;
30+ } else {
31+ setActiveTab ( tab . id ) ;
32+ }
33+ } ;
34+
2735 return (
2836 < div className = "flex flex-wrap gap-x-8" >
2937 { tabs . map ( ( tab ) => (
3038 < button
3139 key = { tab . id }
32- onClick = { ( ) => setActiveTab ( tab . id ) }
40+ onClick = { ( ) => handleTabClick ( tab ) }
3341 className = { `mb-5 px-2 rounded-lg ${ activeTab === tab . id ? 'bg-gray-200' : 'text-gray-400' } ` }
3442 style = { { fontSize : 24 } }
3543 >
You can’t perform that action at this time.
0 commit comments