This file contains hidden or 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
import { Page, Navbar, Block, theme } from "framework7-react"; | |
export default function Home() { | |
return ( | |
<Page> | |
<Navbar title="Framework7 Next.js" /> | |
<Block> | |
{theme.ios && <p>Hello to iOS user!</p>} | |
{theme.md && <p>Hello to Android user!</p>} | |
</Block> |
This file contains hidden or 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
import { Page, Navbar, Block, theme } from "framework7-react"; | |
export default function Home() { | |
return ( | |
<Page> | |
<Navbar title="Framework7 Next.js" /> | |
<Block> | |
{theme.ios && <p>Hello to iOS user!</p>} | |
{theme.md && <p>Hello to Android user!</p>} | |
</Block> |
This file contains hidden or 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
function MyApp({ Component, pageProps, userAgent }) { | |
// pass userAgent to Framework7's App component | |
return ( | |
<App | |
url={url} | |
routes={routes} | |
userAgent={userAgent} | |
> | |
{/* ... */} | |
</App> |
This file contains hidden or 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
// ... | |
// move our routes array out of component | |
const routes = [ | |
{ | |
path: '/', | |
asyncComponent: () => import('./index'), | |
}, | |
// add dynamic Framework7 route to ./blog/[postID].js page | |
{ |
This file contains hidden or 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
import { Block, Navbar, Page } from "framework7-react"; | |
export default function BlogPost(props) { | |
/* | |
we use Framework7 router and its features | |
*/ | |
const { postID, f7route } = props; | |
return ( | |
<Page> | |
<Navbar title="Post" backLink="Back" /> |
This file contains hidden or 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
import { Page, Navbar, Block } from 'framework7-react'; | |
export default function Home() { | |
return ( | |
<Page> | |
<Navbar title="Framework7 Next.js" /> | |
<Block> | |
Hello world from Next.js | |
</Block> | |
</Page> |
This file contains hidden or 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
const routes = [ | |
{ | |
path: "/", | |
asyncComponent: () => import("./index"), | |
}, | |
{ | |
path: "/about", | |
asyncComponent: () => import("./about"), | |
}, | |
{ |
This file contains hidden or 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
// Import Framework7 | |
import Framework7 from "framework7/lite-bundle"; | |
// Import Framework7-React and components | |
import Framework7React, { App, View } from "framework7-react"; | |
// Next router | |
import { useRouter } from "next/router"; | |
// Import icons and styles | |
import "framework7/framework7-bundle.css"; | |
import "framework7-icons/css/framework7-icons.css"; |
This file contains hidden or 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
import '../styles/globals.css' | |
function MyApp({ Component, pageProps }) { | |
return <Component {...pageProps} /> | |
} | |
export default MyApp |
This file contains hidden or 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
NEXT_PUBLIC_HOST=http://localhost:3000 |
NewerOlder