fix: update <AppBody /> to allow its intended prop passthrough (#5537)

This commit is contained in:
Jordan Frankfurt 2022-12-05 14:09:54 -06:00 committed by GitHub
parent e8880be1d9
commit e15ccc3c79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 8 deletions

@ -1,11 +1,16 @@
import React from 'react'
import React, { PropsWithChildren } from 'react'
import styled from 'styled-components/macro'
import { Z_INDEX } from 'theme/zIndex'
export const BodyWrapper = styled.main<{ margin?: string; maxWidth?: string }>`
interface BodyWrapperProps {
$margin?: string
$maxWidth?: string
}
export const BodyWrapper = styled.main<BodyWrapperProps>`
position: relative;
margin-top: ${({ margin }) => margin ?? '0px'};
max-width: ${({ maxWidth }) => maxWidth ?? '420px'};
margin-top: ${({ $margin }) => $margin ?? '0px'};
max-width: ${({ $maxWidth }) => $maxWidth ?? '420px'};
width: 100%;
background: ${({ theme }) => theme.backgroundSurface};
border-radius: 16px;
@ -20,6 +25,6 @@ export const BodyWrapper = styled.main<{ margin?: string; maxWidth?: string }>`
/**
* The styled container element that wraps the content of most pages and the tabs.
*/
export default function AppBody({ children, ...rest }: { children: React.ReactNode }) {
return <BodyWrapper {...rest}>{children}</BodyWrapper>
export default function AppBody(props: PropsWithChildren<BodyWrapperProps>) {
return <BodyWrapper {...props} />
}

@ -241,7 +241,7 @@ ${bodyValue}
return (
<Trace page={PageName.VOTE_PAGE} shouldLogImpression>
<PageWrapper>
<AppBody {...{ maxWidth: '800px' }}>
<AppBody $maxWidth="800px">
<CreateProposalTabs />
<CreateProposalWrapper>
<BlueCard>

@ -290,7 +290,7 @@ function Remove({ tokenId }: { tokenId: BigNumber }) {
)}
pendingText={pendingText}
/>
<AppBody>
<AppBody $maxWidth="unset">
<AddRemoveTabs
creating={false}
adding={false}