mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-26 03:46:28 -08:00
Better loader on buttons
This commit is contained in:
1 parent
714f8cbca4
commit
d7883b2026
1 file changed
+16
-3
@@ -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>
|
||||
)}
|
||||
</>
|
||||
|
||||
Reference in new issue
Block a user