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,
icon=icon,
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 {
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 {
font-family: $font-sans;
font-weight: 300;
line-height: 10rem;
font-size: 44px;
line-height: 5rem;
margin: 0 auto;
padding-bottom: 2rem;
max-width: 40%;
@include h2;
line-height: 1.2;
max-width: 15em;
color: $color-gray;
@include media($large-screen) {
@include h1;
}
}
}

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>