Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

blur bg on err pages #1829

Merged
merged 6 commits into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 34 additions & 26 deletions src/custom/components/ErrorBoundary/ErrorBoundaryMod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,29 @@ import { userAgent } from '@src/utils/userAgent'
import { AutoRow } from 'components/Row'
import { MEDIA_WIDTHS } from '@src/theme'
import CowError from 'assets/cow-swap/CowError.png'
import { UniIcon, LogoImage } from '../Header'
import { HeaderRow } from 'components/Header/HeaderMod'
import Footer from 'components/Footer'

const AppWrapper = styled.div`
display: flex;
flex-flow: column;
align-items: center;
min-height: 100vh;
overflow-x: hidden;
&:after {
content: '';
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
filter: blur(20px);
backdrop-filter: blur(20px);
background-image: ${({ theme }) => theme.body.background};
transition: 0.5s;
z-index: -1;
}
`

const Wrapper = styled(Page)`
Expand Down Expand Up @@ -56,33 +72,19 @@ const HeaderWrapper = styled.div`
position: fixed;
top: 0;
z-index: 2;
padding: 16px;
@media screen and (max-width: ${MEDIA_WIDTHS.upToSmall}px) {
position: relative;
}
`

export const LogoImage = styled.img.attrs((props) => ({
src: props.theme.logo.src,
// alt: props.theme.logo.alt,
// width: props.theme.logo.width,
// height: props.theme.logo.height,
}))`
object-fit: contain;

${({ theme }) => theme.mediaWidth.upToSmall`
width: 150px;
`};
const FooterWrapper = styled(HeaderWrapper)`
z-index: 1;
flex-grow: 1;
width: 100%;
position: relative;
top: auto;
`

const CowLogo = styled.div`
display: flex;
margin: 1rem;
transition: transform 0.3s ease;

&:hover {
transform: rotate(-5deg);
}
`
const CodeBlockWrapper = styled.div`
background: ${({ theme }) => theme.bg4};
overflow: auto;
Expand Down Expand Up @@ -135,17 +137,20 @@ export default class ErrorBoundary extends Component<unknown, ErrorBoundaryState
}

render() {
document.body.classList.remove('noScroll')
const { error } = this.state
if (error !== null) {
const encodedBody = encodeURIComponent(issueBody(error))
return (
<AppWrapper>
<HeaderWrapper>
<a href=".">
<CowLogo>
<LogoImage />
</CowLogo>
</a>
<HeaderRow marginRight="0">
<a href=".">
<UniIcon>
<LogoImage />
</UniIcon>
</a>
</HeaderRow>
</HeaderWrapper>
<Wrapper>
<FlexContainer>
Expand Down Expand Up @@ -187,6 +192,9 @@ export default class ErrorBoundary extends Component<unknown, ErrorBoundaryState
</AutoRow>
</AutoColumn>
</Wrapper>
<FooterWrapper>
<Footer />
</FooterWrapper>
</AppWrapper>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/custom/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export const LogoImage = styled.div`
}
`

const UniIcon = styled.div`
export const UniIcon = styled.div`
display: flex;
position: relative;
transition: transform 0.3s ease;
Expand Down
4 changes: 4 additions & 0 deletions src/custom/pages/games/CowRunner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ const Wrapper = styled(Page)`
`

export default function CowRunnerPage() {
if (0 === 0) {
throw new Error('This cow is dropping some serious milk 🥛!!')
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remember to remove this before merging!

return (
<Wrapper>
<p>
Expand Down