Loader: Add search loader component

- Rebased on feature branch 7th August 2023
This commit is contained in:
Kyle Nel 2023-08-04 14:35:10 +02:00
parent a807040208
commit ebf292492a
No known key found for this signature in database
2 changed files with 89 additions and 0 deletions

View File

@ -0,0 +1,69 @@
@import '../../stylesheets/_variables.scss';
.woocommerce-marketplace {
&__product-loader-cards {
display: grid;
background: linear-gradient(to right, $gray-0 40%, $gray-10 60%, $gray-0 80%);
background-color: $gray-0;
background-size: 500% 200%;
animation: GradientSlide 4s linear infinite;
height: 270px;
}
&__product-loader-divider {
background: #fff;
width: 24px;
height: 270px;
display: none;
}
.divider-1 {
grid-column-start: 2;
}
}
@media screen and (min-width: $breakpoint-medium) {
.woocommerce-marketplace {
&__product-loader-cards {
grid-template-columns: repeat(2, 1fr);
}
.divider-1 {
display: block;
}
}
}
@media screen and (min-width: $breakpoint-large) {
.woocommerce-marketplace {
&__product-loader-cards {
grid-template-columns: repeat(3, 1fr);
}
.divider-2 {
display: block;
}
}
}
@media screen and (min-width: $breakpoint-xlarge) {
.woocommerce-marketplace {
&__product-loader-cards {
grid-template-columns: repeat(4, 1fr);
}
.divider-3 {
display: block;
}
}
}
@keyframes GradientSlide {
0% {
background-position: 100% 0;
}
100% {
background-position: -100% 0;
}
}

View File

@ -0,0 +1,20 @@
/**
* External dependencies
*/
/**
* Internal dependencies
*/
import './product-loader.scss';
export default function ProductLoader(): JSX.Element {
return (
<div className="woocommerce-marketplace__product-loader">
<div className="woocommerce-marketplace__product-loader-cards">
<div className="woocommerce-marketplace__product-loader-divider divider-1"></div>
<div className="woocommerce-marketplace__product-loader-divider divider-2"></div>
<div className="woocommerce-marketplace__product-loader-divider divider-3"></div>
</div>
</div>
);
}