Skip to content

Commit

Permalink
style: reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
PJColombo committed Oct 28, 2024
1 parent dd7bf3a commit 9354be1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
34 changes: 17 additions & 17 deletions apps/web/src/components/BlobscanVersionInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import { env } from "~/env.mjs";
import { Link } from "./Link";

function getVersionData(): { url: string; label: string } {
if (env.NEXT_PUBLIC_BLOBSCAN_RELEASE) {
return {
url: `https://github.com/Blobscan/blobscan/releases/tag/${env.NEXT_PUBLIC_BLOBSCAN_RELEASE}`,
label: env.NEXT_PUBLIC_BLOBSCAN_RELEASE,
};
}
export const BlobscanVersionInfo: React.FC = () => {
function getVersionData(): { url: string; label: string } {
if (env.NEXT_PUBLIC_BLOBSCAN_RELEASE) {
return {
url: `https://github.com/Blobscan/blobscan/releases/tag/${env.NEXT_PUBLIC_BLOBSCAN_RELEASE}`,
label: env.NEXT_PUBLIC_BLOBSCAN_RELEASE,
};
}

if (env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA) {
return {
url: `https://github.com/Blobscan/blobscan/commit/${env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA}`,
label: env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA.slice(0, 7),
};
}

if (env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA) {
return {
url: `https://github.com/Blobscan/blobscan/commit/${env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA}`,
label: env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA.slice(0, 7),
url: "https://github.com/Blobscan/blobscan/",
label: "Development",
};
}

return {
url: "https://github.com/Blobscan/blobscan/",
label: "Development",
};
}

export const BlobscanVersionInfo: React.FC = () => {
const { url, label } = getVersionData();

return (
Expand Down
8 changes: 4 additions & 4 deletions apps/web/src/env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,21 @@ export const env = createEnv({
* Destructure all variables from `process.env` to make sure they aren't tree-shaken away.
*/
runtimeEnv: {
NEXT_PUBLIC_POSTHOG_ID: process.env.NEXT_PUBLIC_POSTHOG_ID,
NEXT_PUBLIC_POSTHOG_HOST: process.env.NEXT_PUBLIC_POSTHOG_HOST,
NEXT_PUBLIC_BLOBSCAN_RELEASE: process.env.NEXT_PUBLIC_BLOBSCAN_RELEASE,
DATABASE_URL: process.env.DATABASE_URL,
FEEDBACK_WEBHOOK_URL: process.env.FEEDBACK_WEBHOOK_URL,
NODE_ENV: process.env.NODE_ENV,
NEXT_PUBLIC_VERCEL_ANALYTICS_ENABLED:
process.env.NEXT_PUBLIC_VERCEL_ANALYTICS_ENABLED,
NEXT_PUBLIC_POSTHOG_ID: process.env.NEXT_PUBLIC_POSTHOG_ID,
NEXT_PUBLIC_POSTHOG_HOST: process.env.NEXT_PUBLIC_POSTHOG_HOST,
NEXT_PUBLIC_BLOBSCAN_RELEASE: process.env.NEXT_PUBLIC_BLOBSCAN_RELEASE,
NEXT_PUBLIC_NETWORK_NAME: process.env.NEXT_PUBLIC_NETWORK_NAME,
NEXT_PUBLIC_SUPPORTED_NETWORKS: process.env.NEXT_PUBLIC_SUPPORTED_NETWORKS,
NEXT_PUBLIC_EXPLORER_BASE_URL: process.env.NEXT_PUBLIC_EXPLORER_BASE_URL,
NEXT_PUBLIC_BEACON_BASE_URL: process.env.NEXT_PUBLIC_BEACON_BASE_URL,
NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA:
process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,
NEXT_PUBLIC_SENTRY_DSN_WEB: process.env.NEXT_PUBLIC_SENTRY_DSN_WEB,
NODE_ENV: process.env.NODE_ENV,
TRACES_ENABLED: process.env.TRACES_ENABLED,
METRICS_ENABLED: process.env.METRICS_ENABLED,
},
Expand Down
2 changes: 1 addition & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@
"VERCEL_URL",
"TS_NODE"
]
}
}

0 comments on commit 9354be1

Please sign in to comment.