EmptyState UI module
This commit is contained in:
parent
81999dc486
commit
a7f49d1299
@ -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)
|
||||
|
@ -1,15 +1,27 @@
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
padding-top: 10rem;
|
||||
|
||||
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%;
|
||||
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 {
|
||||
@include h2;
|
||||
line-height: 1.2;
|
||||
max-width: 15em;
|
||||
color: $color-gray;
|
||||
|
||||
@include media($large-screen) {
|
||||
@include h1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
9
templates/components/empty_state.html.to
Normal file
9
templates/components/empty_state.html.to
Normal 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>
|
Loading…
x
Reference in New Issue
Block a user