-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat/use hypercert api to show reports on homepage #17
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
404cb1c
move HC loader to _index.tsx
CJ-Rose 1161b77
:fire: remove vite.config.ts.timestamp-1706631964230-8ff711d0ab27c.mjs
thebeyondr 1fb101c
chore: :package: Update package.json and pnpm-lock.yaml
thebeyondr 91edced
refactor: :recycle: Add and files
thebeyondr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,41 +1,53 @@ | ||
import type { MetaFunction } from "@remix-run/node"; | ||
import { json, useLoaderData } from "@remix-run/react"; | ||
import { fetchReports } from "~/server/impactReportHelpers"; | ||
import { Report } from "~/types"; | ||
|
||
export const meta: MetaFunction = () => { | ||
return [ | ||
{ title: "New Remix App" }, | ||
{ name: "description", content: "Welcome to Remix!" }, | ||
{ title: "VoiceDeck" }, | ||
{ name: "description", content: "Welcome to VoiceDeck!" }, | ||
]; | ||
}; | ||
|
||
export const loader = async () => { | ||
const ownerAddress = process.env.HC_OWNER_ADDRESS; | ||
try { | ||
if (!ownerAddress) { | ||
throw new Error("Owner address environment variable is not set"); | ||
} | ||
const response = await fetchReports(ownerAddress); | ||
return json(response); | ||
} catch (error) { | ||
console.error(`Failed to load impact reports: ${error}`); | ||
return new Response( | ||
JSON.stringify({ error: "Failed to load impact reports" }), | ||
{ | ||
status: 500, | ||
statusText: "Internal Server Error", | ||
}, | ||
); | ||
} | ||
}; | ||
|
||
export default function Index() { | ||
const reports = useLoaderData<typeof loader>(); | ||
return ( | ||
<div> | ||
<h1 className="text-7xl">Welcome to Remix</h1> | ||
<ul> | ||
<li> | ||
<a | ||
target="_blank" | ||
href="https://remix.run/tutorials/blog" | ||
rel="noreferrer" | ||
> | ||
15m Quickstart Blog Tutorial | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
target="_blank" | ||
href="https://remix.run/tutorials/jokes" | ||
rel="noreferrer" | ||
> | ||
Deep Dive Jokes App Tutorial | ||
</a> | ||
</li> | ||
<li> | ||
<a target="_blank" href="https://remix.run/docs" rel="noreferrer"> | ||
Remix Docs | ||
</a> | ||
</li> | ||
</ul> | ||
<div className="flex flex-col gap-10"> | ||
<h1 className="text-7xl">VoiceDeck</h1> | ||
<h2 className="text-5xl">Reports</h2> | ||
{reports.map((report: Report) => ( | ||
<div key={report.id}> | ||
<div>ID: {report.id}</div> | ||
<div>TTILE: {report.title}</div> | ||
<div>SUMMARY: {report.summary}</div> | ||
<div>IMAGE: {report.image.slice(0, 50)}</div> | ||
<div>STATE: {report.state}</div> | ||
<div>CATEGORY: {report.category}</div> | ||
<div>TOTAL COST: {report.totalCost}</div> | ||
<div>FUNDED SO FAR: {report.fundedSoFar}</div> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
} |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// vite.config.ts | ||
import million from "file:///Users/cjrose/Documents/VoiceDeck/app/node_modules/.pnpm/[email protected]/node_modules/million/dist/packages/compiler.mjs"; | ||
import { unstable_vitePlugin as remix } from "file:///Users/cjrose/Documents/VoiceDeck/app/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@remix-run/dev/dist/index.js"; | ||
import { defineConfig } from "file:///Users/cjrose/Documents/VoiceDeck/app/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/index.js"; | ||
import tsconfigPaths from "file:///Users/cjrose/Documents/VoiceDeck/app/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/vite-tsconfig-paths/dist/index.mjs"; | ||
var vite_config_default = defineConfig({ | ||
plugins: [million.vite({ auto: true }), remix(), tsconfigPaths()], | ||
test: { | ||
include: ["./app/**/*.test.ts"] | ||
} | ||
}); | ||
export { | ||
vite_config_default as default | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCIvVXNlcnMvY2pyb3NlL0RvY3VtZW50cy9Wb2ljZURlY2svYXBwXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCIvVXNlcnMvY2pyb3NlL0RvY3VtZW50cy9Wb2ljZURlY2svYXBwL3ZpdGUuY29uZmlnLnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9Vc2Vycy9janJvc2UvRG9jdW1lbnRzL1ZvaWNlRGVjay9hcHAvdml0ZS5jb25maWcudHNcIjtpbXBvcnQgbWlsbGlvbiBmcm9tICdtaWxsaW9uL2NvbXBpbGVyJztcbmltcG9ydCB7IHVuc3RhYmxlX3ZpdGVQbHVnaW4gYXMgcmVtaXggfSBmcm9tIFwiQHJlbWl4LXJ1bi9kZXZcIjtcbmltcG9ydCB7IGRlZmluZUNvbmZpZyB9IGZyb20gXCJ2aXRlXCI7XG5pbXBvcnQgdHNjb25maWdQYXRocyBmcm9tIFwidml0ZS10c2NvbmZpZy1wYXRoc1wiO1xuXG5leHBvcnQgZGVmYXVsdCBkZWZpbmVDb25maWcoe1xuICBwbHVnaW5zOiBbbWlsbGlvbi52aXRlKHsgYXV0bzogdHJ1ZSB9KSwgcmVtaXgoKSwgdHNjb25maWdQYXRocygpXSxcbiAgdGVzdDoge1xuICAgICAgICAgIGluY2x1ZGU6IFtcIi4vYXBwLyoqLyoudGVzdC50c1wiXSxcbiAgfSxcbn0pO1xuIl0sCiAgIm1hcHBpbmdzIjogIjtBQUFpUyxPQUFPLGFBQWE7QUFDclQsU0FBUyx1QkFBdUIsYUFBYTtBQUM3QyxTQUFTLG9CQUFvQjtBQUM3QixPQUFPLG1CQUFtQjtBQUUxQixJQUFPLHNCQUFRLGFBQWE7QUFBQSxFQUMxQixTQUFTLENBQUMsUUFBUSxLQUFLLEVBQUUsTUFBTSxLQUFLLENBQUMsR0FBRyxNQUFNLEdBQUcsY0FBYyxDQUFDO0FBQUEsRUFDaEUsTUFBTTtBQUFBLElBQ0UsU0FBUyxDQUFDLG9CQUFvQjtBQUFBLEVBQ3RDO0FBQ0YsQ0FBQzsiLAogICJuYW1lcyI6IFtdCn0K |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thebeyondr looking into why this file was generated before i remove it..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey, it has to be removed anyways because the file paths are specific to your machine lol, no prob!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think i should add it to the
.gitignore
?here is discussion about dealing with these files, haven't finished reading yet but doesn't seem to have consensus on the best solution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we're on that discussion thread now lol