Skip to content

Commit

Permalink
remove create pool/deal sections + redirect w/middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
0xlinus committed Aug 1, 2023
1 parent ad43248 commit eb741e7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 64 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
1 change: 1 addition & 0 deletions src/web3/onboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const injected = injectedModule()
const gnosis = gnosisModule()
const walletConnect = walletConnectModule({ projectId: WALLET_CONNECT_PROJECT_ID, version: 2 })
const coinbase = coinbaseModule()
// @ts-ignore
const ledger = ledgerModule({ projectId: WALLET_CONNECT_PROJECT_ID, walletConnectVersion: 2 })
const trezor = trezorModule({
email: EMAIL_CONTACT,
Expand Down

0 comments on commit eb741e7

Please sign in to comment.