I'm a complete React beginner, is this the correct approach for Components?

Hello everyone, I am tasked to do some buttons that have both a logo, and text. The logo is supposed to serve as a background, on top of the button but behind the text. I approached by making a simple Button component, and made each logo as components exporting an svg. Is this the correct approach? Asking because they "stack" vertically as of now. :/ Also, what's the most convenient way of exporting from Figma? As I was handed the entire Figma design file, as of now I'm just copying some properties, but surprised there's no direct export for such elements.
1 Reply
epiksol
epiksol9mo ago
Hey can you expand on this part a bit more: "and made each logo as components exporting an svg?" I would personally create a "base" <Button /> component with all of the basic styling and functionality you need. From there I'd create another for the logo version with some type of prop to identify which logo to use <LogoButton logo="default" />.