Skip to content

Commit

Permalink
fix: readme and T&C visibility (#17)
Browse files Browse the repository at this point in the history
* fix: readme and T&C visibility
  • Loading branch information
Argeare5 authored Oct 2, 2023
1 parent 434f0e4 commit 3989eb8
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 21 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
NEXT_PUBLIC_DEPLOY_FOR_IPFS=false
NEXT_PUBLIC_DEPLOY_FOR_IPFS=false
NEXT_PUBLIC_TERMS_AND_CONDITIONS_VISIBLE=false
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,9 @@ React application to interact with the Aave Governance V3 smart contracts: visua
First run:

```sh
git submodule init
git submodule update --remote --init
yarn

yarn dev
yarn && yarn dev
// or
yarn build && yarn start
yarn && yarn build && yarn start
```

After the first run:
Expand All @@ -47,12 +43,6 @@ yarn dev
yarn build && yarn start
```

For submodules update:

```sh
git submodule update --remote --init
```

### Deploy your own Vercel instance

You can deploy your version of the application using Vercel just by clicking on the following button, and following the instructions:
Expand Down
4 changes: 2 additions & 2 deletions src/ui/layouts/AppHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React, { useEffect, useRef, useState } from 'react';
import Logo from '/public/images/logo.svg';

import { useStore } from '../../store';
import { isForIPFS } from '../../utils/appConfig';
import { isForIPFS, isTermsAndConditionsVisible } from '../../utils/appConfig';
import { WalletWidget } from '../../web3/components/wallet/WalletWidget';
import { BoxWith3D } from '../components/BoxWith3D';
import { Link } from '../components/Link';
Expand Down Expand Up @@ -473,7 +473,7 @@ export function AppHeader() {
)}
</React.Fragment>
))}
{!isForIPFS && (
{!isForIPFS && isTermsAndConditionsVisible && (
<Box
component="button"
type="button"
Expand Down
4 changes: 2 additions & 2 deletions src/ui/layouts/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React, { useEffect } from 'react';

import { RepresentationInfoModal } from '../../representations/components/RepresentationInfoModal';
import { useStore } from '../../store';
import { isForIPFS } from '../../utils/appConfig';
import { isForIPFS, isTermsAndConditionsVisible } from '../../utils/appConfig';
import Web3HelperProvider from '../../web3/providers/Web3HelperProvider';
import Web3Provider from '../../web3/providers/Web3Provider';
import { TermsAndConditionsModal } from '../components/TermsAndConditionsModal';
Expand Down Expand Up @@ -39,7 +39,7 @@ export default function AppLayout({ children }: { children: React.ReactNode }) {
<HelpModalProvider />
<RepresentationInfoModal />

{!isForIPFS && (
{!isForIPFS && isTermsAndConditionsVisible && (
<>
<TermsAndConditionsModal />
<TermsPreAppModal />
Expand Down
4 changes: 2 additions & 2 deletions src/ui/layouts/SettingsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import SettingsIcon from '/public/images/icons/settings.svg';
import SettingsBordersIcon from '/public/images/icons/settingsBorders.svg';

import { useStore } from '../../store';
import { isForIPFS } from '../../utils/appConfig';
import { isForIPFS, isTermsAndConditionsVisible } from '../../utils/appConfig';
import { BoxWith3D, Divider, ThemeSwitcher } from '../';
import { IconBox } from '../primitives/IconBox';
import { texts } from '../utils/texts';
Expand Down Expand Up @@ -122,7 +122,7 @@ export function SettingsButton() {
</Box>
<Divider sx={{ my: 10 }} />
<ThemeSwitcher />
{!isForIPFS && (
{!isForIPFS && isTermsAndConditionsVisible && (
<>
<Divider sx={{ my: 10 }} />
<Box
Expand Down
8 changes: 6 additions & 2 deletions src/ui/store/uiSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { produce } from 'immer';

import { DelegateItem } from '../../delegate/types';
import { TransactionsSlice } from '../../transactions/store/transactionsSlice';
import { isForIPFS } from '../../utils/appConfig';
import { isForIPFS, isTermsAndConditionsVisible } from '../../utils/appConfig';
import { getDelegateData } from '../helpModals/getDelegateData';
import { getProposalData } from '../helpModals/getProposalData';
import {
Expand Down Expand Up @@ -199,7 +199,11 @@ export const createUISlice: StoreSlice<

isAppBlockedByTerms: false,
checkIsAppBlockedByTerms: () => {
if (localStorage?.getItem('termsAccept') !== 'true' && !isForIPFS) {
if (
localStorage?.getItem('termsAccept') !== 'true' &&
!isForIPFS &&
isTermsAndConditionsVisible
) {
set({ isAppBlockedByTerms: true });
} else {
set({ isAppBlockedByTerms: false });
Expand Down
2 changes: 2 additions & 0 deletions src/utils/appConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { StaticJsonRpcBatchProvider } from '@bgd-labs/frontend-web3-utils/src/ut
import { chainInfoHelper } from './configs';

export const isForIPFS = process.env.NEXT_PUBLIC_DEPLOY_FOR_IPFS === 'true';
export const isTermsAndConditionsVisible =
process.env.NEXT_PUBLIC_TERMS_AND_CONDITIONS_VISIBLE === 'true';

export const coreName: CoreNetworkName = 'mainnet';
export const WC_PROJECT_ID = 'e6ed0c48443e54cc875462bbaec6e3a7'; // https://docs.walletconnect.com/2.0/cloud/relay
Expand Down

1 comment on commit 3989eb8

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit was deployed on ipfs

Please sign in to comment.