Skip to content

Commit

Permalink
feat: added a 404 page
Browse files Browse the repository at this point in the history
  • Loading branch information
avneesh0612 committed Jan 8, 2022
1 parent 3144d48 commit 1060459
Show file tree
Hide file tree
Showing 11 changed files with 873 additions and 29 deletions.
3 changes: 3 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"baseUrl": "http://localhost:3000"
}
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
5 changes: 5 additions & 0 deletions cypress/integration/sample_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe("My First Test", () => {
it("Does not do much!", () => {
expect(true).to.equal(true);
});
});
22 changes: 22 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

/**
* @type {Cypress.PluginConfig}
*/
// eslint-disable-next-line no-unused-vars
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}
25 changes: 25 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
20 changes: 20 additions & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
Binary file added cypress/videos/sample_spec.js.mp4
Binary file not shown.
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
images: {
domains: ["res.cloudinary.com", "cdn.hashnode.com"],
domains: ["res.cloudinary.com", "cdn.hashnode.com", "i.ytimg.com"],
},
};
25 changes: 14 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"release:patch": "standard-version --release-as patch",
"release:major": "standard-version --release-as major",
"format": "prettier --write \"{components,content,docs,pages,styles,utils}/**/*.{js,jsx,ts,tsx,css,scss,json,yaml,md}\"",
"format:check": "prettier --check \"{components,content,docs,pages,styles,utils}/**/*.{js,jsx,ts,tsx,css,scss,json,yaml,md}\""
"format:check": "prettier --check \"{components,content,docs,pages,styles,utils}/**/*.{js,jsx,ts,tsx,css,scss,json,yaml,md}\"",
"cypress:open": "cypress open",
"cypress:run": "cypress run"
},
"dependencies": {
"aos": "^3.0.0-beta.6",
Expand All @@ -27,24 +29,25 @@
"react-scroll": "^1.8.4"
},
"devDependencies": {
"@commitlint/cli": "^16.0.1",
"@commitlint/config-conventional": "^16.0.0",
"@types/aos": "^3.0.4",
"@types/react": "^17.0.38",
"@types/react-scroll": "^1.8.3",
"autoprefixer": "^10.4.2",
"postcss": "^8.4.5",
"tailwindcss": "^3.0.12",
"typescript": "^4.5.4",
"@commitlint/cli": "^16.0.1",
"@commitlint/config-conventional": "^16.0.0",
"husky": "^7.0.4",
"prettier": "^2.5.1",
"standard-version": "^9.3.2",
"cypress": "^9.2.0",
"eslint": "^8.6.0",
"eslint-config-next": "^12.0.7",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-tailwind": "^0.2.1",
"eslint-plugin-tailwindcss": "^3.0.4"
"eslint-plugin-tailwindcss": "^3.0.4",
"husky": "^7.0.4",
"postcss": "^8.4.5",
"prettier": "^2.5.1",
"standard-version": "^9.3.2",
"tailwindcss": "^3.0.12",
"typescript": "^4.5.4"
},
"version": "1.1.0"
}
}
21 changes: 21 additions & 0 deletions pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Image from "next/image";

const customError: React.FC = () => {
return (
<div className="flex flex-col items-center justify-center w-screen h-screen">
<h2 className="mb-5 text-2xl font-semibold">Why are you here?</h2>

<a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ">
<Image
objectFit="contain"
width={500}
height={300}
src="https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg"
alt=""
/>
</a>
</div>
);
};

export default customError;
Loading

1 comment on commit 1060459

@vercel
Copy link

@vercel vercel bot commented on 1060459 Jan 8, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.