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

Profile improvemnt v2 #2077

Merged
merged 28 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a1d8aaf
docs url
nguyenhoaidanh Jul 13, 2023
0a8ff6b
refresh list noti when change profike
nguyenhoaidanh Jul 13, 2023
d4a9f1e
add threast hold token search
nguyenhoaidanh Jul 13, 2023
e1a43ed
fix: loading. for ever
nguyenhoaidanh Jul 13, 2023
1e5d0ef
add log
nguyenhoaidanh Jul 13, 2023
f50a353
STG
nguyenhoaidanh Jul 14, 2023
cf9b9db
test
nguyenhoaidanh Jul 14, 2023
7ecf93b
fix wrong address sign in
nguyenhoaidanh Jul 14, 2023
0546640
fix infinite loading price alert
nguyenhoaidanh Jul 14, 2023
5006057
rm log
nguyenhoaidanh Jul 14, 2023
3c092ee
fix crosschain too long
nguyenhoaidanh Jul 14, 2023
1a3918b
fix ux session expired
nguyenhoaidanh Jul 14, 2023
39607b0
add space
nguyenhoaidanh Jul 17, 2023
b1e1027
check wallet kyberai
nguyenhoaidanh Jul 17, 2023
0ee992e
add err desc
nguyenhoaidanh Jul 17, 2023
f74a6ea
not required email when sub
nguyenhoaidanh Jul 17, 2023
69d4343
env dev
nguyenhoaidanh Jul 17, 2023
141f3dc
only verify email when enter email
nguyenhoaidanh Jul 17, 2023
8104d00
Merge branch 'main' into profile-imp-v2
nguyenhoaidanh Jul 17, 2023
9768be4
Merge remote-tracking branch 'origin/main' into profile-imp-v2
nguyenhoaidanh Jul 18, 2023
d1cae33
add more tracking data
nguyenhoaidanh Jul 18, 2023
1d73a9f
test
nguyenhoaidanh Jul 18, 2023
fd43acd
add more tracking data
nguyenhoaidanh Jul 18, 2023
9a4f3f8
update ui inconsistent
nguyenhoaidanh Jul 19, 2023
4fbdd49
default aggregator api
nguyenhoaidanh Jul 19, 2023
980c096
update default authen
nguyenhoaidanh Jul 19, 2023
13a9bf3
Merge branch 'temp' into profile-imp-v2
nguyenhoaidanh Jul 19, 2023
d445051
revert
nguyenhoaidanh Jul 19, 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
1 change: 0 additions & 1 deletion .env.adpr
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
VITE_DEFAULT_AGGREGATOR_API=https://meta-aggregator.dev.kyberengineering.io
VITE_AGGREGATOR_API=https://aggregator-api.dev.kyberengineering.io
VITE_AGGREGATOR_STATS_API=https://aggregator-stats.dev.kyberengineering.io
VITE_SENTRY_DNS=https://d94ee2d3c22043bdaec966758680b5a8@sentry.ops.kyberengineering.io/4
Expand Down
1 change: 0 additions & 1 deletion .env.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
VITE_DEFAULT_AGGREGATOR_API=https://meta-aggregator.dev.kyberengineering.io
VITE_AGGREGATOR_API=https://aggregator-api.dev.kyberengineering.io
VITE_AGGREGATOR_STATS_API=https://aggregator-stats.dev.kyberengineering.io
VITE_SENTRY_DNS=https://d94ee2d3c22043bdaec966758680b5a8@sentry.ops.kyberengineering.io/4
Expand Down
1 change: 0 additions & 1 deletion .env.production
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
VITE_DEFAULT_AGGREGATOR_API=https://meta-aggregator-api.kyberswap.com
VITE_AGGREGATOR_API=https://aggregator-api.kyberswap.com
VITE_AGGREGATOR_STATS_API=https://aggregator-stats.kyberswap.com
VITE_SENTRY_DNS=https://d94ee2d3c22043bdaec966758680b5a8@sentry.ops.kyberengineering.io/4
Expand Down
1 change: 0 additions & 1 deletion .env.stg
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
VITE_DEFAULT_AGGREGATOR_API=https://meta-aggregator.stg.kyberengineering.io
VITE_AGGREGATOR_API=https://aggregator-api.stg.kyberengineering.io
VITE_AGGREGATOR_STATS_API=https://aggregator-stats.kyberswap.com
VITE_SENTRY_DNS=https://d94ee2d3c22043bdaec966758680b5a8@sentry.ops.kyberengineering.io/4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ function NotificationPreference({

const [selectedTopic, setSelectedTopic] = useState<number[]>([])

const notFillEmail = !inputEmail

const updateTopicGroupsLocal = useCallback(
(subIds: number[], unsubIds: number[]) => {
const newTopicGroups = topicGroupsGlobal.map(group => {
Expand Down Expand Up @@ -295,7 +293,7 @@ function NotificationPreference({
const isVerifiedEmail = userInfo?.email && inputEmail === userInfo?.email
const needVerifyEmail = inputEmail && inputEmail !== userInfo?.email

const disableCheckbox = needVerifyEmail || notFillEmail || hasErrorInput
const disableCheckbox = hasErrorInput
const isIncludePriceAlert = useCallback(() => {
const changedData = getDiffChangeTopics(topicGroups)
return (
Expand All @@ -315,7 +313,7 @@ function NotificationPreference({

const checkProfileAndSave = () => {
if (disableButtonSave) return
if (!userInfo?.email && !isIncludePriceAlert()) {
if (needVerifyEmail && !isIncludePriceAlert()) {
showVerifyModal()
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { isMobile } from 'react-device-detect'
import { ChevronRight } from 'react-feather'
import styled from 'styled-components'

import SettingLabel from 'components/swapv2/SwapSettingsPanel/SettingLabel'
import { TextDashed } from 'components/Tooltip'
import useGasPriceFromDeBank, { GasLevel } from 'hooks/useGasPriceFromDeBank'
import useTheme from 'hooks/useTheme'

Expand Down Expand Up @@ -62,9 +62,9 @@ const GasPriceTrackerSetting: React.FC<Props> = ({ onClick }) => {

return (
<Container onClick={onClick}>
<SettingLabel>
<TextDashed fontSize={12} fontWeight={400} color={theme.subText} underlineColor={theme.border}>
<Trans>Gas Price Tracker</Trans>
</SettingLabel>
</TextDashed>

<Group>
<PriceInWei>{getPriceInGweiText(data[GasLevel.NORMAL].gasPriceInGwei)}</PriceInWei>
Expand Down
1 change: 0 additions & 1 deletion src/constants/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const required = (envKey: string): string => {

export const GOOGLE_RECAPTCHA_KEY = required('GOOGLE_RECAPTCHA_KEY')
export const PRICE_API = required('PRICE_API')
export const DEFAULT_AGGREGATOR_API = required('DEFAULT_AGGREGATOR_API')
export const AGGREGATOR_API = required('AGGREGATOR_API')
export const SENTRY_DNS = required('SENTRY_DNS')
export const REWARD_SERVICE_API = required('REWARD_SERVICE_API')
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/useKyberSwapConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
useLazyGetKyberswapConfigurationQuery,
} from 'services/ksSetting'

import { DEFAULT_AGGREGATOR_API } from 'constants/env'
import { AGGREGATOR_API } from 'constants/env'
import { NETWORKS_INFO, SUPPORTED_NETWORKS, isEVM, isSolana } from 'constants/networks'
import ethereumInfo from 'constants/networks/ethereum'
import solanaInfo from 'constants/networks/solana'
Expand Down Expand Up @@ -65,8 +65,8 @@ const parseGlobalResponse = (
chainId: ChainId,
): KyberswapGlobalConfig => {
const data = responseData?.data?.config
const aggregatorDomain = data?.aggregator ?? DEFAULT_AGGREGATOR_API
const isEnableAuthenAggregator = !data ? true : !!data?.isEnableAuthenAggregator
const aggregatorDomain = data?.aggregator ?? AGGREGATOR_API
const isEnableAuthenAggregator = !!data?.isEnableAuthenAggregator
return {
aggregatorDomain,
aggregatorAPI: `${aggregatorDomain}/${NETWORKS_INFO[chainId].aggregatorRoute}/route/encode`,
Expand Down
7 changes: 5 additions & 2 deletions src/utils/iamError.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { captureException } from '@sentry/react'
import { AxiosError } from 'axios'

import { BFF_API, ENV_LEVEL } from 'constants/env'
import { BFF_API, ENV_KEY, ENV_LEVEL } from 'constants/env'
import { AGGREGATOR_API_PATHS } from 'constants/index'
import { ENV_TYPE } from 'constants/type'

Expand All @@ -24,7 +24,7 @@ const sendError = (name: string, apiUrl: string, trackData: any) => {
}

// hot fix to prevent spam for now.
const blacklistPathBff = ['/v1/notification/me']
const blacklistPathBff = ['/v1/notification/me', '/v1/tokens/score']

/**
* check error status: blocked, maybe cors issues or server down
Expand Down Expand Up @@ -52,6 +52,9 @@ export const checkIamDown = (axiosErr: AxiosError) => {
statusCode,
message: axiosErr?.message,
code: axiosErr?.code,
tokenInfoSignIn: localStorage[`${ENV_KEY}_o2_sign_in`],
tokenInfoGuest: localStorage[`${ENV_KEY}_o2_guest`],
profileInfo: localStorage.redux_localstorage_simple_profile,
}
const apiUrl = axiosErr?.config?.url ?? ''

Expand Down
Loading