Skip to content

Commit

Permalink
fix(Avatar): remove gradient support
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Feb 2, 2022
1 parent 5e44c54 commit ed499b3
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 46 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"@unocss/nuxt": "^0.22.6",
"@vueuse/core": "^7.5.5",
"defu": "^5.0.1",
"gradient-avatar": "^1.0.2",
"lodash-es": "^4.17.21",
"nanoid": "^3.2.0",
"pathe": "^0.2.0"
Expand Down
6 changes: 0 additions & 6 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,5 @@ export default defineNuxtModule<ModuleOptions>({

// Add CSS
nuxt.options.css.push(resolve(runtimeDir, 'css', 'forms.css'))

nuxt.options.vite = {
optimizeDeps: {
exclude: ['gradient-avatar']
}
}
}
})
15 changes: 0 additions & 15 deletions src/runtime/components/elements/Avatar.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<template>
<span class="relative inline-flex items-center justify-center" :class="avatarClass" @click="goto">
<img v-if="url" :src="url" :alt="alt" :class="[sizeClass, roundedClass]">
<!-- eslint-disable-next-line vue/no-v-html -->
<span v-else-if="gradientPlaceholder" class="w-full h-full overflow-hidden" :class="roundedClass" v-html="gradientPlaceholder" />
<span
v-else-if="placeholder"
class="font-medium leading-none u-text-gray-900 uppercase"
Expand Down Expand Up @@ -31,8 +29,6 @@
</template>

<script>
import avatar from 'gradient-avatar'
export default {
props: {
src: {
Expand Down Expand Up @@ -62,10 +58,6 @@ export default {
type: Boolean,
default: false
},
gradient: {
type: Boolean,
default: false
},
status: {
type: String,
default: null,
Expand All @@ -88,13 +80,6 @@ export default {
return this.alt.split(' ').map(word => word.charAt(0)).join('')
},
gradientPlaceholder () {
if (!this.gradient) {
return
}
return avatar(this.alt || new Date().toString())
},
sizeClass () {
return ({
xxxs: 'h-4 w-4 text-xs',
Expand Down
24 changes: 0 additions & 24 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3773,15 +3773,6 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4,
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96"
integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==

gradient-avatar@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/gradient-avatar/-/gradient-avatar-1.0.2.tgz#42bb408e402b1f21aafba3878858721055515224"
integrity sha512-Od9KI2YImV60wnsvU/u6GEyBm2fiHUUHgiLySE243GYl/T/tiJMJ5QYey8o7tepugmlnUGQRaCItHv19UnUjUg==
dependencies:
hsl-rgb "^1.0.0"
hsl-triad "^1.0.0"
string-hash "^1.1.3"

gzip-size@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-6.0.0.tgz#065367fd50c239c0671cbcbad5be3e2eeb10e462"
Expand Down Expand Up @@ -3904,16 +3895,6 @@ hosted-git-info@^4.0.0, hosted-git-info@^4.0.1:
dependencies:
lru-cache "^6.0.0"

hsl-rgb@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/hsl-rgb/-/hsl-rgb-1.0.0.tgz#05ca49f6d960c9d8e237f27d7bdf284b656de5ab"
integrity sha512-cNq+7sfwzSDoiG/jiu8wZpOmjScUZrMKiI33tH3aQ1MZsXWQd0yJjMpPwu2OZFYa4D/bOT1aCbB5gS1kOqFx1A==

hsl-triad@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/hsl-triad/-/hsl-triad-1.0.0.tgz#0d27f397f75e8beb6cf9c361970ffbe104652220"
integrity sha512-PKnjrMugS6sHC5dVh4VQZYOHEKG2QILjVwbpEtNjEV19RyswuIxrIiGhumVJjya/FjK/p9gX6+zRMXFGTvaQAA==

html-entities@^2.1.0:
version "2.3.2"
resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.3.2.tgz#760b404685cb1d794e4f4b744332e3b00dcfe488"
Expand Down Expand Up @@ -6374,11 +6355,6 @@ std-env@^3.0.1:
resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.0.1.tgz#bc4cbc0e438610197e34c2d79c3df30b491f5182"
integrity sha512-mC1Ps9l77/97qeOZc+HrOL7TIaOboHqMZ24dGVQrlxFcpPpfCHpH+qfUT7Dz+6mlG8+JPA1KfBQo19iC/+Ngcw==

string-hash@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/string-hash/-/string-hash-1.1.3.tgz#e8aafc0ac1855b4666929ed7dd1275df5d6c811b"
integrity sha1-6Kr8CsGFW0Zmkp7X3RJ1311sgRs=

string-width@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
Expand Down

1 comment on commit ed499b3

@vercel
Copy link

@vercel vercel bot commented on ed499b3 Feb 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

Please sign in to comment.