Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace all styling with Tailwind css on ErrorDisplay page #1736

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Converted all the css to tailwind css of ErrorDisplay page
  • Loading branch information
subhajit20 committed Sep 18, 2023
commit 42bf6db71cfc073e13cb16ac00ac39401269c433
12 changes: 7 additions & 5 deletions components/ErrorDisplay/ErrorDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ function ErrorDisplay({ statusCode }) {
<meta name="robots" content="noindex, nofollow" key={statusCode} />
</Head>

<div className={styles.ErrorDisplay}>
<div className={styles.bg}>
<div className={styles.textContainer}>
<h1 className={styles.title}>{statusCode || 'Oh no'}!</h1>
<p className={styles.paragraph}>
<div className={`${styles.ErrorDisplay} bg-[#121212] w-[100% h-[100%]`}>
<div
className={`${styles.bg} bg-[url("/static/images/TankFlip.gif")] md:h[100vh] flex flex-col justify-center w-[100%] text-white bg-cover items-center`}
>
<div className="text-center m-[1rem]">
<h1 className="text-[4rem]">{statusCode || 'Oh no'}!</h1>
<p className="text-[1.4rem]">
We&apos;re so ashamed. You definitely weren&apos;t supposed to see this...
</p>
</div>
Expand Down
34 changes: 0 additions & 34 deletions components/ErrorDisplay/ErrorDisplay.module.css
Original file line number Diff line number Diff line change
@@ -1,37 +1,3 @@
.ErrorDisplay {
background: #121212;
height: 100%;
width: 100%;
}

.ErrorDisplay .bg {
align-items: center;
background-image: url("/static/images/TankFlip.gif");
background-size: cover;
background-position-x: center;
color: white;
display: flex;
flex-direction: column;
justify-content: center;
width: 100%;
height: calc(100vh - 390px);
}

@media screen and (--medium-viewport) {
.ErrorDisplay .bg {
height: 100vh;
}
}

.textContainer {
text-align: center;
margin: 1rem auto;
}

.title {
font-size: 4rem;
}

.paragraph {
font-size: 1.4rem;
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,49 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`ErrorDisplay should render with just Received props 1`] = `
<div
className="ErrorDisplay bg-[#121212] w-[100% h-[100%]"
>
<div
className="bg bg-[url("/static/images/TankFlip.gif")] md:h[100vh] flex flex-col justify-center w-[100%] text-white bg-cover items-center"
>
<div
className="text-center m-[1rem]"
>
<h1
className="text-[4rem]"
>
404
!
</h1>
<p
className="text-[1.4rem]"
>
We're so ashamed. You definitely weren't supposed to see this...
</p>
</div>
</div>
</div>
`;

exports[`ErrorDisplay should render with just required props 1`] = `
<div
className="ErrorDisplay"
className="ErrorDisplay bg-[#121212] w-[100% h-[100%]"
>
<div
className="bg"
className="bg bg-[url(\\"/static/images/TankFlip.gif\\")] md:h[100vh] flex flex-col justify-center w-[100%] text-white bg-cover items-center"
>
<div
className="textContainer"
className="text-center m-[1rem]"
>
<h1
className="title"
className="text-[4rem]"
>
404
!
</h1>
<p
className="paragraph"
className="text-[1.4rem]"
>
We're so ashamed. You definitely weren't supposed to see this...
</p>
Expand Down
6 changes: 6 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ module.exports = {
'./src/**/*.{js,ts,jsx,tsx,mdx}',
],
theme: {
screens: {
sm: '576px',
md: '768px',
lg: '992px',
xl: '1200px',
},
extend: {},
},
plugins: [],
Expand Down