Skip to content

Commit

Permalink
Merge pull request #115 from Cleo-Tech/112-who-prendono-di-mira-gioca…
Browse files Browse the repository at this point in the history
…tore

Fix presa di mira una persona
  • Loading branch information
fmanto01 authored Nov 3, 2024
2 parents 6711be9 + 426cd93 commit ae1932b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
20 changes: 15 additions & 5 deletions Scoprimi/src/components/game/QuestionComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@ interface QuestionProps {

const placeholderChar = '$';

const QuestionComponent: React.FC<QuestionProps> = ({ question, selectedPlayer }) => (
<div id="questionContainer">
<h4 id="question">{question.replace(placeholderChar, selectedPlayer)}</h4>
</div>
);
const QuestionComponent: React.FC<QuestionProps> = ({ question, selectedPlayer }) => {
// Sostituisce il placeholder con il nome del giocatore e `\n` con `<br />`
const formattedQuestion = question
.replace(placeholderChar, selectedPlayer)
.replace(/\n/g, '<br />');

return (
<div id="questionContainer">
<h4
id="question"
dangerouslySetInnerHTML={{ __html: formattedQuestion }}
/>
</div>
);
};

export default QuestionComponent;
12 changes: 6 additions & 6 deletions Server/src/questions.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@
"concert£Di quale artista $ andrebbe al concerto?"
],
"who": [
"Cosa direbbe $: Dai mamma! Esci dalla stanza che mi sto ...!?",
"Cosa direbbe $: Il peggior film da mettere quando vuoi fare Netflix & Chill",
"Cosa direbbe $: Un risultato notevole che non metteresti sul curriculum",
"Cosa direbbe $: L'ultima cosa che vedi prima di saltare in aria",
"Cosa direbbe $: Non volevo ucciderlo! È solo che ...",
"Cosa direbbe $: Il nome di un insegnante che sai che odieresti all'istante"
"Cosa risponderebbe $? \n Dai mamma! Esci dalla stanza che mi sto ...!?",
"Cosa risponderebbe $? \n Il peggior film da mettere quando vuoi fare Netflix & Chill",
"Cosa risponderebbe $? \n Un risultato notevole che non metteresti sul curriculum",
"Cosa risponderebbe $? \n L'ultima cosa che vedi prima di saltare in aria",
"Cosa risponderebbe $? \n Non volevo ucciderlo! È solo che ...",
"Cosa risponderebbe $? \n Il nome di un insegnante che sai che odieresti all'istante"
]
}

0 comments on commit ae1932b

Please sign in to comment.