theme-ui#Container TypeScript Examples
The following examples show how to use
theme-ui#Container.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Section.tsx From use-comments with MIT License | 6 votes |
Section: React.FC<React.ComponentProps<'section'>> = props => (
<section
sx={{
px: [4],
py: [4],
width: '800px',
}}
{...props}
>
<Container>{props.children}</Container>
</section>
)
Example #2
Source File: Root.tsx From nft-market with MIT License | 6 votes |
Root = () => {
return (
<Router basename={process.env.PUBLIC_URL}>
<Header />
<Web3ReactProvider getLibrary={getLibrary}>
<Connect>
<Container>
<Switch>
<PrivateRoute path="/profile" component={Profile} />
<Route exact path="/" component={Marketplace} />
</Switch>
<TransactionProgress />
</Container>
</Connect>
</Web3ReactProvider>
</Router>
)
}
Example #3
Source File: layout.tsx From carlosazaustre.es with MIT License | 5 votes |
Layout = ({ children, className }: LayoutProps) => (
<MDXProvider
components={{ ExternalLink }}
>
<Styled.root data-testid="theme-root">
<Global
styles={css({
"*": {
boxSizing: `inherit`
},
body: {
margin: 0,
padding: 0,
boxSizing: `border-box`,
textRendering: `optimizeLegibility`,
borderTop: `10px solid #FBCF65`
},
"::selection": {
backgroundColor: `secondary`,
color: `white`
},
a: {
transition: `all 0.3s ease-in-out`,
color: `#FFB934` }
})}
/>
<SEO />
<SkipNavLink>Ver contenido</SkipNavLink>
<Container css={css`
background-color: #fff;
margin: 0 auto;
padding: 0.5rem 1.5rem;
margin-top: 1em;
max-width: 1024px;
`}>
<Header />
<div id="skip-nav" css={css({ ...CodeStyles })} className={className}>
{children}
</div>
<Footer />
</Container>
</Styled.root>
</MDXProvider>
)
Example #4
Source File: Connect.tsx From nft-market with MIT License | 5 votes |
Connect: FC = ({ children }) => {
const { activatingConnector } = useAppState()
const { library, chainId, account, error } = useWeb3React()
const { setContract, setUser } = useAppState(
useCallback(
({ setContract, setUser }) => ({
setContract,
setUser,
}),
[]
)
)
useSWR(ETHSCAN_API, fetcherETHUSD)
useEffect(() => {
if (!chainId || !account || !library) return
const update = async () => {
try {
await setContract(library, chainId)
setUser(account)
} catch (e) {
console.log(e)
}
}
update()
}, [chainId, account, library, setContract, setUser])
const triedEager = useEagerConnect()
useInactiveListener(!triedEager || !!activatingConnector)
return (
<>
{error ? (
<Container>
<Heading as="h2">❌ Something is not right</Heading>
<Text sx={{ mt: 3 }}>{getErrorMessage(error)}</Text>
</Container>
) : (
children
)}
</>
)
}