-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from precision-sustainable-ag/loading-spinner
Create a shared loading indicator component #24
- Loading branch information
Showing
6 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
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,2 @@ | ||
import { PSALoadingspinner } from "./loadingspinner"; | ||
export default PSALoadingspinner; |
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,28 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import styles from "./spinner.module.scss"; | ||
|
||
export function PSALoadingspinner({ loaderStyle }) { | ||
|
||
const defaultStyle = { | ||
width: '50px', | ||
height: '50px', | ||
border: `8px solid #90EE90`, | ||
borderTop: `8px solid green`, | ||
borderLeft: `8px solid green`, | ||
borderRight: `8px solid green`, | ||
borderRadius: "50%", | ||
animation: `${styles.spin} 2s linear infinite`, | ||
}; | ||
|
||
return <div style={loaderStyle ? loaderStyle : defaultStyle}></div>; | ||
} | ||
|
||
PSALoadingspinner.propTypes = { | ||
|
||
/** | ||
* Styles for the loader | ||
*/ | ||
loaderStyle: PropTypes.object, | ||
|
||
}; |
Empty file.
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,30 @@ | ||
import { PSALoadingspinner } from "./loadingspinner"; | ||
import styles from "./spinner.module.scss"; | ||
|
||
const meta = { | ||
title: "Feedback/Loadingspinner", | ||
component: PSALoadingspinner, | ||
tags: ["autodocs"], | ||
parameters: { | ||
layout: "centered", | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
export const DefaultStyle = {}; | ||
|
||
export const LoaderStyle = { | ||
args: { | ||
loaderStyle: { | ||
width: "50px", | ||
height: "50px", | ||
border: `8px solid black`, | ||
borderTop: `8px solid red`, | ||
borderLeft: `8px solid red`, | ||
borderRight: `8px solid red`, | ||
borderRadius: "50%", | ||
animation: `${styles.spin} 2s linear infinite`, | ||
}, | ||
}, | ||
}; |
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,8 @@ | ||
@keyframes spin { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} |
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