Skip to content
This repository has been archived by the owner on Nov 30, 2020. It is now read-only.

Commit

Permalink
feat(snackbar): add dismiss button and make dismiss button and action…
Browse files Browse the repository at this point in the history
… button optional (#214)
  • Loading branch information
tychenjiajun authored and matsp committed Apr 4, 2019
1 parent 8447712 commit a90038e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
17 changes: 16 additions & 1 deletion components/snackbar/Snackbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,22 @@
>
<slot />
</div>
<div class="mdc-snackbar__actions">
<div
v-if="hasDismiss || actionButtonText !== ''"
class="mdc-snackbar__actions"
>
<button
v-if="actionButtonText !== ''"
class="mdc-button mdc-snackbar__action"
type="button"
/>
<button
v-if="hasDismiss"
class="mdc-icon-button mdc-snackbar__dismiss material-icons"
title="Dismiss"
>
close
</button>
</div>
</div>
</div>
Expand Down Expand Up @@ -64,6 +75,10 @@ export default {
stacked: {
type: Boolean,
default: false
},
hasDismiss: {
type: Boolean,
default: false
}
},
data () {
Expand Down
2 changes: 2 additions & 0 deletions components/snackbar/styles.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
@import "@material/snackbar/mdc-snackbar";
@import "@material/button/mdc-button";
@import "@material/icon-button/mdc-icon-button";

2 changes: 1 addition & 1 deletion docs/.vuepress/components/SnackbarDemo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<ComponentSection>
<m-button :disabled="disabled" @click="onClick" raised>Open Snackbar</m-button>
<m-snackbar :leading="radioProps[1].value" :stacked="radioProps[2].value" @closed="disabled = false"
action-button-text="Retry"
action-button-text="Retry" has-dismiss
label-text="Can't send photo. Retry in 5 seconds." style="z-index: 30" v-model="value"/>
</ComponentSection>
<ComponentProps
Expand Down

0 comments on commit a90038e

Please sign in to comment.