Skip to content

Commit

Permalink
feat: Removed unnecessary computed, update docs, update version
Browse files Browse the repository at this point in the history
  • Loading branch information
vaban-ru committed Dec 12, 2022
1 parent f2185b3 commit 35b299c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 25 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@webzlodimir/vue-avatar",
"version": "0.0.5",
"version": "0.0.6",
"private": false,
"scripts": {
"build": "rimraf dist && vue-tsc && vite build",
Expand Down
27 changes: 3 additions & 24 deletions src/VueAvatar.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div :style="avatarStyles" :class="avatarClasses">
<div :style="avatarStyles" class="vue-avatar">
<template v-if="!slots.default && !props.imgSrc">
{{ parsedUserName }}
</template>
Expand Down Expand Up @@ -36,7 +36,7 @@ const props = withDefaults(defineProps<IProps>(), {
});
/**
* Get uppercase letters from username
* Computed return uppercase letters from username
*/
const parsedUserName = computed(() => {
return props.username
Expand All @@ -46,7 +46,7 @@ const parsedUserName = computed(() => {
});
/**
* Compute components styles
* Computed return components styles
*/
const avatarStyles = computed(() => {
return {
Expand All @@ -59,19 +59,6 @@ const avatarStyles = computed(() => {
};
});
/**
* Compute components classes
*/
const avatarClasses = computed(() => {
return [
"vue-avatar",
{
"vue-avatar--rounded":
props.borderRadius && props.borderRadius.length > 0,
},
];
});
/**
* This function takes colors in hex format (i.e. #F06D06,
* with or without hash) and lightens or darkens them with a value.
Expand Down Expand Up @@ -149,13 +136,5 @@ const slots = useSlots();
border-radius: inherit;
}
}
&--rounded {
&:deep {
img,
picture {
border-radius: inherit;
}
}
}
}
</style>

0 comments on commit 35b299c

Please sign in to comment.