Skip to content

Commit

Permalink
Completed Hero section (#67)
Browse files Browse the repository at this point in the history
* Completed Hero section

* Done with snapshot testing

* added a missing dependency for snapshot testing

Co-authored-by: allan <[email protected]>
  • Loading branch information
Imanzuher and AllanSaleh authored Oct 26, 2022
1 parent 9a50adf commit 3304666
Show file tree
Hide file tree
Showing 8 changed files with 913 additions and 27 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"react-redux": "^8.0.1",
"react-router-dom": "6",
"react-scripts": "5.0.1",
"react-test-renderer": "^18.2.0",
"web-vitals": "^2.1.0",
"yup": "^0.32.11"
},
Expand Down Expand Up @@ -53,6 +54,7 @@
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"jest": "^29.2.2",
"postcss": "^8.4.17",
"prettier": "2.7.1",
"tailwindcss": "^3.1.8"
Expand Down
Binary file added public/assets/jobsearch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 8 additions & 6 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import React from 'react';
// import { Routes, Route } from "react-router-dom";

import Hero from './components/Hero/Hero';
import './App.css';

function App() {
return ( <div className = "App" >
<h1>Hello</h1>
</div>
);
return (
<div className="App">
<Hero />
<h1>Hello</h1>
</div>
);
}

export default App;
export default App;
37 changes: 37 additions & 0 deletions src/components/Hero/Hero.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
function Hero() {
return (
<div className="bg-dark-gray flex justify-around items-center px-32 small:px-14 small:py-5 medium:py-6 medium:px-16 large:py-8 large:px-18">
<div className="text-left">
<h1 className="text-white text-5xl leading-snug font-semibold font-inter small:text-lg medium:text-3xl large:text-4xl">
10,254 Jobs <br /> Are Listed Here!
</h1>
<h3 className="text-xl text-white medium:text-yellow-30 font-inter small:text-xs medium:text-lg large:xl">
Find your dream job now
</h3>{' '}
<div className=" mt-5 w-48 small:w-36 medium:w-56 large:w-72">
<input
type="search"
className="rounded-3xl px-6 py-2 outline-none absolute w-72 small:w-32 small:py-1.5 small:px-3 small:text-xs medium:w-52"
placeholder="Type to search"
/>
<button
type="submit"
className="py-2 bg-accent px-5 rounded-3xl text-white relative left-52 hover:bg-red-500 small:py-1.5 small:px-3 small:text-xs small:left-24 medium:left-36 "
>
Search
</button>
</div>
</div>

<div>
<img
src="/assets/jobsearch.png"
alt="a girl searching for job"
className="w-500 small:w-300 ml-7"
/>
</div>
</div>
);
}

export default Hero;
8 changes: 8 additions & 0 deletions src/components/Hero/Hero.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import renderer from 'react-test-renderer';

import Hero from './Hero';

it('renders correctly when the component matches the snapshot', () => {
const tree = renderer.create(<Hero />).toJSON();
expect(tree).toMatchSnapshot();
});
47 changes: 47 additions & 0 deletions src/components/Hero/__snapshots__/Hero.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders correctly when the component matches the snapshot 1`] = `
<div
className="bg-dark-gray flex justify-around items-center px-32 small:px-14 small:py-5 medium:py-6 medium:px-16 large:py-8 large:px-18"
>
<div
className="text-left"
>
<h1
className="text-white text-5xl leading-snug font-semibold font-inter small:text-lg medium:text-3xl large:text-4xl"
>
10,254 Jobs
<br />
Are Listed Here!
</h1>
<h3
className="text-xl text-white medium:text-yellow-30 font-inter small:text-xs medium:text-lg large:xl"
>
Find your dream job now
</h3>
<div
className=" mt-5 w-48 small:w-36 medium:w-56 large:w-72"
>
<input
className="rounded-3xl px-6 py-2 outline-none absolute w-72 small:w-32 small:py-1.5 small:px-3 small:text-xs medium:w-52"
placeholder="Type to search"
type="search"
/>
<button
className="py-2 bg-accent px-5 rounded-3xl text-white relative left-52 hover:bg-red-500 small:py-1.5 small:px-3 small:text-xs small:left-24 medium:left-36 "
type="submit"
>
Search
</button>
</div>
</div>
<div>
<img
alt="a girl searching for job"
className="w-500 small:w-300 ml-7"
src="/assets/jobsearch.png"
/>
</div>
</div>
`;
25 changes: 17 additions & 8 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,24 @@ module.exports = {
content: ['./src/**/*.{js,jsx,ts,tsx}'],
theme: {
extend: {
colors :{
"primary": "var(--primary)",
"secondary": "var(--secondary)",
"accent": "var(--accent)",
"dark-gray": "var(--dark-gray)",
colors: {
primary: 'var(--primary)',
secondary: 'var(--secondary)',
accent: 'var(--accent)',
'dark-gray': 'var(--dark-gray)',
},
fontFamily: {
inter: ['Inter'],
},
width: {
500: '500px',
300: '300px',
},
screens: {
small: { min: '360px', max: '650px' },
medium: { min: '651px', max: '1023px' },
large: { min: '1024px', max: '1279px' },
},
fontFamily : {
'inter':['Inter']
}
},
},
plugins: [],
Expand Down
Loading

0 comments on commit 3304666

Please sign in to comment.