Skip to content
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(dcellar-web-ui): upgrade mainnet. #302

Merged
merged 36 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
ffa35cb
feat(dcellar-web-ui): add entry link for data marketplace
aiden-cao Nov 15, 2023
5bb36ca
fix(dcellar-web-ui): menu option type
aiden-cao Nov 16, 2023
c00b0fd
fix(dcellar-web-ui): worker test
aiden-cao Nov 16, 2023
ff743b5
Merge branch 'main' into feat/aiden-cao
aiden-cao Nov 20, 2023
53dc9af
feat(dcellar-web-ui): fix undefined reading error
aiden-cao Nov 20, 2023
7dcff91
Merge branch 'main' into feat/aiden-cao
aiden-cao Nov 20, 2023
8b6c455
feat(dcellar-web-ui): fix undefined reading error
aiden-cao Nov 20, 2023
10aa6a7
feat(dcellar-web-ui): add apollo list for sell
aiden-cao Nov 20, 2023
00cf841
feat(dcellar-web-ui): add drag upload
aiden-cao Nov 21, 2023
c1a6819
feat(dcellar-web-ui): add global notification
aiden-cao Nov 21, 2023
b158cb1
feat(dcellar-web-ui): add sp latency
aiden-cao Nov 21, 2023
8c8870d
Merge branch 'main' into feat/aiden-cao
aiden-cao Nov 21, 2023
ed16a05
feat(dcellar-web-ui): fix uppercase endpoint
aiden-cao Nov 21, 2023
e3fc087
feat(dcellar-web-ui): update list for params
aiden-cao Nov 22, 2023
cee33a8
feat(dcellar-web-ui): fix get start button redirect back
aiden-cao Nov 22, 2023
9d26e44
feat(dcellar-web-ui): fix protect path
aiden-cao Nov 22, 2023
3f9bd6f
Merge branch 'main' into feat/aiden-cao
aiden-cao Nov 24, 2023
16d140b
feat(dcellar-web-ui): fix auto connect connector always undefined
aiden-cao Nov 24, 2023
e153ee3
feat(dcellar-web-ui): add preconnect for sps
aiden-cao Nov 27, 2023
f0afd12
feat(dcellar-web-ui): fix navigate to pricing calculator page too slow
aiden-cao Nov 27, 2023
8e86d6a
feat(dcellar-web-ui): fix header mobile render
aiden-cao Nov 27, 2023
f0ca98c
Merge pull request #282 from node-real/feat/aiden-cao
aiden-cao Nov 30, 2023
8b5d785
feat(dcellar-web-ui): fix wallet connector unfined
aiden-cao Nov 30, 2023
a689cf9
Merge pull request #291 from node-real/fix/connector-undefined
aiden-cao Nov 30, 2023
12d06ba
fix(dcellar-web-ui): create bucket can not get payment account data (…
devinxl Nov 30, 2023
708380b
feat(dcellar-web-ui): add dashboard module (#288)
devinxl Nov 30, 2023
844d8bf
Revert "feat(dcellar-web-ui): fix wallet connector unfined"
aiden-cao Nov 30, 2023
fe5d8cc
Merge pull request #293 from node-real/fix/revert-trust-wallet-hack
aiden-cao Nov 30, 2023
32c81d0
Revert "Merge pull request #293 from node-real/fix/revert-trust-walle…
aiden-cao Dec 1, 2023
455cf8c
feat(dcellar-web-ui): update walletkit
aiden-cao Dec 1, 2023
0fce13c
feat(dcellar-web-ui): update connector detect time
aiden-cao Dec 4, 2023
cc5195a
fix(dcellar-web-ui): new Array error (#298)
devinxl Dec 4, 2023
512b03f
fix(dcellar-web-ui): opt dashboard style (#299)
devinxl Dec 5, 2023
b7ce2c0
Merge branch 'main' into feat/update-walletkit
aiden-cao Dec 5, 2023
1b04a50
Merge pull request #295 from node-real/feat/update-walletkit
aiden-cao Dec 5, 2023
f4e42b4
Merge remote-tracking branch 'origin/mainnet-main' into feat/upgrade-…
devinxl Dec 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/dcellar-web-ui/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,7 @@ const nextConfig = {
},
};

module.exports = withSentryConfig(withBundleAnalyzer(withTranspileModules(nextConfig)), sentryWebpackPluginOptions);
module.exports = withSentryConfig(
withBundleAnalyzer(withTranspileModules(nextConfig)),
sentryWebpackPluginOptions,
);
6 changes: 4 additions & 2 deletions apps/dcellar-web-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"ahooks": "3.7.7",
"hash-wasm": "4.10.0",
"@babel/core": "^7.20.12",
"@bnb-chain/greenfield-js-sdk": "1.0.4",
"@bnb-chain/greenfield-js-sdk": "1.0.6",
"@bnb-chain/greenfield-cosmos-types": "0.4.0-alpha.23",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
Expand Down Expand Up @@ -55,7 +55,9 @@
"echarts": "~5.4.3",
"echarts-for-react": "~3.0.2",
"next-transpile-modules": "~10.0.1",
"redux": "~4.2.1"
"redux": "~4.2.1",
"react-dnd": "16.0.1",
"react-dnd-html5-backend": "16.0.1"
},
"devDependencies": {
"@babel/plugin-syntax-flow": "^7.14.5",
Expand Down
2 changes: 1 addition & 1 deletion apps/dcellar-web-ui/public/js/iconfont_v0.5.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions apps/dcellar-web-ui/public/js/iconfont_v0.6.min.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions apps/dcellar-web-ui/src/base/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const {
NEXT_PUBLIC_GREENFIELD_CHAIN_MAINNET_RPC_URL,
} = publicRuntimeConfig || {};
const {
NEXT_PRIVATE_BILLING_API_URL
NEXT_PRIVATE_BILLING_API_URL,
NEXT_PRIVATE_EXPLORER_API_URL,
} = serverRuntimeConfig || {};

export type TRuntimeEnv = 'development' | 'qa' | 'testnet' | 'mainnet';
Expand All @@ -36,4 +37,5 @@ export const GREENFIELD_CHAIN_EXPLORER_URL = NEXT_PUBLIC_GREENFIELD_CHAIN_EXPLOR
export const BSC_EXPLORER_URL = NEXT_PUBLIC_BSC_EXPLORER_URL;
export const GREENFIELD_MAINNET_ID = NEXT_PUBLIC_GREENFIELD_CHAIN_MAINNET_ID;
export const GREENFIELD_MAINNET_RPC_URL = NEXT_PUBLIC_GREENFIELD_CHAIN_MAINNET_RPC_URL;
export const BILLING_API_URL = NEXT_PRIVATE_BILLING_API_URL;
export const BILLING_API_URL = NEXT_PRIVATE_BILLING_API_URL;
export const EXPLORER_API_URL = NEXT_PRIVATE_EXPLORER_API_URL;
1 change: 1 addition & 0 deletions apps/dcellar-web-ui/src/base/theme/light.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const light = {
'label-normal': '#EEBE11',
'label-active': '#F1CA3C',
primary: '#00BA34',
chartTick: rgba('#AEB4BC', 0.3),
},
bg: {
bottom: '#f5f5f5',
Expand Down
4 changes: 2 additions & 2 deletions apps/dcellar-web-ui/src/components/ConnectWallet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { DCButton, DCButtonProps } from '@/components/common/DCButton';
import { Text } from '@totejs/uikit';
import { smMedia } from '@/modules/responsive';
import { useRouter } from 'next/router';
import { InternalRoutePaths } from '@/utils/constant';
import { useAccount, useDisconnect } from 'wagmi';
import { ssrLandingRoutes } from '@/pages/_app';
import { useOffChainAuth } from '@/context/off-chain-auth/useOffChainAuth';
import { checkOffChainDataAvailable, setLogin } from '@/store/slices/persist';
import { useAsyncEffect } from 'ahooks';
import { useAppDispatch } from '@/store';
import { useModal } from '@totejs/walletkit';
import { InternalRoutePaths } from '@/constants/paths';

interface ConnectWalletProps extends DCButtonProps {
icon?: ReactElement;
Expand All @@ -34,7 +34,7 @@ export const ConnectWallet = memo<Partial<ConnectWalletProps>>(function ConnectB
router.push(
!!router.query.originAsPath
? decodeURIComponent(router.query.originAsPath as string)
: InternalRoutePaths.buckets,
: InternalRoutePaths.dashboard,
);
};

Expand Down
4 changes: 2 additions & 2 deletions apps/dcellar-web-ui/src/components/ErrorComponent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Link from 'next/link';
import { Image } from '@totejs/uikit';
import { useRouter } from 'next/router';
import { useAppSelector } from '@/store';
import { InternalRoutePaths } from '@/utils/constant';
import { InternalRoutePaths } from '@/constants/paths';
import { IconFont } from '@/components/IconFont';

const Container = styled.main`
Expand Down Expand Up @@ -98,7 +98,7 @@ function ErrorComponent({ statusCode }: ErrorComponentProps) {
>
{desc}
</Text>
<Link href={address ? InternalRoutePaths.buckets : '/'} legacyBehavior passHref replace>
<Link href={address ? InternalRoutePaths.dashboard : '/'} legacyBehavior passHref replace>
<DCButton w={132} h={32} as="a" mb={40} fontSize={12} borderRadius={4}>
{isNoBucket ? 'Back to Home' : 'Go to Home'}
</DCButton>
Expand Down
1 change: 1 addition & 0 deletions apps/dcellar-web-ui/src/components/IconFont/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const IconFont = forwardRef<SVGSVGElement, IconFontProps>(function IconFo
{ type, w = '1em', h = w, ...props },
ref,
) {
if (!type) return null;
return (
<html.svg ref={ref} w={w} h={h} flexShrink={0} {...props}>
<use xlinkHref={`#icon-${type.toLowerCase()}`} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DCButton } from '../common/DCButton';
import { useWalletSwitchNetWork } from '@/context/WalletConnectContext';
import { useLogin } from '@/hooks/useLogin';
import { IconFont } from '@/components/IconFont';
import { CHAIN_NAMES } from '@/utils/constant';
import { CHAIN_NAMES } from '@/constants/wallet';

export const WrongNetworkModal = ({ isOpen, onClose }: any) => {
const { logout } = useLogin();
Expand Down
13 changes: 13 additions & 0 deletions apps/dcellar-web-ui/src/components/charts/BarChart/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { BaseChart, BaseChartProps } from '@/components/charts/BaseChart';
import { useBarChartOptions } from './useBarChartOptions';

export interface BarChartProps extends BaseChartProps {
noData: boolean
}

export function BarChart({noData, ...props}: BarChartProps) {
const { options, ...restProps } = props;
const finalOptions = useBarChartOptions(options, noData);

return <BaseChart options={finalOptions} {...restProps} />;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import { useColorMode, useColorModeValue, useTheme } from '@totejs/uikit';
import { useEffect, useState } from 'react';
import { merge } from 'lodash-es';
import { cssVar } from '@/utils/common';
import { noDataOptions } from '@/constants/chart';

export function useBarChartOptions(options: any, noData: boolean) {
const theme = useTheme();
const { colorMode } = useColorMode();
const colors = useColorModeValue(theme.colors.light, theme.colors.dark);

const [finalOptions, setFinalOptions] = useState({});

useEffect(() => {
if (colorMode !== document.documentElement.dataset.theme) {
return;
}
if (noData) {
return setFinalOptions(noDataOptions);
}
const defaultOptions = {
title: {
text: 'Cost Trend',
textStyle: {
color: cssVar('readable.normal'),
fontSize: 16,
fontWeight: 700,
},
left: 0,
padding: [5, 5, 5, 0],
textAlign: 'left',
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
},
},
grid: {
containLabel: true,
left: 'left',
right: '0%',
bottom: '0%',
},
toolbox: {
feature: {
dataView: { show: false, readOnly: false },
restore: { show: false },
saveAsImage: { show: false },
},
},
legend: {
icon: 'circle',
itemHeight: 8,
itemWidth: 8,
itemGap: 16,
right: 30,
textStyle: {
fontWeight: 400,
},
},
xAxis: [{
type: 'category',
axisTick: {
show: true,
alignWithLabel: true,
lineStyle: {
color: cssVar('bg.bottom'),
},
},
axisLabel: {
color: cssVar('readable.tertiary'),
fontSize: 12,
fontWeight: 500,
margin: 16,
lineHeight: 12,
},
axisLine: {
show: false,
margin: 18,
},
axisPointer: {
lineStyle: {
color: cssVar('readable.secondary'),
type: 'solid',
},
},
}],
yAxis: [{
type: 'value',
position: 'left',
alignTicks: true,
splitNumber: 5,
axisLine: {
show: false,
},
axisLabel: {
color: cssVar('readable.tertiary'),
fontSize: 12,
fontWeight: 500,
},
splitLine: {
lineStyle: {
color: cssVar('bg.bottom'),
},
},
}],
series: [
],
};

const finalOptions = merge(defaultOptions, options);

setFinalOptions(finalOptions);
}, [colors, options, colorMode, noData]);

return finalOptions;
}
12 changes: 7 additions & 5 deletions apps/dcellar-web-ui/src/components/charts/LineChart/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { BaseChart, BaseChartProps } from '@/components/charts/BaseChart';
import { useLineChartOptions } from '@/components/charts/LineChart/useLineChartOptions';

export interface LineChartProps extends BaseChartProps {}
export interface LineChartProps extends BaseChartProps {
noData: boolean
}

export function LineChart(props: LineChartProps) {
const { options } = props;
const finalOptions = useLineChartOptions(options);
export function LineChart({noData, ...props}: LineChartProps) {
const { options, ...restProps } = props;
const finalOptions = useLineChartOptions(options, noData);

return <BaseChart options={finalOptions} />;
return <BaseChart options={finalOptions} {...restProps} />;
}
Loading