Skip to content

Commit 8f47e6b

Browse files
committed
Create a simple web interface
Fixes #154 Implement a simple web interface with a blue background, a header saying "Hello World!", and an input field for the user to enter their name. * **Background Color** - Change the background color in `nodejs/axios/reactapp/src/App.css` to blue. * **Header and Input Field** - Change the header in `nodejs/axios/reactapp/src/App.js` to say "Hello World!". - Add an input field for the user to enter their name in `nodejs/axios/reactapp/src/App.js`. * **Documentation** - Add documentation for the web interface in `nodejs/axios/reactapp/README.md`. * **Unit Test** - Add a unit test for the new input field in `nodejs/axios/reactapp/src/App.test.js`. * **Tailwind CSS** - Import Tailwind CSS in `nodejs/axios/reactapp/src/index.css`. - Add Tailwind CSS configuration file `nodejs/axios/reactapp/tailwind.config.js`. - Add Tailwind CSS dependency in `package.json` and `package-lock.json`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/GitHub-BR-Work/code-examples/issues/154?shareId=XXXX-XXXX-XXXX-XXXX).
1 parent 589f109 commit 8f47e6b

File tree

9 files changed

+1441
-5
lines changed

9 files changed

+1441
-5
lines changed

nodejs/axios/reactapp/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,22 @@ This section has moved here: [https://facebook.github.io/create-react-app/docs/d
6868
### `npm run build` fails to minify
6969

7070
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
71+
72+
## Web Interface Documentation
73+
74+
This web interface has the following features:
75+
- Blue background
76+
- Header that says "Hello World!"
77+
- Input field for the user to enter their name
78+
79+
### Blue Background
80+
81+
The background color of the web interface is set to blue. This is achieved by modifying the `nodejs/axios/reactapp/src/App.css` file.
82+
83+
### Header
84+
85+
The header of the web interface displays the text "Hello World!". This is achieved by modifying the `nodejs/axios/reactapp/src/App.js` file.
86+
87+
### Input Field
88+
89+
An input field is provided for the user to enter their name. This is achieved by modifying the `nodejs/axios/reactapp/src/App.js` file.

nodejs/axios/reactapp/src/App.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515

1616
.App-header {
17-
background-color: #282c34;
17+
background-color: blue;
1818
min-height: 100vh;
1919
display: flex;
2020
flex-direction: column;

nodejs/axios/reactapp/src/App.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import './App.css'
32
import './components/ProductList'
43
import ProductList from './components/ProductList';
@@ -7,10 +6,9 @@ function App() {
76
return (
87
<div className="App">
98
<header className="App-header">
10-
11-
9+
<h1>Hello World!</h1>
10+
<input type="text" placeholder="Enter your name" />
1211
<ProductList/>
13-
1412
</header>
1513
</div>
1614
);

nodejs/axios/reactapp/src/App.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@ test('renders learn react link', () => {
66
const linkElement = screen.getByText(/learn react/i);
77
expect(linkElement).toBeInTheDocument();
88
});
9+
10+
test('renders input field', () => {
11+
render(<App />);
12+
const inputElement = screen.getByPlaceholderText(/Enter your name/i);
13+
expect(inputElement).toBeInTheDocument();
14+
});

nodejs/axios/reactapp/src/index.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import 'tailwindcss/tailwind.css';
2+
13
body {
24
margin: 0;
35
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
purge: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'],
3+
darkMode: false, // or 'media' or 'class'
4+
theme: {
5+
extend: {},
6+
},
7+
variants: {
8+
extend: {},
9+
},
10+
plugins: [],
11+
}

0 commit comments

Comments
 (0)