Skip to content

Commit

Permalink
Hide pool deal creation + disable participation buttons (#1066)
Browse files Browse the repository at this point in the history
* Fix Lizards header on mobile (#1033)

* attempt to fix CI issue (#1009)

* Stats see more button redirects to pools filtered by network as well (#1004)

* Stats see more button redirects to pools filtered by network as well

* Remove unused sponsors/List component

---------

Co-authored-by: Atatakai <[email protected]>

* Add CONTRIBUTING.md (#1023)

* Use IPFS Gateway as default option to get Merkle tree data (#1028)

* Remove jest warnings issues (#1026)

* Add Sepolia network (#1029)

* Add Ethlizards theme (#1025)

* ethlizards design  (#955)

* add ethliz theme

* fix blur effect

* fix background

* add pool ethlizards screen

* fix review

* fix modal and gradients

* add ethlizrd logo

* update logo

* fix merge conflict

* Ethlizards theme improvements

* change ETHLIZARDS_VOUCHER_ENS value

* Fix weird CI issue

* tidy up

* design improvements

* tidy up

* tidy up

* remove stake section from sidebar

* Add lizards to pool/deal creation boxes

---------

Co-authored-by: James <[email protected]>

* Bring Stake section back to the Sidebar (#1027)

* remove stake section from sidebar

* Sidebar - stake rollback

* Fix Lizards header on mobile (#1032)

---------

Co-authored-by: Tanya <[email protected]>
Co-authored-by: Atatakai <[email protected]>
Co-authored-by: Dmitry <[email protected]>
Co-authored-by: James <[email protected]>

* Staging into main (#1037)

* attempt to fix CI issue (#1009)

* Stats see more button redirects to pools filtered by network as well (#1004)

* Stats see more button redirects to pools filtered by network as well

* Remove unused sponsors/List component

---------

Co-authored-by: Atatakai <[email protected]>

* Add CONTRIBUTING.md (#1023)

* Use IPFS Gateway as default option to get Merkle tree data (#1028)

* Remove jest warnings issues (#1026)

* Add Sepolia network (#1029)

* Add Ethlizards theme (#1025)

* ethlizards design  (#955)

* add ethliz theme

* fix blur effect

* fix background

* add pool ethlizards screen

* fix review

* fix modal and gradients

* add ethlizrd logo

* update logo

* fix merge conflict

* Ethlizards theme improvements

* change ETHLIZARDS_VOUCHER_ENS value

* Fix weird CI issue

* tidy up

* design improvements

* tidy up

* tidy up

* remove stake section from sidebar

* Add lizards to pool/deal creation boxes

---------

Co-authored-by: James <[email protected]>

* Bring Stake section back to the Sidebar (#1027)

* remove stake section from sidebar

* Sidebar - stake rollback

* Fix Lizards header on mobile (#1032)

* Lizards theme - Fix background image (#1034)

* Lizards theme - Fix background image

* fix grammar

* change gas price (#1036)

---------

Co-authored-by: Tanya <[email protected]>
Co-authored-by: Atatakai <[email protected]>
Co-authored-by: Dmitry <[email protected]>
Co-authored-by: James <[email protected]>

* change endpoint and format handling (#1065)

Co-authored-by: Linuz <[email protected]>

* remove create pool/deal sections + redirect w/middleware

* disabled pool/deal participation buttons

---------

Co-authored-by: saeta.eth <[email protected]>
Co-authored-by: Tanya <[email protected]>
Co-authored-by: Atatakai <[email protected]>
Co-authored-by: Dmitry <[email protected]>
Co-authored-by: James <[email protected]>
Co-authored-by: alextheboredape <[email protected]>
  • Loading branch information
7 people committed Aug 7, 2023
1 parent 16de4f5 commit 7450f98
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 118 deletions.
10 changes: 10 additions & 0 deletions middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { NextResponse } from 'next/server'
import type { NextRequest } from 'next/server'

export function middleware(request: NextRequest) {
const url = request.nextUrl.clone()
if (url.pathname === '/pool/create' || url.pathname === '/deal/create') {
url.pathname = '/'
return NextResponse.redirect(url)
}
}
64 changes: 0 additions & 64 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,15 @@
import type { NextPage } from 'next'
import Head from 'next/head'
import { useRouter } from 'next/router'
import styled from 'styled-components'

import { LeftSidebarLayout } from '@/src/components/layout/LeftSidebarLayout'
import { ListWithFilters } from '@/src/components/pools/list/ListWithFilters'
import { VouchedPools } from '@/src/components/pools/list/Vouched'
import { ButtonType } from '@/src/components/pureStyledComponents/buttons/Button'
import { SectionIntro as BaseSectionIntro } from '@/src/components/section/SectionIntro'
import { ThemeType } from '@/src/constants/types'
import useAelinUser from '@/src/hooks/aelin/useAelinUser'
import { useThemeContext } from '@/src/providers/themeContextProvider'
import { useWeb3Connection } from '@/src/providers/web3ConnectionProvider'

const Container = styled.div`
display: flex;
flex-direction: row;
width: 100%;
gap: 1.5rem;
`

const SectionIntro = styled(BaseSectionIntro)`
display: flex;
flex-direction: column;
flex: 1 1 0px;
justify-content: space-between;
@media (min-width: ${({ theme }) => theme.themeBreakPoints.tabletPortraitStart}) {
max-height: 260px;
}
`

const Home: NextPage = () => {
const router = useRouter()
const { address } = useWeb3Connection()
const { data: userResponse } = useAelinUser(address)

Expand All @@ -46,47 +23,6 @@ const Home: NextPage = () => {
<title>Aelin - Pools List</title>
</Head>
<LeftSidebarLayout>
<Container>
<SectionIntro
backgroundImage={
isLizardTheme ? `/resources/lizards/violet-lizard.png` : `/resources/svg/bg-deals.svg`
}
backgroundPosition="100% 110%"
backgroundSize={isLizardTheme ? '100px 85px' : 'auto auto'}
button={[
{
title: 'Create deal',
onClick: () => router.push('/deal/create'),
type: ButtonType.Secondary,
},
]}
title="Deals"
>
Direct Deals are for new and established protocols looking to raise capital from
investors at pre-established deal terms. Aelin Deals allow for customizable features,
such as a defined vesting period and a vesting cliff.
</SectionIntro>
<SectionIntro
backgroundImage={
isLizardTheme ? `/resources/lizards/green-lizard.png` : `/resources/svg/bg-pools.svg`
}
backgroundPosition={isLizardTheme ? '100% 100%' : '100% 120px'}
backgroundSize={isLizardTheme ? '100px 85px' : 'auto auto'}
button={[
{
title: 'Create pool',
onClick: () => router.push('/pool/create'),
type: ButtonType.Primary,
},
]}
title="Pools"
>
Pools are for protocols/sponsors that don't have set deal terms yet but are gauging
investor interest. Pools are best suited for protocols without a set target valuation
and sponsors using Aelin to source a future deal. Aelin Pools are most similar to SPACs.
</SectionIntro>
</Container>

<VouchedPools />
{!isLizardTheme && <ListWithFilters userPoolsInvested={userResponse?.poolsInvested} />}
</LeftSidebarLayout>
Expand Down
12 changes: 1 addition & 11 deletions src/components/pools/actions/AcceptDeal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,7 @@ function AcceptDeal({ pool }: Props) {
setValue={setTokenInputValue}
value={tokenInputValue}
/>
<ButtonGradient
disabled={
!address ||
!isAppConnected ||
isSubmitting ||
!tokenInputValue ||
BigNumber.from(tokenInputValue).eq(0) ||
Boolean(inputError)
}
onClick={handleAcceptDeal}
>
<ButtonGradient disabled={true} onClick={handleAcceptDeal}>
Accept deal
</ButtonGradient>
</Wrapper>
Expand Down
7 changes: 1 addition & 6 deletions src/components/pools/actions/Approve.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,7 @@ export default function Approve({
{allowance && symbol && <Allowance allowance={allowance} symbol={symbol} />}
<Contents>{description}</Contents>
<ButtonsWrapper>
<ButtonGradient
disabled={
!address || !isAppConnected || isSubmitting || noEnoughBalance || !userBalance?.gt(0)
}
onClick={approveInvestmentToken}
>
<ButtonGradient disabled={true} onClick={approveInvestmentToken}>
Approve
</ButtonGradient>
</ButtonsWrapper>
Expand Down
18 changes: 4 additions & 14 deletions src/components/pools/actions/Deposit/Deposit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,23 +222,13 @@ function Deposit({ pool, poolHelpers }: Props) {
/>
)}
<ButtonsWrapper>
<ButtonGradient
disabled={
!address ||
!isAppConnected ||
poolHelpers.capReached ||
isSubmitting ||
!tokenInputValue ||
Boolean(inputError) ||
(pool.hasNftList && !hasStoredSelectedNft) ||
isHiddenPool(pool.address)
}
onClick={depositTokens}
>
<ButtonGradient disabled={true} onClick={depositTokens}>
Deposit
</ButtonGradient>
{pool.hasNftList && (
<ButtonGradient onClick={handleOpenNftSelectionModal}>Select NFT</ButtonGradient>
<ButtonGradient disabled={true} onClick={handleOpenNftSelectionModal}>
Select NFT
</ButtonGradient>
)}
</ButtonsWrapper>
</>
Expand Down
15 changes: 4 additions & 11 deletions src/components/pools/actions/Deposit/DepositDirectDeal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,24 +275,17 @@ function DepositDirectDeal({ pool, poolHelpers }: Props) {

<ButtonsWrapper>
<ButtonGradient
disabled={
!address ||
!isAppConnected ||
poolHelpers.capReached ||
isSubmitting ||
!tokenInputValue ||
Boolean(inputError) ||
(pool.hasNftList && !hasStoredSelectedNft) ||
isHiddenPool(pool.address)
}
disabled={true}
onClick={() => {
depositTokens()
}}
>
{pool?.upfrontDeal ? 'Accept Deal' : 'Deposit'}
</ButtonGradient>
{pool.hasNftList && (
<ButtonGradient onClick={handleOpenNftSelectionModal}>Select NFT</ButtonGradient>
<ButtonGradient disabled={true} onClick={handleOpenNftSelectionModal}>
Select NFT
</ButtonGradient>
)}
</ButtonsWrapper>
</>
Expand Down
5 changes: 1 addition & 4 deletions src/components/pools/actions/HolderDeposit/HolderDeposit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ function HolderDeposit({ pool }: Props) {
return (
<>
<ButtonsWrapper>
<ButtonGradient
disabled={!isAppConnected || isSubmitting || disabledAfterDeposit || noEnoughBalance}
onClick={depositTokens}
>
<ButtonGradient disabled={true} onClick={depositTokens}>
Fund Deal
</ButtonGradient>
</ButtonsWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ function HolderDepositUpfrontDeal({ pool }: Props) {
return (
<>
<ButtonsWrapper>
<ButtonGradient
disabled={!isAppConnected || isSubmitting || disabledAfterDeposit || noEnoughBalance}
onClick={depositTokens}
>
<ButtonGradient disabled={true} onClick={depositTokens}>
Fund Deal
</ButtonGradient>
</ButtonsWrapper>
Expand Down
5 changes: 1 addition & 4 deletions src/components/pools/actions/Vouch/Vouch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,7 @@ const Vouch: React.FC<{ pool: ParsedAelinPool }> = genericSuspense(({ pool }) =>
<>Vouching not supported</>
)}
</Contents>
<VouchButton
disabled={!userAddress || isSubmitting || !supportsVouch || wrongNetwork}
onClick={handleVouchClick}
>
<VouchButton disabled={true} onClick={handleVouchClick}>
{hasVouched ? 'Disavow' : 'Vouch'}
</VouchButton>
<SeeAllButton disabled={!supportsVouch} onClick={handleOpenVouchersModal}>
Expand Down

0 comments on commit 7450f98

Please sign in to comment.