forked from Shopify/dawn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathannouncement-bar.liquid
82 lines (81 loc) · 2.68 KB
/
announcement-bar.liquid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{%- for block in section.blocks -%}
{%- case block.type -%}
{%- when 'announcement' -%}
<div class="announcement-bar color-{{ block.settings.color_scheme }}" role="region" aria-label="{{ 'sections.header.announcement' | t }}">
{%- if block.settings.text != blank -%}
{%- if block.settings.link != blank -%}
<a href="{{ block.settings.link }}" class="announcement-bar__link link link--text focus-inset animate-arrow">
{%- endif -%}
<p class="announcement-bar__message h5">
{{ block.settings.text | escape }}
{%- if block.settings.link != blank -%}
{% render 'icon-arrow' %}
{%- endif -%}
</p>
{%- if block.settings.link != blank -%}
</a>
{%- endif -%}
{%- endif -%}
</div>
{%- endcase -%}
{%- endfor -%}
{% schema %}
{
"name": "t:sections.announcement-bar.name",
"max_blocks": 12,
"blocks": [
{
"type": "announcement",
"name": "t:sections.announcement-bar.blocks.announcement.name",
"settings": [
{
"type": "text",
"id": "text",
"default": "Welcome to our store",
"label": "t:sections.announcement-bar.blocks.announcement.settings.text.label"
},
{
"type": "select",
"id": "color_scheme",
"options": [
{
"value": "background-1",
"label": "t:sections.announcement-bar.blocks.announcement.settings.color_scheme.options__1.label"
},
{
"value": "background-2",
"label": "t:sections.announcement-bar.blocks.announcement.settings.color_scheme.options__2.label"
},
{
"value": "inverse",
"label": "t:sections.announcement-bar.blocks.announcement.settings.color_scheme.options__3.label"
},
{
"value": "accent-1",
"label": "t:sections.announcement-bar.blocks.announcement.settings.color_scheme.options__4.label"
},
{
"value": "accent-2",
"label": "t:sections.announcement-bar.blocks.announcement.settings.color_scheme.options__5.label"
}
],
"default": "accent-1",
"label": "t:sections.announcement-bar.blocks.announcement.settings.color_scheme.label"
},
{
"type": "url",
"id": "link",
"label": "t:sections.announcement-bar.blocks.announcement.settings.link.label"
}
]
}
],
"default": {
"blocks": [
{
"type": "announcement"
}
]
}
}
{% endschema %}