-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1b5cad
commit 92dbf2e
Showing
4 changed files
with
50 additions
and
40 deletions.
There are no files selected for viewing
56 changes: 31 additions & 25 deletions
56
src/OnboardingSPA/components/CheckboxTemplate/CheckboxListSkeleton/index.js
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 |
---|---|---|
@@ -1,38 +1,44 @@ | ||
import Animate from '../../Animate'; | ||
|
||
/** | ||
* Checkbox List Skeleton Component | ||
* This returns a List of Checkbox Items Skeletons to imitate loading | ||
* | ||
* @param customItemsList.count | ||
* @param customItemsList.count | ||
* @param customItemsList.count.count | ||
* @return CheckboxList | ||
*/ | ||
const CheckboxListSkeleton = ({ count }) => { | ||
const CheckboxListSkeleton = ( { count } ) => { | ||
const buildCheckboxSkeletonItems = () => { | ||
const customItems = []; | ||
|
||
const buildCheckboxSkeletonItems = () => { | ||
var customItems = []; | ||
for ( let idx = 0; idx < count; idx++ ) | ||
customItems.push( | ||
<Animate | ||
type={ 'shine-placeholder' } | ||
className="checkbox-skeleton-item" | ||
/> | ||
); | ||
|
||
for (let idx = 0; idx < count; idx++) | ||
customItems.push( <div className="checkbox-skeleton-item shimmer"/>); | ||
|
||
return customItems; | ||
}; | ||
return customItems; | ||
}; | ||
|
||
return ( | ||
<div className="checkbox-list"> | ||
<div className="checkbox-list-col"> | ||
{buildCheckboxSkeletonItems().slice( | ||
0, | ||
Math.floor(count / 2) | ||
)} | ||
</div> | ||
<div className="checkbox-list-col"> | ||
{buildCheckboxSkeletonItems().slice( | ||
Math.floor(count / 2), | ||
count | ||
)} | ||
</div> | ||
</div> | ||
); | ||
return ( | ||
<div className="checkbox-list"> | ||
<div className="checkbox-list-col"> | ||
{ buildCheckboxSkeletonItems().slice( | ||
0, | ||
Math.floor( count / 2 ) | ||
) } | ||
</div> | ||
<div className="checkbox-list-col"> | ||
{ buildCheckboxSkeletonItems().slice( | ||
Math.floor( count / 2 ), | ||
count | ||
) } | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CheckboxListSkeleton; |
22 changes: 13 additions & 9 deletions
22
src/OnboardingSPA/components/CheckboxTemplate/CheckboxListSkeleton/stylesheet.scss
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 |
---|---|---|
@@ -1,15 +1,19 @@ | ||
/*COLOR VARIABLES*/ | ||
$white-offset: rgb(224, 224, 224); | ||
$main-color-light: var(--nfd-onboarding-white); | ||
$grey-color: #f6f7f8; | ||
|
||
.checkbox-skeleton-item { | ||
height: 45px; | ||
margin: 12px; | ||
padding: 16px; | ||
margin-top: 16px; | ||
background: $main-color-light; | ||
border: 0.5px solid $white-offset; | ||
cursor: not-allowed; | ||
width: clamp(15rem, 25vw, 35rem); | ||
box-shadow: 0px 2px 8px 2px rgba(204, 204, 204, 0.175295); | ||
height: 45px; | ||
margin: 12px; | ||
padding: 16px; | ||
margin-top: 16px; | ||
border: 0.5px solid $white-offset; | ||
cursor: not-allowed; | ||
width: clamp(15rem, 25vw, 35rem); | ||
box-shadow: 0 2px 8px 2px rgba(204, 204, 204, 0.175295); | ||
background: $grey-color; | ||
background-repeat: no-repeat; | ||
background-image: | ||
linear-gradient(to right, $grey-color 0%, $main-color-grey 20%, $grey-color 40%, $grey-color 100%); | ||
} |
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
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