diff --git a/README.md b/README.md index 4cd95372c..d497f053c 100644 --- a/README.md +++ b/README.md @@ -193,10 +193,10 @@ where `spread` (fee tier in the UI) is in percentage, and `value` is the number ## Change Network -1. Create a new folder under `src/config` with the name of the network (ex: "polygon") -2. Copy and paste the files from `src/config/ethereum` into your folder +1. Create a new folder under [`src/config`](src/config) with the name of the network (ex: "polygon") +2. Copy and paste the files from [`src/config/demo`](src/config/demo) into your folder 3. Update the `common.ts`, `production.ts` & `development.ts` files with your config, pointing to the CarbonDeFi contracts in that network, as well as setting the rpc.url and rpc.headers (rpc.url must match the one found in [Chain Lists](https://chainlist.org/)). -4. Update the `src/config/index.ts` files to import your files +4. Update the [`src/config/index.ts`](src/config/index.ts) files to import your files `index.ts` As an example on adding Polygon network: @@ -272,6 +272,8 @@ The file `common.ts` with type [`AppConfig`](src/config/types.ts) contains impor - `useGradientBranding`: Flag to enable gradient styles for buttons. - `tradeCount`: Display the amount of trades in the explorer page. - `currencyMenu`: Display the currency menu to switch between currencies. + - `showTerms`: Display the terms page & links. ⚠️ If you set it to true, you need to change the content of the page ⚠️ + - `showPrivacy`: Display the privacy page & links. ⚠️ If you set it to true, you need to change the content of the page ⚠️ #### Gas token different than native token diff --git a/e2e/screenshots/simulator/recurring/Recurring_limit_limit/simulator-input-price.png b/e2e/screenshots/simulator/recurring/Recurring_limit_limit/simulator-input-price.png index cefd7a622..0eaeb2525 100644 Binary files a/e2e/screenshots/simulator/recurring/Recurring_limit_limit/simulator-input-price.png and b/e2e/screenshots/simulator/recurring/Recurring_limit_limit/simulator-input-price.png differ diff --git a/e2e/screenshots/strategy/disposable/Disposable_buy_limit/create/my-strategy.png b/e2e/screenshots/strategy/disposable/Disposable_buy_limit/create/my-strategy.png index 43bad0126..c01fbd49c 100644 Binary files a/e2e/screenshots/strategy/disposable/Disposable_buy_limit/create/my-strategy.png and b/e2e/screenshots/strategy/disposable/Disposable_buy_limit/create/my-strategy.png differ diff --git a/e2e/screenshots/strategy/disposable/Disposable_buy_range/create/my-strategy.png b/e2e/screenshots/strategy/disposable/Disposable_buy_range/create/my-strategy.png index bdbe30819..d7836b3d9 100644 Binary files a/e2e/screenshots/strategy/disposable/Disposable_buy_range/create/my-strategy.png and b/e2e/screenshots/strategy/disposable/Disposable_buy_range/create/my-strategy.png differ diff --git a/e2e/screenshots/strategy/disposable/Disposable_buy_range/deposit/form.png b/e2e/screenshots/strategy/disposable/Disposable_buy_range/deposit/form.png index dae52990f..d5161948e 100644 Binary files a/e2e/screenshots/strategy/disposable/Disposable_buy_range/deposit/form.png and b/e2e/screenshots/strategy/disposable/Disposable_buy_range/deposit/form.png differ diff --git a/e2e/screenshots/strategy/disposable/Disposable_sell_limit/create/my-strategy.png b/e2e/screenshots/strategy/disposable/Disposable_sell_limit/create/my-strategy.png index 8b8940a04..8206e354b 100644 Binary files a/e2e/screenshots/strategy/disposable/Disposable_sell_limit/create/my-strategy.png and b/e2e/screenshots/strategy/disposable/Disposable_sell_limit/create/my-strategy.png differ diff --git a/e2e/screenshots/strategy/disposable/Disposable_sell_range/create/my-strategy.png b/e2e/screenshots/strategy/disposable/Disposable_sell_range/create/my-strategy.png index 776f9cc03..330edf625 100644 Binary files a/e2e/screenshots/strategy/disposable/Disposable_sell_range/create/my-strategy.png and b/e2e/screenshots/strategy/disposable/Disposable_sell_range/create/my-strategy.png differ diff --git a/e2e/screenshots/strategy/recurring/Recurring_limit_limit/create/my-strategy.png b/e2e/screenshots/strategy/recurring/Recurring_limit_limit/create/my-strategy.png index f15cfeff3..b03ba42f8 100644 Binary files a/e2e/screenshots/strategy/recurring/Recurring_limit_limit/create/my-strategy.png and b/e2e/screenshots/strategy/recurring/Recurring_limit_limit/create/my-strategy.png differ diff --git a/e2e/screenshots/strategy/recurring/Recurring_limit_limit/undercut/form.png b/e2e/screenshots/strategy/recurring/Recurring_limit_limit/undercut/form.png index e9aeb2721..b5bdd5139 100644 Binary files a/e2e/screenshots/strategy/recurring/Recurring_limit_limit/undercut/form.png and b/e2e/screenshots/strategy/recurring/Recurring_limit_limit/undercut/form.png differ diff --git a/e2e/screenshots/strategy/recurring/Recurring_limit_range/create/my-strategy.png b/e2e/screenshots/strategy/recurring/Recurring_limit_range/create/my-strategy.png index 293670ad3..630bdcd34 100644 Binary files a/e2e/screenshots/strategy/recurring/Recurring_limit_range/create/my-strategy.png and b/e2e/screenshots/strategy/recurring/Recurring_limit_range/create/my-strategy.png differ diff --git a/e2e/screenshots/strategy/recurring/Recurring_range_limit/deposit/form.png b/e2e/screenshots/strategy/recurring/Recurring_range_limit/deposit/form.png index 36ca07eb5..f4a6da14f 100644 Binary files a/e2e/screenshots/strategy/recurring/Recurring_range_limit/deposit/form.png and b/e2e/screenshots/strategy/recurring/Recurring_range_limit/deposit/form.png differ diff --git a/e2e/screenshots/strategy/recurring/Recurring_range_range/create/form.png b/e2e/screenshots/strategy/recurring/Recurring_range_range/create/form.png index 7a1714b49..2054f14bc 100644 Binary files a/e2e/screenshots/strategy/recurring/Recurring_range_range/create/form.png and b/e2e/screenshots/strategy/recurring/Recurring_range_range/create/form.png differ diff --git a/e2e/screenshots/strategy/recurring/Recurring_range_range/create/my-strategy.png b/e2e/screenshots/strategy/recurring/Recurring_range_range/create/my-strategy.png index c862baef5..00d78431f 100644 Binary files a/e2e/screenshots/strategy/recurring/Recurring_range_range/create/my-strategy.png and b/e2e/screenshots/strategy/recurring/Recurring_range_range/create/my-strategy.png differ diff --git a/e2e/screenshots/strategy/recurring/Recurring_range_range/deposit/form.png b/e2e/screenshots/strategy/recurring/Recurring_range_range/deposit/form.png index b101b3a0e..ebcc5628d 100644 Binary files a/e2e/screenshots/strategy/recurring/Recurring_range_range/deposit/form.png and b/e2e/screenshots/strategy/recurring/Recurring_range_range/deposit/form.png differ diff --git a/src/components/core/menu/mainMenu/MainMenuRightBurger/useBurgerMenuItems.tsx b/src/components/core/menu/mainMenu/MainMenuRightBurger/useBurgerMenuItems.tsx index 8a2b0cfc8..f587c1a02 100644 --- a/src/components/core/menu/mainMenu/MainMenuRightBurger/useBurgerMenuItems.tsx +++ b/src/components/core/menu/mainMenu/MainMenuRightBurger/useBurgerMenuItems.tsx @@ -53,57 +53,62 @@ export const useBurgerMenuItems = () => { ), }, - { + ]; + if (config.ui.showTerms) { + mainItems.push({ content: ( Terms of Use ), - }, - { + }); + } + if (config.ui.showPrivacy) { + mainItems.push({ content: ( Privacy Policy ), - }, - { - content: ( -
- - - - - - - - - - - - -
- ), - }, - ]; + }); + } + mainItems.push({ + content: ( +
+ + + + + + + + + + + + +
+ ), + }); if (config.ui.currencyMenu) { mainItems.unshift({ subMenu: 'currency', content: , }); } + menuMap.set('main', { items: mainItems }); const currencyItems = useMemo( diff --git a/src/config/blast/common.ts b/src/config/blast/common.ts index 31da3bf3a..a649d9811 100644 --- a/src/config/blast/common.ts +++ b/src/config/blast/common.ts @@ -132,5 +132,7 @@ export const commonConfig: AppConfig = { useGradientBranding: true, tradeCount: false, currencyMenu: false, + showTerms: false, + showPrivacy: false, }, }; diff --git a/src/config/celo/common.ts b/src/config/celo/common.ts index 0c466d085..497fab242 100644 --- a/src/config/celo/common.ts +++ b/src/config/celo/common.ts @@ -143,5 +143,7 @@ export const commonConfig: AppConfig = { useGradientBranding: true, tradeCount: true, currencyMenu: false, + showTerms: true, + showPrivacy: true, }, }; diff --git a/src/config/configSchema.ts b/src/config/configSchema.ts index 04a54e139..6b8b0f8db 100644 --- a/src/config/configSchema.ts +++ b/src/config/configSchema.ts @@ -109,5 +109,7 @@ export const AppConfigSchema = v.object({ useGradientBranding: v.optional(v.boolean()), tradeCount: v.optional(v.boolean()), currencyMenu: v.optional(v.boolean()), + showTerms: v.optional(v.boolean()), + showPrivacy: v.optional(v.boolean()), }), }); diff --git a/src/config/demo/common.ts b/src/config/demo/common.ts new file mode 100644 index 000000000..9d425228d --- /dev/null +++ b/src/config/demo/common.ts @@ -0,0 +1,96 @@ +import { AppConfig } from 'config/types'; + +const addresses = { + ZERO: '0x0000000000000000000000000000000000000000', +}; + +export const commonConfig: AppConfig = { + hidden: true, + mode: 'development', + appName: '', + appUrl: '', + carbonApi: '', + selectedConnectors: ['MetaMask'], + blockedConnectors: [], + walletConnectProjectId: '', + isSimulatorEnabled: false, + policiesLastUpdated: '', + network: { + name: 'Demo Network', + logoUrl: '', + chainId: 0, + blockExplorer: { + name: '', + url: '', + }, + rpc: { + url: import.meta.env.VITE_CHAIN_RPC_URL, + }, + defaultLimitedApproval: true, + gasToken: { + name: '', + symbol: '', + decimals: 18, + address: '', + logoURI: '', + }, + }, + sdk: { + cacheTTL: 0, + }, + defaultTokenPair: ['', ''], + popularPairs: [], + popularTokens: { + base: [], + quote: [], + }, + addresses: { + tokens: addresses, + carbon: { + carbonController: '', + voucher: '', + }, + }, + utils: { + multicall3: { + address: '0x...', + blockCreated: 0, + }, + }, + tokenListOverride: [], + tokenLists: [], + tenderly: { + nativeTokenDonorAccount: '', + faucetAmount: 1000, + faucetTokens: [ + { + donorAccount: '', + tokenContract: '', + decimals: 18, + symbol: '', + }, + { + donorAccount: '', + tokenContract: '', + decimals: 6, + symbol: '', + }, + { + donorAccount: '', + tokenContract: '', + decimals: 6, + symbol: '', + }, + ], + }, + ui: { + priceChart: 'tradingView', + useGradientBranding: false, + tradeCount: false, + currencyMenu: false, + /* ⚠️ If you set it to true, you need to change the content of the page 'src/pages/terms/index.tsx' ⚠️ */ + showTerms: false, + /* ⚠️ If you set it to true, you need to change the content of the page 'src/pages/privacy/index.tsx' ⚠️ */ + showPrivacy: false, + }, +}; diff --git a/src/config/demo/development.ts b/src/config/demo/development.ts new file mode 100644 index 000000000..a3e0ddcae --- /dev/null +++ b/src/config/demo/development.ts @@ -0,0 +1,8 @@ +import { AppConfig } from '../types'; +import { commonConfig } from './common'; + +const config: AppConfig = { + ...commonConfig, + mode: 'development', +}; +export default config; diff --git a/src/config/demo/production.ts b/src/config/demo/production.ts new file mode 100644 index 000000000..4c5725c63 --- /dev/null +++ b/src/config/demo/production.ts @@ -0,0 +1,9 @@ +import { AppConfig } from '../types'; +import { commonConfig } from './common'; + +const config: AppConfig = { + ...commonConfig, + mode: 'production', + sentryDSN: '', +}; +export default config; diff --git a/src/config/ethereum/common.ts b/src/config/ethereum/common.ts index 8d7919c3b..b243f4db2 100644 --- a/src/config/ethereum/common.ts +++ b/src/config/ethereum/common.ts @@ -218,5 +218,7 @@ export const commonConfig: AppConfig = { useGradientBranding: true, tradeCount: false, currencyMenu: true, + showTerms: true, + showPrivacy: true, }, }; diff --git a/src/config/sei/common.ts b/src/config/sei/common.ts index 3ec9d931c..1858fb2f6 100644 --- a/src/config/sei/common.ts +++ b/src/config/sei/common.ts @@ -119,5 +119,7 @@ export const commonConfig: AppConfig = { useGradientBranding: true, tradeCount: true, currencyMenu: false, + showTerms: true, + showPrivacy: true, }, }; diff --git a/src/pages/privacy/index.tsx b/src/pages/privacy/index.tsx index 997e5f635..c0c638651 100644 --- a/src/pages/privacy/index.tsx +++ b/src/pages/privacy/index.tsx @@ -573,6 +573,7 @@ const content = [ ]; export const PrivacyPage = () => { + if (!config.ui.showPrivacy) return; return ( <> diff --git a/src/pages/terms/index.tsx b/src/pages/terms/index.tsx index 5cc93b6f0..42bcf31ea 100644 --- a/src/pages/terms/index.tsx +++ b/src/pages/terms/index.tsx @@ -1052,6 +1052,7 @@ const content = [ ]; export const TermsPage = () => { + if (!config.ui.showTerms) return; return ( <>