2021-10-09 12:58:33 +00:00
|
|
|
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'
|
2021-10-09 12:58:33 +00:00
|
|
|
|
|
|
|
function App() {
|
2021-10-15 15:58:37 +00:00
|
|
|
var res;
|
|
|
|
const socialTypes = ["facebook", "instagram", "twitter", "github", "youtube", "linkedin", "pinterest", "messenger", "whatsapp"];
|
|
|
|
|
2021-10-09 12:58:33 +00:00
|
|
|
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;
|
|
|
|
})}
|
2021-10-09 12:58:33 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|