EmptyState UI module

This commit is contained in:
Andrew Croce 2018-07-30 16:09:55 -04:00
parent 81999dc486
commit a7f49d1299
3 changed files with 42 additions and 12 deletions

View File

@ -46,3 +46,12 @@ class SidenavItem(UIModule):
active=active, active=active,
icon=icon, icon=icon,
subnav=subnav) subnav=subnav)
class EmptyState(UIModule):
def render(self, message, actionLabel, actionHref, icon=None):
return self.render_string(
"components/empty_state.html.to",
message=message,
actionLabel=actionLabel,
actionHref=actionHref,
icon=icon)

View File

@ -1,15 +1,27 @@
.empty-state { .empty-state {
text-align: center; text-align: center;
padding-top: 10rem; padding: 6rem ($gap * 2) 0;
display: flex;
flex-direction: column;
align-items: center;
@include media($medium-screen) {
padding: 8rem ($gap * 4) 0;
}
.icon {
@include icon-size(50);
@include icon-color($color-gray-light);
}
p { p {
font-family: $font-sans; @include h2;
font-weight: 300; line-height: 1.2;
line-height: 10rem; max-width: 15em;
font-size: 44px; color: $color-gray;
line-height: 5rem;
margin: 0 auto; @include media($large-screen) {
padding-bottom: 2rem; @include h1;
max-width: 40%; }
} }
} }

View File

@ -0,0 +1,9 @@
<div class='empty-state'>
<p>{{ message }}</p>
{% if icon %}
{% module Icon(icon) %}
{% end %}
<a href='{{ actionHref }}' class='usa-button usa-button-big'>{{ actionLabel }}</a>
</div>