linkroots/src/App.js

30 lines
949 B
JavaScript
Raw Normal View History

import './App.css';
2021-10-15 15:58:37 +00:00
import {AwesomeButton, AwesomeButtonSocial} from 'react-awesome-button';
import AwesomeButtonStyle from "react-awesome-button/dist/styles.css";
2021-10-14 16:56:16 +00:00
import data from './roots.json'
function App() {
2021-10-15 15:58:37 +00:00
var res;
const socialTypes = ["facebook", "instagram", "twitter", "github", "youtube", "linkedin", "pinterest", "messenger", "whatsapp"];
return (
<div className="App">
2021-10-14 16:56:16 +00:00
<h1 id="title">{data.title}</h1>
2021-10-15 15:58:37 +00:00
{data.links.map((rootDetail, index)=>{
if(socialTypes.includes(rootDetail.type)) {
res = <button className="roots">{rootDetail.text}</button>
}
else if (rootDetail.type === "basic") {
res = <button className="roots">{rootDetail.text}</button>
}
else {
// throw "One of your roots has an unrecognized type. Check out the documentation for the supported types.";
}
return res;
})}
</div>
);
}
export default App;