Skip to content

Commit

Permalink
feature: add Terms & Conditions and Privacy Policy link to the naviga…
Browse files Browse the repository at this point in the history
…tion menu (#1073)

* added Terms & Conditions and Privacy Policy link to the navigation menu

* moved urls to constants

* removed unused constants
  • Loading branch information
ost-ptk authored Nov 14, 2024
1 parent 8062702 commit 32959a6
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 25 deletions.
6 changes: 3 additions & 3 deletions src/apps/onboarding/pages/create-vault-password/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useWatch } from 'react-hook-form';
import { Trans, useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';

import { TermsLink } from '@src/constants';
import { TERMS_URLS } from '@src/constants';

import { Stepper } from '@onboarding/components/stepper';
import { RouterPath } from '@onboarding/router';
Expand Down Expand Up @@ -69,7 +69,7 @@ export function CreateVaultPasswordPage({
onClick={event => {
event.stopPropagation();
event.preventDefault();
window.open(TermsLink.Tos, '_blank');
window.open(TERMS_URLS.tos, '_blank');
}}
color="contentAction"
>
Expand All @@ -80,7 +80,7 @@ export function CreateVaultPasswordPage({
onClick={event => {
event.stopPropagation();
event.preventDefault();
window.open(TermsLink.Privacy, '_blank');
window.open(TERMS_URLS.privacy, '_blank');
}}
color="contentAction"
>
Expand Down
30 changes: 25 additions & 5 deletions src/apps/popup/pages/navigation-menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
import styled from 'styled-components';

import {
ABOUT_US_URL,
SHARE_FEEDBACK_URL,
TERMS_URLS,
USER_GUIDES_URL
} from '@src/constants';
import { isLedgerAvailable, isSafariBuild } from '@src/utils';

import { TimeoutDurationSetting } from '@popup/constants';
Expand Down Expand Up @@ -320,23 +326,37 @@ export function NavigationMenuPageContent() {
items: [
{
id: 1,
title: t('Terms & Conditions'),
iconPath: 'assets/icons/books.svg',
href: TERMS_URLS.tos,
disabled: false
},
{
id: 2,
title: t('Privacy Policy'),
iconPath: 'assets/icons/books.svg',
href: TERMS_URLS.privacy,
disabled: false
},
{
id: 3,
title: t('Share feedback'),
iconPath: 'assets/icons/chat.svg',
href: 'https://casper-wallet.canny.io/feature-requests',
href: SHARE_FEEDBACK_URL,
disabled: false
},
{
id: 2,
id: 4,
title: t('User guides'),
iconPath: 'assets/icons/books.svg',
href: 'https://casperwallet.io/user-guide',
href: USER_GUIDES_URL,
disabled: false
},
{
id: 3,
id: 5,
title: t('About us'),
iconPath: 'assets/icons/team.svg',
href: 'https://make.services/',
href: ABOUT_US_URL,
disabled: false
}
]
Expand Down
24 changes: 10 additions & 14 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
const SECOND = 1000;

export const FETCH_QUERY_OPTIONS = {
// cached for 30 sec
apiCacheTime: 30 * SECOND
};

export const BALANCE_REFRESH_RATE = 15 * SECOND;
export const CURRENCY_REFRESH_RATE = 30 * SECOND;
export const TOKENS_REFRESH_RATE = 15 * SECOND;
export const NFT_TOKENS_REFRESH_RATE = 60 * SECOND;
export const ACCOUNT_DEPLOY_REFRESH_RATE = 30 * SECOND;
export const ACCOUNT_CASPER_ACTIVITY_REFRESH_RATE = 30 * SECOND;
export const ERC20_TOKEN_ACTIVITY_REFRESH_RATE = 30 * SECOND;
export const VALIDATORS_REFRESH_RATE = 30 * SECOND;
export const PENDING_DEPLOY_REFETCH_INTERVAL = 5 * SECOND;
export const DEPLOY_DETAILS_REFRESH_RATE = 30 * SECOND;
Expand All @@ -29,6 +22,16 @@ export const STAKE_COST_MOTES = '2500000000'; // 2.5 CSPR
export const DELEGATION_MIN_AMOUNT_MOTES = '500000000000'; // 500 CSPR
export const MAX_DELEGATORS = 1200;

export const USER_GUIDES_URL = 'https://casperwallet.io/user-guide';
export const SHARE_FEEDBACK_URL =
'https://casper-wallet.canny.io/feature-requests';
export const ABOUT_US_URL = 'https://make.services';
export const TERMS_URLS = {
tos: 'https://www.casperwallet.io/tos',
privacy: 'https://www.casperwallet.io/privacy'
};
export const REFERRER_URL = 'https://casperwallet.io';

export const getBlockExplorerAccountUrl = (
casperLiveUrl: string,
publicKey: string
Expand Down Expand Up @@ -84,18 +87,11 @@ export enum Browser {
Edge = 'edge'
}

export enum TermsLink {
Tos = 'https://www.casperwallet.io/tos',
Privacy = 'https://www.casperwallet.io/privacy'
}

export enum CasperNodeUrl {
MainnetUrl = 'https://node.cspr.cloud/rpc',
TestnetUrl = 'https://node.testnet.cspr.cloud/rpc'
}

export const ReferrerUrl = 'https://casperwallet.io';

export enum NetworkName {
Mainnet = 'casper',
Testnet = 'casper-test'
Expand Down
6 changes: 3 additions & 3 deletions src/libs/services/deployer-service/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
AuctionManagerEntryPoint,
CasperNodeUrl,
NetworkName,
ReferrerUrl,
REFERRER_URL,
STAKE_COST_MOTES,
TRANSFER_COST_MOTES
} from '@src/constants';
Expand Down Expand Up @@ -51,7 +51,7 @@ export const getDateForDeploy = async (nodeUrl: CasperNodeUrl) => {
const casperNodeTimestamp: ICasperNodeStatusResponse = await fetch(
`${nodeUrl}/info_get_status`,
{
referrer: ReferrerUrl
referrer: REFERRER_URL
}
).then(toJson);

Expand Down Expand Up @@ -274,7 +274,7 @@ export const sendSignDeploy = (

return fetch(nodeUrl, {
method: 'POST',
referrer: ReferrerUrl,
referrer: REFERRER_URL,
body: JSON.stringify({
jsonrpc: '2.0',
method: 'account_put_deploy',
Expand Down

0 comments on commit 32959a6

Please sign in to comment.