Last active
August 1, 2022 22:44
-
-
Save alex-boom/0fd13191b45c77ccfebb840fc9b454cf to your computer and use it in GitHub Desktop.
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
function importAll(r) { | |
return r.keys().map(r); | |
} | |
const images = importAll(require.context('../assets/logos', false, /\.(png|jpe?g|svg)$/)); | |
const companies = images.map(item => { | |
return { | |
logo: item.default, | |
slug: 'company-page', | |
description: 'some description', | |
} | |
}); | |
export default companies; | |
// ================================================= | |
import companies from "../mock-data/companies"; | |
const companyList = [ | |
...companies, | |
]; | |
const Dashboard = () => { | |
//shuffle(companyList); | |
return ( | |
<div className="page dashbord-page"> | |
<ModalSearch /> | |
<div id="brand-box"> | |
{ companyList.map(({ slug, logo, description }, index) => ( | |
<Link key={ index } className="element exhibition-booth" to={ `/${ slug }` } > | |
<img src={ `${ logo }` } className="logo" alt={ `${ description }` } /> | |
</Link> | |
)) | |
} | |
</div> | |
</div> | |
); | |
}; | |
function shuffle(array) { | |
array.sort(() => Math.random() - 0.8); | |
} | |
export default Dashboard; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment