1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-15 12:59:09 +00:00
trezor-wallet/src/support/ImagesPreloader.js

28 lines
595 B
JavaScript
Raw Normal View History

2018-11-06 12:15:12 +00:00
import React, { Component } from 'react';
import styled from 'styled-components';
const Wrapper = styled.div`
display: none;
`;
const Img = styled.img``;
class ImagesPreloader extends Component {
importAll(r) {
return r.keys().map(r);
}
render() {
const images = this.importAll(require.context('../images', false, /\.(png|jpe?g)$/));
return (
<Wrapper>
2019-03-04 12:33:02 +00:00
{images.map(image => (
<Img key={image} src={image} />
))}
2018-11-06 12:15:12 +00:00
</Wrapper>
);
}
}
2019-03-04 12:33:02 +00:00
export default ImagesPreloader;