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

238
Vistas
My code is not working when I try to add components in a grid layout

I want my app to be an app that you can chat and share notes in. So I have built both the stuff. Both are separate components. So when I tried to split the page in half(one half will be the chat component, the other will be the notes app) using grid, I got weird results.

This was what it looked like when I used grid, looks pretty good right?

This is what it looks when I add the chat component, weird and misaligned

So the chat component was copied from this youtuber Called Fireship. Maybe I didn't change the code to fit the other half properly. But I tried my best using my knowledge of css. All of this is in the main component, this is the code of the main component :

import './App.css';
import Header from './components/Header';
import NotesListPage from './pages/NotesListPage';
import NotePage from './pages/NotePage';
import {useState, useEffect} from 'react';
import Chat from './components/Chat';
import {
  BrowserRouter as Router,
  Route,
} from "react-router-dom";

function App() {
  return (
    <Router>
      <div className="parent">
      <div className="container dark">
        <div className="app">
        <Header />
        <Route path="/" exact component={NotesListPage} />
        <Route path="/note/:id" component={NotePage} />
        </div>
      </div>
      <Chat />
      </div>
    </Router>

  );
}
export default App;

It might be because of the way I have arranged my code. But I have tried all the combinations and it doesn't seem to work. It is probably a problem caused by the css. The rest of the css is copied and pasted from fireship's video. Here's the css code(parent class) :

.parent {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}
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