generated from ReCoded-Org/capstone-react-redux-template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* starter code for the company showcase component * 70 percent done with building the company showcase component * design completed * created company showcase component * Completed * Revert "Completed" This reverts commit 0841c4c. * implemented requested changes and made component more reusable * updated snapshot test Co-authored-by: Allan <[email protected]> Co-authored-by: telemartiq <[email protected]> Co-authored-by: allan <[email protected]>
- Loading branch information
1 parent
5a6db9d
commit fbf1968
Showing
15 changed files
with
201 additions
and
4 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/components/companyShowcaseComponent/CompanyShowcaseComponent.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
function CompanyShowcaseComponent({showCaseData}) { | ||
|
||
const topRowComanpies = showCaseData.companies.slice(0,5).map((company)=>{ | ||
return( | ||
<a key={`${company}`} className="w-50" rel="noreferrer" target="_blank" href={`https://www.${company}.com`}> | ||
<img className="hover:scale-75" src={`/assets/company-showcase-component-assets/${company}.png`} alt={`${company}s logo`}/> | ||
</a> | ||
); | ||
}) | ||
|
||
const bottomRowComanpies = showCaseData.companies.slice(5,10).map((company)=>{ | ||
return( | ||
<a key={`${company}`} className="w-50" rel="noreferrer" target="_blank" href={`https://www.${company}.com`}> | ||
<img className="hover:scale-75" src={`/assets/company-showcase-component-assets/${company}.png`} alt={`${company}s logo`}/> | ||
</a> | ||
); | ||
}) | ||
|
||
return ( | ||
<section className = "flex flex-col bg-gray-500/5 justify-center items-center"> | ||
<div className="grid grid-cols-5 grid-rows-2 gap-x-5 place-content-center items-center w-4/6"> | ||
<h2 className="font-inter text-blue-900 font-semibold self-end text-xs mt-5 mb-5 md:text-2xl col-span-5"> | ||
{showCaseData.header}</h2> | ||
{topRowComanpies} | ||
</div> | ||
<div className="grid grid-cols-4 gap-x-5 place-content-center items-center w-5/6"> | ||
{bottomRowComanpies} | ||
</div> | ||
</section> | ||
); | ||
} | ||
|
||
export default CompanyShowcaseComponent; |
11 changes: 11 additions & 0 deletions
11
src/components/companyShowcaseComponent/_test_/CompanyShowcaseComponent.test.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import renderer from 'react-test-renderer'; | ||
import CompanyShowcaseComponent from "../CompanyShowcaseComponent.jsx" | ||
import {showCaseData} from "../../../data/showCaseData" | ||
|
||
it('renders Company Showcase Component correctly', () => { | ||
const tree = renderer | ||
.create(<CompanyShowcaseComponent showCaseData={showCaseData}/>) | ||
.toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
129 changes: 129 additions & 0 deletions
129
...ents/companyShowcaseComponent/_test_/__snapshots__/CompanyShowcaseComponent.test.jsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`renders Company Showcase Component correctly 1`] = ` | ||
<section | ||
className="flex flex-col bg-gray-500/5 justify-center items-center" | ||
> | ||
<div | ||
className="grid grid-cols-5 grid-rows-2 gap-x-5 place-content-center items-center w-4/6" | ||
> | ||
<h2 | ||
className="font-inter text-blue-900 font-semibold self-end text-xs mt-5 mb-5 md:text-2xl col-span-5" | ||
> | ||
More than 20,000 companies are using our service to hire their employees. | ||
</h2> | ||
<a | ||
className="w-50" | ||
href="https://www.facebook.com" | ||
rel="noreferrer" | ||
target="_blank" | ||
> | ||
<img | ||
alt="facebooks logo" | ||
className="hover:scale-75" | ||
src="/assets/company-showcase-component-assets/facebook.png" | ||
/> | ||
</a> | ||
<a | ||
className="w-50" | ||
href="https://www.amazon.com" | ||
rel="noreferrer" | ||
target="_blank" | ||
> | ||
<img | ||
alt="amazons logo" | ||
className="hover:scale-75" | ||
src="/assets/company-showcase-component-assets/amazon.png" | ||
/> | ||
</a> | ||
<a | ||
className="w-50" | ||
href="https://www.microsoft.com" | ||
rel="noreferrer" | ||
target="_blank" | ||
> | ||
<img | ||
alt="microsofts logo" | ||
className="hover:scale-75" | ||
src="/assets/company-showcase-component-assets/microsoft.png" | ||
/> | ||
</a> | ||
<a | ||
className="w-50" | ||
href="https://www.apple.com" | ||
rel="noreferrer" | ||
target="_blank" | ||
> | ||
<img | ||
alt="apples logo" | ||
className="hover:scale-75" | ||
src="/assets/company-showcase-component-assets/apple.png" | ||
/> | ||
</a> | ||
<a | ||
className="w-50" | ||
href="https://www.google.com" | ||
rel="noreferrer" | ||
target="_blank" | ||
> | ||
<img | ||
alt="googles logo" | ||
className="hover:scale-75" | ||
src="/assets/company-showcase-component-assets/google.png" | ||
/> | ||
</a> | ||
</div> | ||
<div | ||
className="grid grid-cols-4 gap-x-5 place-content-center items-center w-5/6" | ||
> | ||
<a | ||
className="w-50" | ||
href="https://www.airbnb.com" | ||
rel="noreferrer" | ||
target="_blank" | ||
> | ||
<img | ||
alt="airbnbs logo" | ||
className="hover:scale-75" | ||
src="/assets/company-showcase-component-assets/airbnb.png" | ||
/> | ||
</a> | ||
<a | ||
className="w-50" | ||
href="https://www.spotify.com" | ||
rel="noreferrer" | ||
target="_blank" | ||
> | ||
<img | ||
alt="spotifys logo" | ||
className="hover:scale-75" | ||
src="/assets/company-showcase-component-assets/spotify.png" | ||
/> | ||
</a> | ||
<a | ||
className="w-50" | ||
href="https://www.yahoo.com" | ||
rel="noreferrer" | ||
target="_blank" | ||
> | ||
<img | ||
alt="yahoos logo" | ||
className="hover:scale-75" | ||
src="/assets/company-showcase-component-assets/yahoo.png" | ||
/> | ||
</a> | ||
<a | ||
className="w-50" | ||
href="https://www.netflix.com" | ||
rel="noreferrer" | ||
target="_blank" | ||
> | ||
<img | ||
alt="netflixs logo" | ||
className="hover:scale-75" | ||
src="/assets/company-showcase-component-assets/netflix.png" | ||
/> | ||
</a> | ||
</div> | ||
</section> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export const showCaseData= | ||
{"header":"More than 20,000 companies are using our service to hire their employees.", | ||
"companies":[ | ||
"facebook", | ||
"amazon", | ||
"microsoft", | ||
"apple", | ||
"google", | ||
"airbnb", | ||
"spotify", | ||
"yahoo", | ||
"netflix" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters