File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import Navbar from "./componets/Navbar";
44function App ( ) {
55 return (
66 < >
7- < Navbar />
7+ < Navbar title = "Text Utils" aboutText = "About Text Utils" />
88 </ >
99 ) ;
1010}
Original file line number Diff line number Diff line change 11import React from "react" ;
2+ import PropTypes from "prop-types" ;
23
3- export default function Navbar ( ) {
4+ Navbar . propTypes = {
5+ title : PropTypes . string . isRequired ,
6+ aboutText : PropTypes . string ,
7+ } ;
8+
9+ Navbar . defaultProps = {
10+ title : "Set Title Here" ,
11+ aboutText : "About Text Here" ,
12+ } ;
13+
14+ export default function Navbar ( props ) {
415 return (
516 < nav className = "navbar navbar-expand-lg navbar-light bg-light" >
617 < div className = "container-fluid" >
718 < a className = "navbar-brand" href = "/" >
8- Navbar
19+ { props . title }
920 </ a >
1021 < button
1122 className = "navbar-toggler"
@@ -31,7 +42,7 @@ export default function Navbar() {
3142 </ li >
3243 < li className = "nav-item" >
3344 < a className = "nav-link" href = "/" >
34- About
45+ { props . aboutText }
3546 </ a >
3647 </ li >
3748 </ ul >
You can’t perform that action at this time.
0 commit comments