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

Create a loading indicator component #675

Closed
brauliodiez opened this issue Jan 29, 2025 · 0 comments · Fixed by #705
Closed

Create a loading indicator component #675

brauliodiez opened this issue Jan 29, 2025 · 0 comments · Fixed by #705
Assignees

Comments

@brauliodiez
Copy link
Member

Let's create a loading indicator mock shape

Image

It should fall under the Rich Components category

Rich Components >> Loading Indicator

Here some rough code (IMPORTANT use the Standard fonts and spacing, check the input component, and ask @deletidev about it).

SVG code (rough) THIS IS NOT VALID AS IS, IS JUST AN IDEA

<svg width="200" height="100" viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg">
    <!-- Círculos -->
    <circle cx="40" cy="40" r="15" fill="#666" stroke="#000" stroke-width="2"/>
    <circle cx="80" cy="40" r="15" fill="#888" stroke="#000" stroke-width="2"/>
    <circle cx="120" cy="40" r="15" fill="#aaa" stroke="#000" stroke-width="2"/>
    <circle cx="160" cy="40" r="15" fill="#ccc" stroke="#000" stroke-width="2"/>
    
    <!-- Texto -->
    <text x="100" y="85" font-family="Arial, sans-serif" font-size="14" fill="#000" text-anchor="middle">Loading...</text>
</svg>

React Konva (rough)

import React from "react";
import { Stage, Layer, Circle, Text } from "react-konva";

const LoadIndicator: React.FC = () => {
  // Tonos de gris de oscuro a claro
  const colors = ["#666", "#888", "#aaa", "#ccc"];
  
  return (
    <Stage width={200} height={100}>
      <Layer>
        {/* Círculos */}
        {colors.map((color, index) => (
          <Circle
            key={index}
            x={40 + index * 40} // Espaciado horizontal
            y={40} // Altura fija
            radius={15}
            fill={color}
            stroke="#000"
            strokeWidth={2}
          />
        ))}

        {/* Texto "Loading..." */}
        <Text
          x={0}
          y={75}
          width={200}
          text="Loading..."
          fontSize={14}
          fontFamily="Arial"
          fill="#000"
          align="center"
        />
      </Layer>
    </Stage>
  );
};

export default LoadIndicator;
@brauliodiez brauliodiez moved this to In Progress in QuickMock Jan 29, 2025
omarlm added a commit that referenced this issue Feb 21, 2025
@brauliodiez brauliodiez linked a pull request Feb 24, 2025 that will close this issue
brauliodiez added a commit that referenced this issue Feb 26, 2025
…-component

Feature/#675 loading indicator component
@github-project-automation github-project-automation bot moved this from In Progress to Done in QuickMock Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants