{%- comment -%}
  unrigd giveaway section for Shopify themes (Online Store 2.0).
  Install: Online Store > Themes > Edit code > Sections > Add a new section,
  name it "unrigd-giveaway", paste this file, save. Then add the
  "unrigd giveaway" section in the theme editor and enter your giveaway,
  e.g. your-org/your-giveaway (from the Share popup in your unrigd dashboard).
{%- endcomment -%}
<div class="page-width" style="padding: 24px 0;">
  {%- assign path = section.settings.giveaway | strip | downcase -%}
  {%- if path contains '/' -%}
    <div data-unrigd="{{ path | escape }}" data-title="{{ section.settings.title | escape }}"></div>
    <script src="https://unrigd.app/embed.js" async></script>
  {%- else -%}
    <p>Set the giveaway in the theme editor, like your-org/your-giveaway.</p>
  {%- endif -%}
</div>

{% schema %}
{
  "name": "unrigd giveaway",
  "settings": [
    { "type": "text", "id": "giveaway", "label": "Giveaway", "info": "your-org/your-giveaway, from the Share popup in unrigd" },
    { "type": "text", "id": "title", "label": "Accessible title", "default": "Giveaway" }
  ],
  "presets": [{ "name": "unrigd giveaway" }]
}
{% endschema %}
