feat: spinner can now set width and height surrounding the svg

this is useful when we need it to take up less space
pull/3083/head
William Grant 11 months ago
parent e5625cac76
commit 08487bcffc

@ -2,18 +2,22 @@ import styled from 'styled-components';
type Props = {
loading: boolean;
height?: string;
width?: string;
};
const StyledSessionSpinner = styled.div`
const StyledSessionSpinner = styled.div<Props>`
display: inline-block;
position: relative;
width: 80px;
height: 80px;
min-width: 13px;
min-height: 13px;
width: ${props => (props.width ? props.width : '80px')};
height: ${props => (props.height ? props.height : '80px')};
flex-shrink: 0;
div {
position: absolute;
top: 33px;
top: calc(50% - 6.5px);
width: 13px;
height: 13px;
border-radius: 50%;
@ -63,10 +67,15 @@ const StyledSessionSpinner = styled.div`
`;
export const SessionSpinner = (props: Props) => {
const { loading } = props;
const { loading, height, width } = props;
return loading ? (
<StyledSessionSpinner data-testid="loading-spinner">
<StyledSessionSpinner
loading={loading}
height={height}
width={width}
data-testid="loading-spinner"
>
<div />
<div />
<div />

Loading…
Cancel
Save