Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correção altura do botão #168

Merged
merged 3 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@platformbuilders/fluid-react",
"version": "1.2.0",
"version": "1.2.1",
"private": false,
"description": "Builders React for Fluid Design System",
"keywords": [
Expand Down
6 changes: 3 additions & 3 deletions src/components/Button/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ const getStylesButton = (props: ButtonWrapperProps) => {

const sizeButton = {
normal: css`
min-height: 2.25rem;
height: 2.25rem;
`,
medium: css`
min-height: 2.75rem;
height: 2.75rem;
`,
large: css`
min-height: 3.25rem;
height: 3.25rem;
`,
};

Expand Down
33 changes: 21 additions & 12 deletions src/components/LoadingIndicator/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { FC, useEffect } from 'react';
import lottie from 'lottie-web';
import { FC, useEffect, useRef } from 'react';
import {
AnimationObject,
LoadingVariants,
Expand Down Expand Up @@ -49,20 +48,30 @@ const LoadingIndicator: FC<LoadingType> = ({
variant = 'circular',
accessibility,
}) => {
useEffect(() => {
const animationData = loadingVariant({ variant, contrast });
const ref = useRef<HTMLDivElement>(null);

const loadAnimation = async () => {
if (ref.current) {
const animationData = loadingVariant({ variant, contrast });
const lottie = await import('lottie-web');

lottie.loadAnimation({
container: document.getElementById('loading') as Element,
renderer: 'svg',
loop: true,
autoplay: true,
animationData,
});
}, []);
lottie.default.loadAnimation({
container: ref.current,
renderer: 'svg',
loop: true,
autoplay: true,
animationData,
});
}
};

useEffect(() => {
loadAnimation();
}, [ref]);

return (
<div
ref={ref}
style={large ? largeSize : smallSize}
id="loading"
aria-label={accessibility || 'Aguarde...'}
Expand Down