In React (JSX), you create a component like so:
function Button(props) {
return (
<button className={"button " + (props.color ? props.color : '')} type="button">
{props.value}
</button>| {% layout 'redirect' %} |
| <!DOCTYPE html> | |
| <html class="template-{{ template | handle }}" lang="{{ shop.locale }}"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width,initial-scale=1" /> | |
| <meta name="robots" content="noindex, nofollow" /> | |
| <meta http-equiv="refresh" content="0; url=/" /> | |
| {{ content_for_header }} | |
| </head> |
| var express = require('express'); | |
| var cors = require('cors'); | |
| var Shopify = require('shopify-api-node'); | |
| var app = express(); | |
| var port = 3000; | |
| // Shopify API | |
| var shopify = new Shopify({ | |
| shopName: 'liquify-scripts', |
| {% assign google_analytics_id = nil %} | |
| {% if content_for_header contains "ga('create', '" %} | |
| {% assign google_analytics_id = content_for_header | split: "ga('create', '" | last | split: "'" | first | strip %} | |
| {% endif %} | |
| {% if google_analytics_id %} | |
| <p>My Google Analytics ID is: {{ google_analytics_id }}</p> | |
| {% endif %} |
| var element = document.querySelector('[data-module-language-selector]'); | |
| if (element) { | |
| element.addEventListener('change', (event) => { | |
| window.location = event.target.value; | |
| }); | |
| } |
| <ul class="instagram__items"></ul> |