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

Feature/image-component #31

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

Victor1890
Copy link

@Victor1890 Victor1890 commented Apr 10, 2024

Presentamos una nueva funcionalidad: Componente de Image

El componente de Image se utiliza para mostrar imágenes con soporte de Imagen de respaldo

Beneficios

  • Puedes utilizar todas sus propiedades relacionado con la etiqueta img que conoces

  • isBlurred: Puedes usar la propiedad isBlurred que duplica la imagen y desenfocarla para crear un efecto de borroso

  • isZoomed: Puedes usar la propiedad isZoomed para amplear la imagen cuando pasas el mouse sobre ella

  • Carga Animada: El componente de imagen tiene una animación de skeleton que indica the imagen is está cargando y una animación de la opacidad aparece cuando la image ya ha sido cargada

  • Imagen con respaldo: Puedes usar la propiedad fallbackSrc para mostrar el respaldo cuando la imagen

    • La propiedad fallbackSrc está en uso
    • La imagen proveída en src está todavía cargando
    • La imagen proveída en src ha fallado en ver de cargar
    • La imagen proveída en src no ha sido encontrada

Cómo usar Componente de Image:

La manera mas sencilla del como utilizar el componente está actualmente el la documentación de Storybook

import Image from "@ogticrd/ui-kit/Image"

function App() {
    return (
        <Image
            width={300}
            height={300}
            src={/* Image here */}
            isBlurred
            radius={"lg"}
            shadow={"lg"}
            alt={"Code Example"}
        />
    )
}

Con Next.js Image

import Image from "@ogticrd/ui-kit/Image"
import NextImage from "next/image";

function App() {
    return (
        <Image
            as={NextImage}
            width={300}
            height={300}
            src={/* Image here */}
            isBlurred
            radius={"lg"}
            shadow={"lg"}
            alt={"Code Example"}
        />
    )
}

isBlurred

image

isZoomed

image

Shadow

image

Victor1890 and others added 11 commits April 8, 2024 18:01
refactor image component and add use image hook, shadow and blur custom setting
fix import paths and add missing code in Image component
fix import paths and solve problem to image ref property type
refactor Image component to fix import paths and add missing code
add images related to Image Storybook view
…image-props.ts

refactor useImageProps function in components/image/use-image-props.ts and remove comments
refactor useImageBase function in components/image/use-image-base.ts
Add Image.stories.tsx file for Storybook view, custom args controls and add differentes templates related to images component
refactor image component style in components/image/image.style.ts
@Victor1890 Victor1890 changed the title Feature/image component Feature/image-component Apr 10, 2024
…image-props.ts

refactor useImageProps function in components/image/use-image-props.ts
…f img tag in components/image/index.tsx

refactor Image component to use Component prop instead of img tag in components/image/index.tsx
@Victor1890 Victor1890 marked this pull request as draft April 16, 2024 12:49
@Victor1890 Victor1890 marked this pull request as ready for review April 16, 2024 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant