<div class="page-width rich-text">
  <div class="grid">
    <div class="grid__item {% unless section.settings.full_width %} medium-up--two-thirds medium-up--push-one-sixth{% endunless %}">
      {% if section.settings.section_title != blank %}
        <div class="rich-text__heading--{{ section.settings.text_size }} text-center">
          <h2 class="heading">{{ section.settings.section_title | escape }}</h2>
        </div>
      {% endif %}
      {% if section.settings.text != blank %}
        <div class="rich-text__text--{{ section.settings.text_size }} rte-setting text-center">{{ section.settings.text }}</div>
      {% endif %}
    </div>
  </div>
</div>

{% schema %}
  {
    "name": "Title with text",
    "class": "index-section",
    "settings": [
      {
        "type": "checkbox",
        "id": "full_width",
        "label": "Wide display"
      },
      {
        "type": "text",
        "id": "section_title",
        "label": "Heading",
        "default": "Talk about your brand"
      },
      {
        "type": "richtext",
        "id": "text",
        "label": "Text",
        "default": "<p>Use this text to share information about your brand with your customers. Describe a product, share announcements, or welcome customers to your store.</p>"
      },
      {
        "type": "select",
        "id": "text_size",
        "label": "Size",
        "default": "medium",
        "options": [
          {
            "label": "Small",
            "value": "small"
          },
          {
            "label": "Medium",
            "value": "medium"
          },
          {
            "label": "Large",
            "value": "large"
          }
        ]
      }
    ],
    "presets": [
      {
        "name": "Title with text",
        "category": "Text"
      }
    ]
  }
{% endschema %}
