Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

236
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!