Skip to content

Commit

Permalink
React: improve generated template
Browse files Browse the repository at this point in the history
  • Loading branch information
qmonmert committed May 5, 2024
1 parent ea0c9c1 commit 3077a3f
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

public class ReactJwtModuleFactory {

private static final String APP = "<App />";

private static final JHipsterSource ROOT = from("client/react");

private static final JHipsterSource SOURCE = from("client/react/src");
Expand Down Expand Up @@ -85,8 +87,9 @@ public JHipsterModule buildModule(JHipsterModuleProperties properties) {
.and()
.in(path("src/main/webapp/app/index.tsx"))
.add(lineBeforeText("import { createRoot } from 'react-dom/client';"), "import { NextUIProvider } from '@nextui-org/react';")
.add(lineBeforeText("<App />"), "<NextUIProvider>")
.add(lineBeforeText("</React.StrictMode>"), "</NextUIProvider>")
.add(lineBeforeText(APP), properties.indentation().times(2) + "<NextUIProvider>")
.add(lineBeforeText("</React.StrictMode>"), properties.indentation().times(2) + "</NextUIProvider>")
.add(text(APP), properties.indentation().times(1) + APP)
.and()
.in(path("src/main/webapp/app/index.css"))
.add(lineBeforeText("body {"), "@tailwind base;" + LINE_BREAK + "@tailwind components;" + LINE_BREAK + "@tailwind utilities;" + LINE_BREAK)
Expand Down

0 comments on commit 3077a3f

Please sign in to comment.