Adding the links

This commit is contained in:
mikwee 2021-11-08 20:47:58 +02:00
parent 40c696bb4d
commit 39f46548a5

View file

@ -15,34 +15,34 @@ function App() {
<ButtonGroup vertical> <ButtonGroup vertical>
{data.links.map((rootDetail, index)=>{ {data.links.map((rootDetail, index)=>{
if(rootDetail.type === "facebook") { if(rootDetail.type === "facebook") {
res = <Button id="facebook" variant="primary"><Facebook/> {rootDetail.text}</Button> res = <Button id="facebook" variant="primary" href={rootDetail.url}><Facebook/> {rootDetail.text}</Button>
} }
else if(rootDetail.type === "instagram") { else if(rootDetail.type === "instagram") {
res = <Button id="instagram" variant="primary"><Instagram/> {rootDetail.text}</Button> res = <Button id="instagram" variant="primary" href={rootDetail.url}><Instagram/> {rootDetail.text}</Button>
} }
else if (rootDetail.type === "twitter") { else if (rootDetail.type === "twitter") {
res = <Button id="twitter" variant="primary"><Twitter/> {rootDetail.text}</Button> res = <Button id="twitter" variant="primary" href={rootDetail.url}><Twitter/> {rootDetail.text}</Button>
} }
else if (rootDetail.type === "github") { else if (rootDetail.type === "github") {
res = <Button id="github" variant="primary"><Github/> {rootDetail.text}</Button> res = <Button id="github" variant="primary" href={rootDetail.url}><Github/> {rootDetail.text}</Button>
} }
else if (rootDetail.type === "youtube") { else if (rootDetail.type === "youtube") {
res = <Button id="youtube" variant="primary"><Youtube/> {rootDetail.text}</Button> res = <Button id="youtube" variant="primary" href={rootDetail.url}><Youtube/> {rootDetail.text}</Button>
} }
else if (rootDetail.type === "linkedin") { else if (rootDetail.type === "linkedin") {
res = <Button id="linkedin" variant="primary"><Linkedin/> {rootDetail.text}</Button> res = <Button id="linkedin" variant="primary" href={rootDetail.url}><Linkedin/> {rootDetail.text}</Button>
} }
else if (rootDetail.type === "pinterest") { else if (rootDetail.type === "pinterest") {
res = <Button id="pinterest" variant="primary"><Pinterest/> {rootDetail.text}</Button> res = <Button id="pinterest" variant="primary" href={rootDetail.url}><Pinterest/> {rootDetail.text}</Button>
} }
else if (rootDetail.type === "tumblr") { else if (rootDetail.type === "tumblr") {
res = <Button id="tumblr" variant="primary">{rootDetail.text}</Button> res = <Button id="tumblr" variant="primary" href={rootDetail.url}>{rootDetail.text}</Button>
} }
else if (rootDetail.type === "reddit") { else if (rootDetail.type === "reddit") {
res = <Button id="reddit" variant="primary"><Reddit/> {rootDetail.text}</Button> res = <Button id="reddit" variant="primary" href={rootDetail.url}><Reddit/> {rootDetail.text}</Button>
} }
else if (rootDetail.type === "basic") { else if (rootDetail.type === "basic") {
res = <Button variant="primary">{rootDetail.text}</Button> res = <Button variant="primary" href={rootDetail.url}>{rootDetail.text}</Button>
} }
else { else {
// throw "One of your roots has an unrecognized type. Check out the documentation for the supported types."; // throw "One of your roots has an unrecognized type. Check out the documentation for the supported types.";