-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(LoadingIndicator): Added spinning loading indicator
- Loading branch information
1 parent
fe90712
commit b08b6d6
Showing
8 changed files
with
73 additions
and
12 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use common::icons::outline::Shape as Icon; | ||
use common::icons::Icon as IconElement; | ||
use dioxus::prelude::*; | ||
|
||
#[derive(PartialEq, Eq, Props)] | ||
pub struct Props { | ||
#[props(optional)] | ||
spinning: Option<bool>, | ||
} | ||
|
||
#[allow(non_snake_case)] | ||
pub fn Loader(cx: Scope<Props>) -> Element { | ||
cx.render(rsx!( | ||
div { | ||
class: "loader", | ||
div { | ||
class: "spin", | ||
IconElement { icon: Icon::Loader } | ||
} | ||
})) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.loader { | ||
height: 20px; | ||
width: 20px; | ||
position: relative; | ||
overflow: hidden; | ||
|
||
.spin { | ||
height: 20px; | ||
width: 20px; | ||
animation: spin 1s infinite ease-out; | ||
top: 10px; | ||
left: 10px; | ||
position: relative; | ||
display: inline-block; | ||
} | ||
|
||
svg { | ||
fill: transparent; | ||
stroke: var(--text-color); | ||
} | ||
} | ||
|
||
@keyframes spin { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters