Skip to content

Commit

Permalink
add header component
Browse files Browse the repository at this point in the history
  • Loading branch information
a-sabagh committed Jan 21, 2023
1 parent f6d10f1 commit 9bf6f3b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"mini-css-extract-plugin": "^2.7.2",
"npm": "^9.3.1",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1"
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1"
}
}
8 changes: 7 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import header from './Components/Header/Header.js'

export default class {

render(){
return 'Application'
let headerComponent = header('Rock Scissor Paper')
return (`
${headerComponent}
Application
`)
}

}
5 changes: 5 additions & 0 deletions src/Components/Header/Header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
header{
text-align: center;
border-bottom: 1px solid #eee;
margin-bottom: 1em;
}
8 changes: 8 additions & 0 deletions src/Components/Header/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import header from './Header.css'
export default (props) => {
return `
<header>
<h1>Rock Paper Scissor</h1>
</header>
`;
}
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html',
title: 'Rock Paper Scissor'
title: 'Rock Paper Scissor',
}),
new MiniCssExtractPlugin(),
]
Expand Down

0 comments on commit 9bf6f3b

Please sign in to comment.