Better loader on buttons

This commit is contained in:
loucass003 committed 2026-10-24 03:23:09 +02:00
1 parent 714f8cbca4
commit d7883b2026
1 file changed
+16 -3
+16 -3
View File
@@ -2,10 +2,23 @@ import classNames from 'classnames';
import { Clickable } from './Clickable';
import React, { ReactNode, useMemo } from 'react';
import { NavLink } from 'react-router-dom';
import { LoaderIcon, SlimeState } from './icon/LoaderIcon';
import { Typography } from './Typography';
import { Localized, LocalizedProps, useLocalization } from '@fluent/react';
function LoadingDots() {
return (
<div className="flex gap-1.5" aria-hidden>
{[0, 150, 300].map((delay) => (
<span
key={delay}
className="w-1.5 h-1.5 rounded-full bg-current animate-dot-pulse"
style={{ animationDelay: `${delay}ms` }}
/>
))}
</div>
);
}
function ButtonContent({
loading,
icon,
@@ -31,8 +44,8 @@ function ButtonContent({
{children}
</div>
{loading && (
<div className="absolute top-0 left-0 w-full h-full flex justify-center items-center fill-background-10">
<LoaderIcon slimeState={SlimeState.JUMPY} />
<div className="absolute top-0 left-0 w-full h-full flex justify-center items-center">
<LoadingDots />
</div>
)}
</>