function ReadMeSection({ sectionName }) {
const [text, setText] = React.useState('');
React.useEffect(() => {
fetch('/static/about/' + sectionName)
.then(response => response.text())
.then(response => setText(response.split("\n").map(paragraph => (
{paragraph}
))));
}, []);
return (
{text}
)
}
const sections = ['motivation', 'user-stories', 'project-scope'];
sections.forEach(section => {
ReactDOM.render(, document.querySelector("#about-" + section));
})
function FeatureSection() {
const [data, setData] = React.useState({ features: [] });
React.useEffect(() => {
fetch('/static/about/features.json')
.then(response => response.json())
.then(response => setData(response))
}, [])
return (
Feature |
Details |
Progress |
{
data.features.map(feature => (
{
feature.rows.map((row, i) => (
{i === 0 && {feature.name} | }
{row.details} |
{row.progress} |
))
}
))
}
)
}
ReactDOM.render(, document.querySelector("#about-features"))