Skip to content

Commit

Permalink
Merge pull request #12 from celo-tools/1.3.1
Browse files Browse the repository at this point in the history
1.3.1 - Re-enable WalletConnect
  • Loading branch information
jmrossy committed Jan 31, 2022
2 parents 7100071 + 8597533 commit 68630ad
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 656 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@celo-tools/mento-fi",
"version": "1.3.0",
"version": "1.3.1",
"description": "A simple DApp for Celo Mento exchanges",
"keywords": [
"Celo",
Expand All @@ -25,7 +25,7 @@
"lint": "eslint ."
},
"dependencies": {
"@celo-tools/use-contractkit": "^2.1.2",
"@celo-tools/use-contractkit": "3.0.0-beta",
"@ethersproject/abi": "^5.5.0",
"@ethersproject/address": "^5.5.0",
"@metamask/inpage-provider": "6.0.1",
Expand Down
38 changes: 18 additions & 20 deletions src/features/chart/PriceChartCelo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,24 @@ export function PriceChartCelo(props: PriceChartProps) {
if (network?.chainId !== Mainnet.chainId) return null

return (
<div className="mb-12 ml-10">
<FloatingBox width="w-96" classes={`overflow-hidden ${containerClasses}`}>
<div className="flex justify-between">
<h2 className="text-md font-medium pl-3 py-1">CELO Price (USD)</h2>
{/* TODO duration toggle */}
<div></div>
</div>
<div className={`-ml-6 -mr-4 -my-1 ${styles.priceChartContainer}`}>
<ReactFrappeChart
type="line"
colors={chartConfig.colors}
height={chartHeight}
axisOptions={chartConfig.axis}
tooltipOptions={chartConfig.tooltipOptions}
// @ts-ignore TODO find issue, works in Celo Wallet
data={chartData}
/>
</div>
</FloatingBox>
</div>
<FloatingBox width="w-96" classes={`overflow-hidden ${containerClasses}`}>
<div className="flex justify-between">
<h2 className="text-md font-medium pl-3 py-1">CELO Price (USD)</h2>
{/* TODO duration toggle */}
<div></div>
</div>
<div className={`-ml-6 -mr-4 -my-1 ${styles.priceChartContainer}`}>
<ReactFrappeChart
type="line"
colors={chartConfig.colors}
height={chartHeight}
axisOptions={chartConfig.axis}
tooltipOptions={chartConfig.tooltipOptions}
// @ts-ignore TODO find issue, works in Celo Wallet
data={chartData}
/>
</div>
</FloatingBox>
)
}

Expand Down
1 change: 1 addition & 0 deletions src/features/swap/SwapForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ function SwapFormInputs(props: FormInputProps) {
id="fromAmount"
name="fromAmount"
type="number"
step="any"
placeholder="0.00"
className="w-36 pt-1 bg-transparent text-right text-xl font-mono focus:outline-none"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/layout/HeadMeta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function HeadMeta({ pathName }: { pathName: string }) {
return (
<Head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{`Mento [BETA] | ${getHeadTitle(pathName)}`}</title>
<title>{`Mento | ${getHeadTitle(pathName)}`}</title>
</Head>
)
}
Expand Down
16 changes: 1 addition & 15 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ContractKitProvider, Mainnet } from '@celo-tools/use-contractkit'
import { defaultScreens } from '@celo-tools/use-contractkit/lib/screens'
import '@celo-tools/use-contractkit/lib/styles.css'
import PersistWrapper from 'next-persist/lib/NextPersistWrapper'
import type { AppProps } from 'next/app'
Expand All @@ -22,15 +21,6 @@ const dAppConfig = {
icon: `${config.url}/logo.svg`,
}

// TODO removing all WalletConnect options until WC v1 / v2 issues are sorted
const screensWithoutWalletConnect = { ...defaultScreens }
const keysToRemove = ['Valora', 'Celo Wallet', 'Celo Terminal', 'CeloDance', 'WalletConnect']
// @ts-ignore
keysToRemove.forEach((k) => delete screensWithoutWalletConnect[k])
const connectModalProps = {
screens: screensWithoutWalletConnect,
}

const nextPersistConfig = {
method: 'localStorage',
allowList: {
Expand All @@ -53,11 +43,7 @@ export default function App({ Component, pageProps, router }: AppProps) {
<SafeHydrate>
<Provider store={store}>
<PersistWrapperTypeFixed wrapperConfig={nextPersistConfig}>
<ContractKitProvider
dapp={dAppConfig}
network={Mainnet}
connectModal={connectModalProps}
>
<ContractKitProvider dapp={dAppConfig} network={Mainnet}>
<AppLayout pathName={pathName}>
<Component {...pageProps} />
</AppLayout>
Expand Down
4 changes: 1 addition & 3 deletions src/pages/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ export default function AboutPage() {
</TextLink>
.
</p>
<p className="mt-4 text-xs text-center">{`Version: ${
config.version || 'Unknown'
} [BETA]`}</p>
<p className="mt-4 text-xs text-center">{`Version: ${config.version || 'Unknown'}`}</p>
</FloatingBox>
</div>
)
Expand Down
4 changes: 3 additions & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export default function SwapPage() {
{!formValues ? <SwapForm /> : <SwapConfirm formValues={formValues} />}
</div>
{config.showPriceChart && showChart && (
<PriceChartCelo stableTokenId={NativeTokenId.cUSD} height={265} />
<div className="mb-12 md:ml-10">
<PriceChartCelo stableTokenId={NativeTokenId.cUSD} height={265} />
</div>
)}
</div>
)
Expand Down
9 changes: 9 additions & 0 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
@tailwind components;
@tailwind utilities;

/*
Normalization
=============
*/
a {
outline: none;
}


/*
Responsiveness
==============
Expand Down
Loading

1 comment on commit 68630ad

@vercel
Copy link

@vercel vercel bot commented on 68630ad Jan 31, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.