Skip to content

Commit

Permalink
Examples - Updated with-windcss example for App Router (#69365)
Browse files Browse the repository at this point in the history
This PR updates the with-windcss example to use the App Router. Here are
the changes that have been made:

- Renamed the "pages" folder to "app" folder.
- Updated the file index.tsx to page.tsx to align with App Router
- Added the layout.tsx file as part of the App Router.
- removed <Head> tag
- updated package versions

cc @samcx

---------

Co-authored-by: Sam Ko <sam@vercel.com>
  • Loading branch information
archanaagivale30 and samcx committed Aug 27, 2024
1 parent 4534458 commit 1a52d9e
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 28 deletions.
19 changes: 19 additions & 0 deletions examples/with-windicss/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import "../styles/globals.css";
import "windi.css";

export const metadata = {
title: "Create Next App",
description: "Generated by Next.js",
};

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import type { NextPage } from "next";
import Head from "next/head";
import Image from "next/image";

const Home: NextPage = () => {
export default function Home() {
return (
<div className="flex min-h-screen flex-col items-center justify-center py-2">
<Head>
<title>Create Next App</title>
<link rel="icon" href="/favicon.ico" />
</Head>

<main className="flex w-full flex-1 flex-col items-center justify-center px-20 text-center">
<h1 className="text-6xl font-bold">
Welcome to{" "}
Expand Down Expand Up @@ -81,6 +74,4 @@ const Home: NextPage = () => {
</footer>
</div>
);
};

export default Home;
}
2 changes: 1 addition & 1 deletion examples/with-windicss/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
15 changes: 8 additions & 7 deletions examples/with-windicss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
},
"dependencies": {
"next": "latest",
"react": "18.2.0",
"react-dom": "18.2.0"
"react": "18.3.1",
"react-dom": "18.3.1"
},
"devDependencies": {
"@types/node": "17.0.21",
"@types/react": "17.0.40",
"typescript": "4.6.2",
"windicss": "3.5.1",
"windicss-webpack-plugin": "1.6.7"
"@types/node": "^22.5.0",
"@types/react": "^18.3.4",
"@types/react-dom": "^18.3.0",
"typescript": "^5.5.4",
"windicss": "3.5.6",
"windicss-webpack-plugin": "1.8.0"
}
}
9 changes: 0 additions & 9 deletions examples/with-windicss/pages/_app.tsx

This file was deleted.

0 comments on commit 1a52d9e

Please sign in to comment.