Skip to content

Commit

Permalink
Map page build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nofurtherinformation committed Mar 20, 2024
1 parent 2d01e47 commit 5f4a732
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 37 deletions.
20 changes: 4 additions & 16 deletions app/map/page.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
import Map from "components/Map/Map"
import Map from "components/Pages/Map"

export const metadata = {
title: "Next.js Enterprise Boilerplate",
twitter: {
card: "summary_large_image",
},
openGraph: {
url: "https://next-enterprise.vercel.app/",
images: [
{
width: 1200,
height: 630,
url: "https://raw.githubusercontent.com/Blazity/next-enterprise/main/.github/assets/project-logo.png",
},
],
},
title: "Feeding Fairness Map",
}

const ISCLIENT = typeof window !== "undefined"
export default function Web() {
return (
<>
<Map/>
{ISCLIENT && <Map/>}
</>
)
}
21 changes: 4 additions & 17 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
import { client } from 'tina/__generated__/client'
import Home from "components/Pages/Home";
import { getMdxContent } from "hooks/useMdxContent";

export const metadata = {
title: "Feeding Fairness",
twitter: {
card: "summary_large_image",
},
openGraph: {
url: "https://rgdv.vercel.app",
images: [
{
width: 1200,
height: 630,
url: "https://raw.githubusercontent.com/Blazity/next-enterprise/main/.github/assets/project-logo.png",
},
],
},
title: "Feeding Fairness"
}
type HomePageContent = {
sections: Array<{
Expand All @@ -25,10 +12,10 @@ type HomePageContent = {
}

export default async function HomePage() {
const pageInfo = await client.queries.page({ relativePath: 'home.mdx' })
const pageInfo = await getMdxContent("page", "home.mdx")
return (
<>
<Home pageInfo={pageInfo} />
{pageInfo && <Home pageInfo={pageInfo} />}
</>
)
}
10 changes: 10 additions & 0 deletions components/Pages/Map/Renderer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"use client"
import Map from "components/Map/Map"

export function Renderer() {
return (
<>
<Map/>
</>
)
}
3 changes: 3 additions & 0 deletions components/Pages/Map/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Renderer } from "./Renderer"

export default Renderer
19 changes: 19 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions public/admin/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TinaCMS</title>
</head>

<!-- if development -->
<script type="module">
import RefreshRuntime from 'http://localhost:4001/@react-refresh'
RefreshRuntime.injectIntoGlobalHook(window)
window.$RefreshReg$ = () => {}
window.$RefreshSig$ = () => (type) => type
window.__vite_plugin_react_preamble_installed__ = true
</script>
<script type="module" src="http://localhost:4001/@vite/client"></script>
<script>
function handleLoadError() {
// Assets have failed to load
document.getElementById('root').innerHTML = '<style type="text/css"> #no-assets-placeholder body { font-family: sans-serif; font-size: 16px; line-height: 1.4; color: #333; background-color: #f5f5f5; } #no-assets-placeholder { max-width: 600px; margin: 0 auto; padding: 40px; text-align: center; background-color: #fff; box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.1); } #no-assets-placeholder h1 { font-size: 24px; margin-bottom: 20px; } #no-assets-placeholder p { margin-bottom: 10px; } #no-assets-placeholder a { color: #0077cc; text-decoration: none; } #no-assets-placeholder a:hover { text-decoration: underline; } </style> <div id="no-assets-placeholder"> <h1>Failed loading TinaCMS assets</h1> <p> Your TinaCMS configuration may be misconfigured, and we could not load the assets for this page. </p> <p> Please visit <a href="https://tina.io/docs/tina-cloud/faq/#how-do-i-resolve-failed-loading-tinacms-assets-error">this doc</a> for help. </p> </div> </div>';
}
</script>
<script
type="module"
src="http://localhost:4001/src/main.tsx"
onerror="handleLoadError()"
></script>
<body class="tina-tailwind">
<div id="root"></div>
</body>
</html>
9 changes: 5 additions & 4 deletions utils/data/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const GravityNoDollar: DataConfig = {
columns: gravityColumns,
eager: true,
attribution: '',
colorScheme: 'schemePuBuGn',
colorScheme: 'schemeRdYlGn',
nBins: 9,
}

const GravityDollar: DataConfig = {
Expand All @@ -57,10 +58,10 @@ const GravityDollar: DataConfig = {
// ]
}

export const defaultData = DollarStoreHhiConfig.filename
export const defaultData = GravityNoDollar.filename

export default [
GravityDollar,
// GravityDollar,
GravityNoDollar,
DollarStoreHhiConfig
// DollarStoreHhiConfig
]

0 comments on commit 5f4a732

Please sign in to comment.