File tree Expand file tree Collapse file tree 7 files changed +57
-19
lines changed
components/dashboard/transactions Expand file tree Collapse file tree 7 files changed +57
-19
lines changed Original file line number Diff line number Diff line change 11/** @type {import('next').NextConfig } */
22
3- const { withPlausibleProxy } = require ( "next-plausible" ) ;
4-
53let output = "export" ;
64let trailingSlash = true ;
75if ( process . env . NODE_ENV === "test" ) {
@@ -21,4 +19,4 @@ const nextConfig = {
2119 // reactStrictMode: false,
2220} ;
2321
24- module . exports = withPlausibleProxy ( nextConfig ) ;
22+ module . exports = nextConfig ;
Original file line number Diff line number Diff line change 1+ import { DetailedHTMLProps , ScriptHTMLAttributes } from "react" ;
2+
3+ type AnalyticsConfig = {
4+ plausibleDataDomain : string ;
5+ plausibleProps : DetailedHTMLProps <
6+ ScriptHTMLAttributes < HTMLScriptElement > ,
7+ HTMLScriptElement
8+ > ;
9+ } ;
10+
11+ function buildAnalyticsConfig ( ) : AnalyticsConfig {
12+ let pubnetDeployment = process . env . NEXT_PUBLIC_PRODUCTION === "pubnet" ;
13+
14+ let plausibleDataDomain = pubnetDeployment
15+ ? "new.stellarcarbon.io"
16+ : "test.stellarcarbon.io" ;
17+
18+ let plausibleProps = {
19+ src :
20+ process . env . NODE_ENV === "development"
21+ ? `https://${ plausibleDataDomain } /sessionvar/js/script.js`
22+ : "/sessionvar/js/script.js" ,
23+ ...( {
24+ "data-api" :
25+ process . env . NODE_ENV === "development"
26+ ? `https://${ plausibleDataDomain } /sessionvar/api/event`
27+ : "/sessionvar/api/event" ,
28+ } as any ) ,
29+ } ;
30+
31+ return {
32+ plausibleDataDomain,
33+ plausibleProps,
34+ } ;
35+ }
36+
37+ const analyticsConfig = buildAnalyticsConfig ( ) ;
38+ export default analyticsConfig ;
Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ import NavBar from "@/containers/navbar/NavBar";
66import DemoApp from "../containers/demo/DemoApp" ;
77import { SinkingContextProvider } from "@/context/SinkingContext" ;
88import appConfig from "@/config" ;
9- import Script from "next/script" ;
10- import PlausibleProvider from "next-plausible" ;
119
1210export default function App ( { children } : { children : React . ReactNode } ) {
1311 if ( appConfig . demo ) {
Original file line number Diff line number Diff line change @@ -12,8 +12,9 @@ import "@fortawesome/fontawesome-svg-core/styles.css";
1212import { config } from "@fortawesome/fontawesome-svg-core" ;
1313import { SinkFormContextProvider } from "@/context/SinkFormContext" ;
1414import AnalyticsConsent from "@/components/AnalyticsConsent" ;
15- import appConfig from "@/config" ;
15+
1616import PlausibleProvider from "next-plausible" ;
17+ import analyticsConfig from "@/analyticsConfig" ;
1718
1819config . autoAddCss = false ; /* eslint-disable import/first */
1920
@@ -27,14 +28,21 @@ export default function RootLayout({
2728} : {
2829 children : React . ReactNode ;
2930} ) {
31+ console . log ( analyticsConfig . plausibleDataDomain ) ;
32+ console . log ( analyticsConfig . plausibleProps ) ;
33+
3034 return (
3135 < html lang = "en" >
32- < head >
33- < PlausibleProvider domain = { appConfig . plausibleDataDomain } />
34- </ head >
36+ < head > </ head >
3537 < AppContextProvider >
3638 < SinkFormContextProvider >
3739 < body className = { `${ inter . className } ` } >
40+ < PlausibleProvider
41+ domain = { analyticsConfig . plausibleDataDomain }
42+ scriptProps = { analyticsConfig . plausibleProps }
43+ enabled
44+ trackLocalhost
45+ />
3846 < PostHogProvider >
3947 < AnalyticsConsent />
4048
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export default function PendingRetirements() {
3737 } , [ setHasPendingRounding , walletConnection ] ) ;
3838
3939 return (
40- < div className = "bg-darkest w-full flex-1 flex flex-col" >
40+ < div className = "bg-darkest w-full flex-1 flex flex-col gap-8 " >
4141 < div className = "px-4 flex flex-col" >
4242 < div className = "mt-12 md:mt-12 flex flex-col items-center" >
4343 { /* <DashboardTitle>Pending retirements balance</DashboardTitle> */ }
@@ -77,7 +77,7 @@ export default function PendingRetirements() {
7777 </ div >
7878 </ div >
7979 </ div >
80- < div className = "flex-1 flex flex-col gap-1" >
80+ < div className = "flex-1 flex flex-col items-center gap-1 mb-12 md:px-4 " >
8181 { pendingTransactions ?. length ?? 0 > 0 ? (
8282 < >
8383 { pendingTransactions ?. map ( ( transaction , index ) => {
Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ export default function RequestCertificateInfo() {
2727 return (
2828 < div className = "p-4 flex flex-col gap-4" >
2929 < div className = "text-center" >
30- You have sufficient balance to create a personal certificate of { " " }
31- { Math . floor ( totalPending ) } < CARBONCurrencyIcon className = "inline" />
30+ { /* You have sufficient balance to create a personal certificate. */ }
31+ You can request a certificate for your pending balance.
3232 </ div >
3333
3434 < Button
Original file line number Diff line number Diff line change 33import { WalletNetwork } from "@creit.tech/stellar-wallets-kit" ;
44import * as StellarSdk from "@stellar/stellar-sdk" ;
55import { client } from "@stellarcarbon/sc-sdk" ;
6+ import { DetailedHTMLProps , ScriptHTMLAttributes } from "react" ;
67
78export interface AppConfiguration {
89 network : WalletNetwork ;
910 server : StellarSdk . Horizon . Server ;
1011 demo : boolean ;
1112 apiBaseUrl : string ;
1213 pubnetDeployment : boolean ;
13- plausibleDataDomain : string ;
14+
1415 usdcXlmLiquidityPoolId ?: string ;
1516 usdcAssetCode ?: string ;
1617}
@@ -31,10 +32,6 @@ function buildConfig(): AppConfiguration {
3132 ? "https://api.stellarcarbon.io"
3233 : "https://testnet-api.stellarcarbon.io" ;
3334
34- let plausibleDataDomain = pubnetDeployment
35- ? "new.stellarcarbon.io"
36- : "test.stellarcarbon.io" ;
37-
3835 if (
3936 process . env . NEXT_PUBLIC_USE_MAINNET === "true" &&
4037 process . env . NODE_ENV === "development"
@@ -55,7 +52,6 @@ function buildConfig(): AppConfiguration {
5552 server,
5653 apiBaseUrl,
5754 demo,
58- plausibleDataDomain,
5955 usdcXlmLiquidityPoolId,
6056 usdcAssetCode,
6157 } ;
You can’t perform that action at this time.
0 commit comments