Skip to content

Commit

Permalink
fix: adjust loading size on IconButton
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed May 27, 2024
1 parent 209f237 commit ae50bb4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion main/providers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type {AlertDialogContext} from '../modals/AlertDialog';
import AlertDialog from '../modals/AlertDialog';
import type {SnackbarContext, SnackbarOptions} from '../modals/Snackbar';
import Snackbar from '../modals/Snackbar';
import {LoadingIndicator} from '../uis/LoadingIndicator';
import createCtx from '../utils/createCtx';

export type {ThemeContext} from '@dooboo-ui/theme';
Expand Down Expand Up @@ -80,7 +81,15 @@ function AppProvider({children}: {children: JSX.Element}): JSX.Element {
alertDialog: alertDialogContext,
}}
>
{!assetLoaded ? null : (
{!assetLoaded ? (
<LoadingIndicator
style={css`
align-self: stretch;
flex: 1;
justify-content: center;
`}
/>
) : (
<>
{children}
<Snackbar ref={snackbar} />
Expand Down
11 changes: 10 additions & 1 deletion main/uis/IconButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,16 @@ export function IconButton({
>
{loading
? loadingElement || (
<LoadingIndicator color={theme.text.basic} size="small" />
<LoadingIndicator
color={theme.text.disabled}
size="small"
style={css`
justify-content: center;
align-items: center;
height: ${iconSize + 'px'};
width: ${iconSize + 'px'};
`}
/>
)
: iconElement || (
<Icon
Expand Down

0 comments on commit ae50bb4

Please sign in to comment.