-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: integrate PrimeReact components and update styling with Tailwin…
…d CSS
- Loading branch information
Showing
5 changed files
with
126 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 +1,13 @@ | ||
@import "tailwindcss"; | ||
@layer tailwind-base, primereact, tailwind-utilities; | ||
|
||
/* IMPORTANT: In "styled" mode you must add the PrimeReact Theme here. Do NOT include in "unstyled" mode */ | ||
@import 'primereact/resources/themes/lara-light-blue/theme.css' layer(primereact); | ||
|
||
@layer tailwind-base { | ||
@tailwind base; | ||
} | ||
|
||
@layer tailwind-utilities { | ||
@tailwind components; | ||
@tailwind utilities; | ||
} |
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,7 +1,14 @@ | ||
import React from "react"; | ||
import { Button } from 'primereact/button'; | ||
import { useEffect } from "react"; | ||
|
||
const App: React.FC = () => { | ||
return "Hello, World from React!"; | ||
return ( | ||
<div className="p-4"> | ||
<h1 className="text-2xl font-bold">Hello, World from React and Tailwind CSS!</h1> | ||
<Button label="Click Me" onClick={() => alert('Hello, World!')} /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default App; |
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,16 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom/client"; | ||
import App from "./App"; | ||
import { PrimeReactProvider } from 'primereact/api'; | ||
|
||
const rootElement = document.getElementById("app"); | ||
if (rootElement) { | ||
const root = ReactDOM.createRoot(rootElement); // This is correct for React 18+ | ||
root.render( | ||
<React.StrictMode> | ||
<App /> | ||
<PrimeReactProvider> | ||
<App /> | ||
</PrimeReactProvider> | ||
</React.StrictMode> | ||
); | ||
} |