score:0

i came up with something like this, but i am not sure if it is correct.

moviedescription.js

const seriesdescription = {
  mindhunterdescription:
    'the series tells about the work of fbi special agents holden ford and bill tench, who in 1977 cooperate to develop methods of prosecuting serial killers and to analyze the causes of their crimes.” - netflix "mindhunter" is a story inspired by real events about the beginnings of using psychoanalysis and a psychological approach in solving criminal cases. to this end, the fbi launches a special project in which serial killers are interrogated while serving their crimes. through a series of research, interviews, talks and psychological sessions, they try to get to their motives, learn about the patterns of the murderers\' minds, in order to be able to easily capture those who are still at large.',
  sherlockdescription:
    "in a new version of sir arthur conan doyle's crime stories, the famous eccentric detective tracks down criminals operating in modern london.” - netflix. sherlock holmes lives in 21st century london, a city filled with mystery, crime and deceit. the back streets are alive with robbers, blackmailers, smugglers and serial killers. when the police are desperate they call upon mr sherlock holmes and his unconventional methods of deduction to shed light on the matter. holmes is assisted by his flatmate and friend, dr john watson, who has returned from military service in afghanistan with the royal army medical corps.",
  breakingbaddescription:
    "walter white (bryan cranston) is a high school chemistry teacher. he is married to skyler (anna gunn) and teenage son walter junior (rj mitte). the day after his fiftieth birthday, he learns that he suffers from terminal lung cancer. knowing that he will die within a few years, he decides to secure his family's financial future at all costs. together with his former student jesse pinkman (aaron paul), he starts producing the purest methamphetamine in the area. after a while, walt's product becomes the most coveted drug in the city. this gets the attention of the dea anti-drug agency, where walt's brother-in-law, hank (dean norris), works. walter begins to change from a typical domestic into a dangerous dealer operating under the pseudonym heisenberg.",
};
export default seriesdescription;

text.js

import react from 'react';
import './text.css';
import seriesdescription from 'data/seriesdescription';
import { uselocation } from 'react-router-dom';

const text = () => {
  const location = uselocation();

  let description;
  if (location.pathname == '/mindhunter') {
    description = seriesdescription.mindhunterdescription;
  } else if (location.pathname == '/sherlock') {
    description = seriesdescription.sherlockdescription;
  } else if (location.pathname == '/breakingbad') {
    description = seriesdescription.breakingbaddescription;
  }
  return (
    <div classname="container_text">
      <h1>overview</h1>
      <div>
        <span>{description}</span>
        <span></span>
      </div>
    </div>
  );
};

export default text;

however, i am wondering if i should make it as an array of object, but then i don't know how to upload it to the text.js file

another moviedescription.js

const seriesdescription = [
  {
    mindhunterdescription:
      'the series tells about the work of fbi special agents holden ford and bill tench, who in 1977 cooperate to develop methods of prosecuting serial killers and to analyze the causes of their crimes.” - netflix "mindhunter" is a story inspired by real events about the beginnings of using psychoanalysis and a psychological approach in solving criminal cases. to this end, the fbi launches a special project in which serial killers are interrogated while serving their crimes. through a series of research, interviews, talks and psychological sessions, they try to get to their motives, learn about the patterns of the murderers\' minds, in order to be able to easily capture those who are still at large.'
  },
  {
    sherlockdescription:
      "in a new version of sir arthur conan doyle's crime stories, the famous eccentric detective tracks down criminals operating in modern london.” - netflix. sherlock holmes lives in 21st century london, a city filled with mystery, crime and deceit. the back streets are alive with robbers, blackmailers, smugglers and serial killers. when the police are desperate they call upon mr sherlock holmes and his unconventional methods of deduction to shed light on the matter. holmes is assisted by his flatmate and friend, dr john watson, who has returned from military service in afghanistan with the royal army medical corps."
  },
  {
    breakingbaddescription:
      "walter white (bryan cranston) is a high school chemistry teacher. he is married to skyler (anna gunn) and teenage son walter junior (rj mitte). the day after his fiftieth birthday, he learns that he suffers from terminal lung cancer. knowing that he will die within a few years, he decides to secure his family's financial future at all costs. together with his former student jesse pinkman (aaron paul), he starts producing the purest methamphetamine in the area. after a while, walt's product becomes the most coveted drug in the city. this gets the attention of the dea anti-drug agency, where walt's brother-in-law, hank (dean norris), works. walter begins to change from a typical domestic into a dangerous dealer operating under the pseudonym heisenberg."
  }
];
export default seriesdescription;

Related Query

More Query from same tag