-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTextWindow.js
More file actions
28 lines (26 loc) · 937 Bytes
/
Copy pathTextWindow.js
File metadata and controls
28 lines (26 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import React from 'react';
// text window component for displaying main analysis text
function TextWindow({title, textArray, pageTitle}) {
// mapping text array prop to paragraph elements
const textElements = textArray.map((text, index) => {return <p key={index.toString()}>{text}</p>});
return (
<div className="comment text-module">
<div className="window-title">
{/* using ternary to alter size of title depending on pageTitle boolean - whether the window is acting as title for page or not */}
{
pageTitle === true ?
<h2>{title}</h2>
:
<h3>{title}</h3>
}
<div>
{/* buttons to be part of band at the top of window next to title */}
<button className="module-button">-</button>
<button className="module-button">X</button>
</div>
</div>
{textElements}
</div>
)
}
export default TextWindow;