Giter VIP home page Giter VIP logo

Comments (10)

handotdev avatar handotdev commented on September 28, 2024

@tobias-mintlify is this a duplicate of #57

from components.

 avatar commented on September 28, 2024

Reopening, this is a separate issue to allow an image as an icon. This issue is super small and is only about updating the type definition of the component.

#57 is about allowing a big image at the top of the card.

from components.

sboy99 avatar sboy99 commented on September 28, 2024

@tobias-mintlify correct me if I'm wrong. In this updation the icon will accept a href of an image. And the card component will conditionally check is it a image(string) or a svg, right, and based of the condition it will render img and svg respectively.

from components.

 avatar commented on September 28, 2024

Yes exactly. String input gets passed to the image src property. SVGs will still be passed as components.

from components.

sboy99 avatar sboy99 commented on September 28, 2024

Then excited to contribute. Assign me, I will give it a try 😸

from components.

sboy99 avatar sboy99 commented on September 28, 2024

Screenshot from 2023-02-09 11-19-22

Is it looking good? or it need some modification. If so mention please.

from components.

sboy99 avatar sboy99 commented on September 28, 2024

Screenshot from 2023-02-09 11-23-55

How can I update this so that icon prop accepts a string as well ??

from components.

 avatar commented on September 28, 2024

That's looking good. If you update the type definition of the component Storybook should automatically start accepting strings too. You can try something like icon?: string | ReactNode.

from components.

sboy99 avatar sboy99 commented on September 28, 2024

That's looking good. If you update the type definition of the component Storybook should automatically start accepting strings too. You can try something like icon?: string | ReactNode.

This is happening although I specified string | ReactNode
Screenshot from 2023-02-09 14-03-41

Possible reason is ReactNode has string property as literal type
Screenshot from 2023-02-09 14-04-19

from components.

sboy99 avatar sboy99 commented on September 28, 2024

Its working if we pass a JSON string
Screenshot from 2023-02-09 14-25-13

from components.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.