-
-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #862 from pascalgrimaud/react-fix-styled-page
React: fix styled page
- Loading branch information
Showing
8 changed files
with
62 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 21 additions & 21 deletions
42
...generator/client/vite/react/src/main/webapp/app/common/primary/app/StyledApp.css.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
#app { | ||
font-family: Avenir, Helvetica, Arial, sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
text-align: center; | ||
color: #2c3e50; | ||
margin-top: 60px; | ||
} | ||
a { | ||
color: #42b983; | ||
} | ||
#app { | ||
font-family: Avenir, Helvetica, Arial, sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
text-align: center; | ||
color: #2c3e50; | ||
margin-top: 60px; | ||
} | ||
a { | ||
color: #64dafb; | ||
} | ||
|
||
label { | ||
margin: 0 0.5em; | ||
font-weight: bold; | ||
} | ||
label { | ||
margin: 0 0.5em; | ||
font-weight: bold; | ||
} | ||
|
||
code { | ||
background-color: #eee; | ||
padding: 2px 4px; | ||
border-radius: 4px; | ||
color: #304455; | ||
} | ||
code { | ||
background-color: #eee; | ||
padding: 2px 4px; | ||
border-radius: 4px; | ||
color: #304455; | ||
} |
60 changes: 33 additions & 27 deletions
60
...generator/client/vite/react/src/main/webapp/app/common/primary/app/StyledApp.tsx.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,41 @@ | ||
import './App.css'; | ||
|
||
function App() { | ||
return ( | ||
<div className="App"> | ||
<div id="app"> | ||
<img alt="React logo" src="/content/images/ReactLogo.png" /> | ||
<br/> | ||
<img alt="JHipster logo" src="../../../../content/images/JHipster-Lite-neon-blue.png" /> | ||
<h1> JHipster Lite Vite + React app</h1> | ||
<p> | ||
Recommended IDE setup: | ||
<a href="https://code.visualstudio.com/" target="_blank">VSCode</a> | ||
+ | ||
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a> | ||
</p> | ||
return ( | ||
<div className="App"> | ||
<div id="app"> | ||
<img alt="React logo" src="/content/images/ReactLogo.png" /> | ||
<br /> | ||
<img alt="JHipster logo" src="/content/images/JHipster-Lite-neon-blue.png" /> | ||
<h1>React + TypeScript + Vite</h1> | ||
<p> | ||
Recommended IDE setup: | ||
<a href="https://code.visualstudio.com/" target="_blank"> | ||
VSCode | ||
</a> | ||
+ | ||
<a href="https://github.com/johnsoncodehk/volar" target="_blank"> | ||
Volar | ||
</a> | ||
</p> | ||
<p> | ||
<a href="https://reactjs.org/docs/" target="_blank"> | ||
React Documentation | ||
</a> | ||
| | ||
<a href="https://reactjs.org/" target="_blank">React Official</a> | ||
</p> | ||
<p> | ||
<a href="https://vitejs.dev/guide/features.html" target="_blank" rel="noopener"> | ||
Vite Documentation | ||
</a> | ||
| | ||
<a href="https://reactjs.org/docs/" target="_blank"> | ||
React Documentation | ||
</a> | ||
</p> | ||
<p> | ||
Edit | ||
<code>src/main/webapp/app/common/primary/app/App.vue</code> to test hot module replacement. | ||
</p> | ||
</div> | ||
</div> | ||
); | ||
<p> | ||
Edit | ||
<code>src/main/webapp/app/common/primary/app/App.tsx</code> to test hot module replacement. | ||
</p> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default App; |
10 changes: 2 additions & 8 deletions
10
src/main/resources/generator/client/vite/react/src/main/webapp/app/index.css.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
body { | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', | ||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', | ||
sans-serif; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', | ||
'Helvetica Neue', sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
code { | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', | ||
monospace; | ||
} |
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 2 additions & 8 deletions
10
...rator/client/vite/react/src/test/javascript/spec/common/primary/app/App.test.tsx.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,8 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import { render } from '@testing-library/react'; | ||
import App from '@/common/primary/app/App'; | ||
|
||
describe('App tests', () => { | ||
it('renders without crashing', () => { | ||
render(<App />); | ||
}); | ||
|
||
test('renders learn react link', () => { | ||
render(<App />); | ||
const linkElement = screen.getByText("JHipster Lite Vite + React app"); | ||
expect(linkElement).toBeTruthy(); | ||
}); | ||
}) | ||
}); |