From 9b8ac8f1b346b2decafc157a5464daed3d3471e9 Mon Sep 17 00:00:00 2001 From: Grzegorz Leoniec Date: Thu, 14 Mar 2019 21:03:28 +0100 Subject: [PATCH] Fixed avatar and added online status --- .../components/data-display/Avatar/Avatar.vue | 20 +++++++----- .../components/data-display/Avatar/demo.md | 31 +++++++++++-------- .../components/data-display/Avatar/style.scss | 18 ++++++++++- 3 files changed, 48 insertions(+), 21 deletions(-) diff --git a/src/system/components/data-display/Avatar/Avatar.vue b/src/system/components/data-display/Avatar/Avatar.vue index c61b892d6..308e6efd4 100644 --- a/src/system/components/data-display/Avatar/Avatar.vue +++ b/src/system/components/data-display/Avatar/Avatar.vue @@ -1,15 +1,15 @@ + @@ -30,7 +35,8 @@ export default { backgroundColor: { type: String, default: null }, name: { type: String, default: 'Anonymus' }, size: { type: [Number, String], default: '32px' }, - image: { type: String, default: null } + image: { type: String, default: null }, + isOnline: { type: Boolean, default: false } }, data() { return { diff --git a/src/system/components/data-display/Avatar/demo.md b/src/system/components/data-display/Avatar/demo.md index a0c0c5897..384d2e09f 100644 --- a/src/system/components/data-display/Avatar/demo.md +++ b/src/system/components/data-display/Avatar/demo.md @@ -12,28 +12,33 @@ -``` - -## Without Image - -```html - + size="60px" +/> ``` ## Broken Image ```html + name="Peter Sommerfield" + image="http://not-valid-image-link.org/image-does-not-exist.jpg" +/> ``` -## Anonymus +## Anonymous ```html + image="http://not-valid-image-link##.org/image-does-not-exist.jpg" +/> +``` + +## Online Status + +```html + ``` diff --git a/src/system/components/data-display/Avatar/style.scss b/src/system/components/data-display/Avatar/style.scss index d6932d85e..61ca5420e 100644 --- a/src/system/components/data-display/Avatar/style.scss +++ b/src/system/components/data-display/Avatar/style.scss @@ -13,7 +13,7 @@ } &::after { - content: ''; + content: ""; position: absolute; width: 100%; height: 100%; @@ -23,6 +23,22 @@ border-radius: 50%; } + &.is-online::before { + content: ""; + position: absolute; + width: 33%; + height: 33%; + max-width: 15px; + max-height: 15px; + min-width: 10px; + min-height: 10px; + bottom: 0; + right: 0; + border: 2px solid $background-color-base; + border-radius: 100%; + background-color: $color-success; + } + img { width: 100%; height: 100%;