Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

233
Vistas
Why are my icons being placed as a column instead of as a row?

I am trying to align these icons as a row using className="col s1" but when I run this code its displayed in a column for some reason. I've tried removing the container tag, adding it, ive tried changing the column sizes, but for some reason it is always displayed as a column instead of as a row.

Is there any way i can get this to work?

Here is a link to the code: Project

Main.jsx

import React, { useState, useEffect, useRef } from "react";
import Helmet from "react-helmet";
import Socials from "./Socials";
function Main(props) {
  const socialMedia = [
    {
      link: "https://www.linkedin.com/in/",
      icon: "linkedin"
    },
    {
      link: "https://github.com/",
      icon: "github"
    },
    {
      link: "https://www.youtube.com/",
      icon: "youtube"
    },
    {
      link:
        "mailto:example@ex.co?subject=Felipe%20GD%20--%20Request%20To%20Contact",
      icon: "email"
    }
  ];

  return (
    <React.Fragment>
      <Helmet>
        <title>Felipe GD</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
      </Helmet>
      <div className="container">
        <div clasName="row">
          {socialMedia.map((socials) => (
            <Socials
              getOpacity={null}
              getVisibility={null}
              link={socials.link}
              icon={socials.icon}
            />
          ))}
        </div>
      </div>
    </React.Fragment>
  );
}

export default Main;


Socials.jsx

import React, { useEffect, useRef } from "react";
import { SocialIcon } from "react-social-icons";

function Socials(props) {
  let size = useRef("20");

  useEffect(() => {
    if (window.innerWidth > 500) {
      size.current = 50;
    } else {
      size.current = 25;
    }
  }, [size]);

  return (
    <React.Fragment>
      <div className="col s1">
        <SocialIcon
          id={props.icon}
          bgColor="#2C2C2C"
          fgColor="#ECCECE"
          network={props.icon}
          url={props.link}
        />
      </div>
    </React.Fragment>
  );
}

export default Socials;

I know i could get this to work by not making it into a component but that doesent look clean to me, id like to be able to use the map function if possible.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda