Skip to content

Commit

Permalink
feat(bos-components): add charts and statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
yudhomax committed Dec 8, 2023
1 parent 5627275 commit 59916d0
Show file tree
Hide file tree
Showing 11 changed files with 589 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/app/src/data/bos-components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type NetworkComponents = {
latestTransactions: string;
transactionOverview: string;
sponsoredText: string;
charts: string;
};

const ComponentUrl = {
Expand All @@ -20,6 +21,7 @@ const ComponentUrl = {
latestTransactions: `${process.env.NEXT_PUBLIC_ACCOUNT_ID}/widget/bos-components.components.Transactions.Latest`,
transactionOverview: `${process.env.NEXT_PUBLIC_ACCOUNT_ID}/widget/bos-components.components.Transactions.Overview`,
sponsoredText: `${process.env.NEXT_PUBLIC_ACCOUNT_ID}/widget/bos-components.components.Shared.SponsoredText`,
charts: `${process.env.NEXT_PUBLIC_ACCOUNT_ID}/widget/bos-components.components.Charts`,
};

export const componentsByNetworkId: Record<
Expand Down
12 changes: 12 additions & 0 deletions apps/app/src/pages/charts/addresses.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { VmComponent } from '@/components/vm/VmComponent';
import { useBosComponents } from '@/hooks/useBosComponents';

const AddressesChart = () => {
const components = useBosComponents();

return (
<VmComponent src={components?.charts} props={{ chart: 'addresses' }} />
);
};

export default AddressesChart;
10 changes: 10 additions & 0 deletions apps/app/src/pages/charts/blocks.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { VmComponent } from '@/components/vm/VmComponent';
import { useBosComponents } from '@/hooks/useBosComponents';

const BlocksChart = () => {
const components = useBosComponents();

return <VmComponent src={components?.charts} props={{ chart: 'blocks' }} />;
};

export default BlocksChart;
10 changes: 10 additions & 0 deletions apps/app/src/pages/charts/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { VmComponent } from '@/components/vm/VmComponent';
import { useBosComponents } from '@/hooks/useBosComponents';

const Charts = () => {
const components = useBosComponents();

return <VmComponent src={components?.charts} />;
};

export default Charts;
12 changes: 12 additions & 0 deletions apps/app/src/pages/charts/market-cap.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { VmComponent } from '@/components/vm/VmComponent';
import { useBosComponents } from '@/hooks/useBosComponents';

const MarketCapChart = () => {
const components = useBosComponents();

return (
<VmComponent src={components?.charts} props={{ chart: 'market-cap' }} />
);
};

export default MarketCapChart;
12 changes: 12 additions & 0 deletions apps/app/src/pages/charts/near-price.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { VmComponent } from '@/components/vm/VmComponent';
import { useBosComponents } from '@/hooks/useBosComponents';

const NearPriceChart = () => {
const components = useBosComponents();

return (
<VmComponent src={components?.charts} props={{ chart: 'near-price' }} />
);
};

export default NearPriceChart;
12 changes: 12 additions & 0 deletions apps/app/src/pages/charts/near-supply.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { VmComponent } from '@/components/vm/VmComponent';
import { useBosComponents } from '@/hooks/useBosComponents';

const NearSupplyChart = () => {
const components = useBosComponents();

return (
<VmComponent src={components?.charts} props={{ chart: 'near-supply' }} />
);
};

export default NearSupplyChart;
10 changes: 10 additions & 0 deletions apps/app/src/pages/charts/txn-fee.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { VmComponent } from '@/components/vm/VmComponent';
import { useBosComponents } from '@/hooks/useBosComponents';

const TxnFeeChart = () => {
const components = useBosComponents();

return <VmComponent src={components?.charts} props={{ chart: 'txn-fee' }} />;
};

export default TxnFeeChart;
12 changes: 12 additions & 0 deletions apps/app/src/pages/charts/txn-volume.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { VmComponent } from '@/components/vm/VmComponent';
import { useBosComponents } from '@/hooks/useBosComponents';

const TxnVolumeChart = () => {
const components = useBosComponents();

return (
<VmComponent src={components?.charts} props={{ chart: 'txn-volume' }} />
);
};

export default TxnVolumeChart;
10 changes: 10 additions & 0 deletions apps/app/src/pages/charts/txns.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { VmComponent } from '@/components/vm/VmComponent';
import { useBosComponents } from '@/hooks/useBosComponents';

const TxnsChart = () => {
const components = useBosComponents();

return <VmComponent src={components?.charts} props={{ chart: 'txns' }} />;
};

export default TxnsChart;
Loading

0 comments on commit 59916d0

Please sign in to comment.