JSFiddle - React, Tailwind, and code Playground

by mauro_nappolini

HTML

<div class="gbp-pricing">this is gbp price</div>
<div class="euro-pricing">this is euro price</div>
<div class="usd-pricing">this is usd price</div>

CSS

.gbp-pricing{
  display: none; 
}

.euro-pricing{
  display: none; 
}

.usd-pricing{
  display: none; 
}

JavaScript

$.get("https://ipinfo.io", function(response) {
    const country =  response.country; 
    
    // Country codes for GB 
    	const england = "GB";
			const isleOfMan = "IM";

		// Country codes for Europe
    	const austria = "AT";
			const croatia = "HR";
			const czech = "CZ";
			const denmark = "DK";
			const estonia = "EE";
			const feoreIslands = "FO";
			const finland = "FI";
			const france = "FR";
			const germany = "DE";
			const greece = "GR";
			const hungry = "HU";
			const iceland = "IS";
			const italy = "IT";
			const latvia = "LV";
			const lithuania = "LT";
			const luxembourg = "LU";
			const malta = "MT";
			const moldova = "MD";
			const monaco = "MC";
			const netherlands = "NL";
			const norway = "NO";
			const poland = "PL";
			const protugal = "PT";
			const romania = "RO";
			const russia = "RU";
			const slovakia = "SK";
			const spain = "ES";
			const swtizerland = "SZ";
			const sweden = "SE";
			const ukrane = "UA";
      const ireland = "IE";

    
	if (country === england || country === ireland || country === isleOfMan ) {
           $('.usd-pricing').css("display", "none");
           $('.euro-pricing').css("display", "none");     
           $('.gbp-pricing').css("display", "block");
           
		} else if (country === austria || country === croatia ||country === czech || country === denmark || country === estonia || country === feoreIslands || country === finland || country === france || country === germany || country === greece || country === hungry || country === iceland || country === italy || country === latvia || country === lithuania || country === luxembourg || country === malta || country === moldova || country === monaco || country === netherlands || country === norway || country === poland || country === protugal || country === romania || country === russia || country === slovakia || country === spain || country === swtizerland || country === sweden || country === ukrane ){
       $('.usd-pricing').css("display",...