Skip to content

Commit

Permalink
improved circular loading responsiveness, style, positioning,size etc (
Browse files Browse the repository at this point in the history
…#1123)

## JIRA Ticket

Parent Jira Issue: https://jira.csiro.au/browse/BSS-112
Subtask: https://jira.csiro.au/browse/BSS-257

## Description

The CircularLoading component is improved in terms of responsiveness and
user experience. Updated the component to ensure that it behaves well
across different screen sizes, with improved centering, visibility, and
readability.

## Proposed Changes

- The content stacks vertically on smaller screens (like mobile devices)
and horizontally on larger screens
- The content ( label and spinner icon ) is now centered both
horizontally and vertically on all screen size
- Increased Spacing and Padding for better visibility to the user
- Improved styling, 

## How to Test

- Navigate to the notebooks in the app
- Upon loading you should be able to see the Loading Notebooks Label
aligned vertically, horizontally based on different screen size.
- The size of the spinner and label should be clearly visible and
positioned well.


## Checklist

- [ Y ] I have confirmed all commits have been signed.
- [ Y ] I have added JSDoc style comments to any new functions or
classes.
- [ Y ] Relevant documentation such as READMEs, guides, and class
comments are updated.
  • Loading branch information
ranisa-gupta16 authored Aug 23, 2024
2 parents 5ce6106 + 705155a commit 3cb88d0
Showing 1 changed file with 35 additions and 5 deletions.
40 changes: 35 additions & 5 deletions app/src/gui/components/ui/circular_loading.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,50 @@
import {CircularProgress, Grid, Typography} from '@mui/material';
import React from 'react';

/**
* CircularLoading component displays a loading spinner with a label,
* designed to be responsive and centered on different screen sizes.
*
* @param {Object} props - The component props
* @param {string} props.label - The label text displayed next to the spinner
* @returns {JSX.Element} The rendered CircularLoading component
*/

export default function CircularLoading(props: {label: string}) {
return (
<Grid
container
direction="row"
justifyContent="flex-start"
direction={{xs: 'column', sm: 'row'}}
alignItems="center"
spacing={1}
justifyContent="center"
spacing={2}
sx={{
padding: 3,
maxWidth: '100%',
width: '100%',
minHeight: {xs: '60vh', sm: 'auto'},
textAlign: 'center',
}}
>
<Grid item>
<CircularProgress size={14} thickness={5} />
<CircularProgress
size={36}
thickness={5}
sx={{
color: 'primary.main',
}}
/>
</Grid>
<Grid item>
<Typography variant="body2" color="text.secondary">
<Typography
variant="h6"
color="text.secondary"
sx={{
fontWeight: 600,
display: 'block',
mt: {xs: 2, sm: 0},
}}
>
{props.label}
</Typography>
</Grid>
Expand Down

0 comments on commit 3cb88d0

Please sign in to comment.