Skip to content

Commit

Permalink
toast demo
Browse files Browse the repository at this point in the history
  • Loading branch information
codecalm committed Nov 3, 2020
1 parent 18c61ca commit ee3fc91
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/pages/_includes/ui/toast.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{% assign person-id = include.person-id | default: 2 %}
{% assign person = site.data.people[person-id] %}
<div class="toast show" role="alert" aria-live="assertive" aria-atomic="true" data-autohide="false" data-toggle="toast">
<div class="toast-header">
{% include ui/avatar.html person=person class="mr-2" %}
<strong class="mr-auto">{{ person.full_name }}</strong>
<small>{{ include.date | default: '11 mins ago' }}</small>
<button type="button" class="ml-2 close" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="toast-body">
{{ include.text | default: 'Hello, world! This is a toast message.' }}
</div>
{% unless include.hide-header %}
<div class="toast-header">
{% include ui/avatar.html person=person class="mr-2" size="xs" %}
<strong class="mr-auto">{{ person.full_name }}</strong>
<small>{{ include.date | default: '11 mins ago' }}</small>
<button type="button" class="ml-2 btn-close" data-dismiss="toast" aria-label="Close"></button>
</div>
{% endunless %}
<div class="toast-body">
{% if include.cookies %}
🍪&nbsp;Our site uses cookies. By continuing to use our site, you agree to our Cookie Policy. <a href="#" class="btn btn-primary btn-sm">I understand</a>
{% else %}
{{ include.text | default: 'Hello, world! This is a toast message.' }}
{% endif %}
</div>
</div>

0 comments on commit ee3fc91

Please sign in to comment.