Skip to content

Instantly share code, notes, and snippets.

@techomoro
Created February 17, 2020 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techomoro/f764f12c856690ca92b283608aaf4164 to your computer and use it in GitHub Desktop.
Save techomoro/f764f12c856690ca92b283608aaf4164 to your computer and use it in GitHub Desktop.
import React, { Fragment } from "react";
function Contact(props) {
let content = {
English: {
title: "Contact Us",
address: "Lorem ipsum, Lorem ipsum, Lorem, 123456",
phone: {
label: "Phone",
value: "+12 34567"
},
email: {
label: "Email",
value: "abc@example.com"
}
},
Malayalam: {
title: "ബന്ധപ്പെടുക",
address: "ലോറെം ഇപ്സിയം, ലോറെം ഇപ്സിയം, ലോറെം, 123456",
phone: {
label: "ഫോൺ",
value: "+12 34567"
},
email: {
label: "ഇമെയിൽ",
value: "abc@example.com"
}
}
};
props.language === "Malayalam"
? (content = content.Malayalam)
: (content = content.English);
return (
<Fragment>
<h2>{content.title}</h2>
<hr />
<address>{content.address}</address>
<address>
<abbr title="Phone">{content.phone.label}: </abbr>
{content.phone.value}
<br />
<abbr title="Email">{content.email.label}: </abbr>
<a href={`mailto:${content.email.value}`}>{content.email.value}</a>
</address>
</Fragment>
);
}
export default Contact;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment