Commit e15ccc3c authored by Jordan Frankfurt's avatar Jordan Frankfurt Committed by GitHub

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

parent e8880be1
import React from 'react' import React, { PropsWithChildren } from 'react'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { Z_INDEX } from 'theme/zIndex' 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; position: relative;
margin-top: ${({ margin }) => margin ?? '0px'}; margin-top: ${({ $margin }) => $margin ?? '0px'};
max-width: ${({ maxWidth }) => maxWidth ?? '420px'}; max-width: ${({ $maxWidth }) => $maxWidth ?? '420px'};
width: 100%; width: 100%;
background: ${({ theme }) => theme.backgroundSurface}; background: ${({ theme }) => theme.backgroundSurface};
border-radius: 16px; border-radius: 16px;
...@@ -20,6 +25,6 @@ export const BodyWrapper = styled.main<{ margin?: string; maxWidth?: string }>` ...@@ -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. * The styled container element that wraps the content of most pages and the tabs.
*/ */
export default function AppBody({ children, ...rest }: { children: React.ReactNode }) { export default function AppBody(props: PropsWithChildren<BodyWrapperProps>) {
return <BodyWrapper {...rest}>{children}</BodyWrapper> return <BodyWrapper {...props} />
} }
...@@ -241,7 +241,7 @@ ${bodyValue} ...@@ -241,7 +241,7 @@ ${bodyValue}
return ( return (
<Trace page={PageName.VOTE_PAGE} shouldLogImpression> <Trace page={PageName.VOTE_PAGE} shouldLogImpression>
<PageWrapper> <PageWrapper>
<AppBody {...{ maxWidth: '800px' }}> <AppBody $maxWidth="800px">
<CreateProposalTabs /> <CreateProposalTabs />
<CreateProposalWrapper> <CreateProposalWrapper>
<BlueCard> <BlueCard>
......
...@@ -290,7 +290,7 @@ function Remove({ tokenId }: { tokenId: BigNumber }) { ...@@ -290,7 +290,7 @@ function Remove({ tokenId }: { tokenId: BigNumber }) {
)} )}
pendingText={pendingText} pendingText={pendingText}
/> />
<AppBody> <AppBody $maxWidth="unset">
<AddRemoveTabs <AddRemoveTabs
creating={false} creating={false}
adding={false} adding={false}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment