Skip to content

Commit

Permalink
fix: Using cdn github to svg icons
Browse files Browse the repository at this point in the history
  • Loading branch information
ktquez committed Jun 21, 2020
1 parent 8c194f3 commit b241124
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 35 deletions.
12 changes: 0 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"test:unit": "jest",
"test:e2e": "node_modules/.bin/cypress run --headless",
"test:e2e:open": "node_modules/.bin/cypress open ",
"project:publish": "git push --tags origin master && npm run build && npm publish --access public"
"project:publish": "git push --tags origin master && npm run build && npm publish"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -73,7 +73,6 @@
"rollup-plugin-eslint": "^7.0.0",
"rollup-plugin-terser": "^6.1.0",
"rollup-plugin-vue": "^5.1.9",
"rollup-plugin-vue-inline-svg": "^1.1.1",
"standard-version": "^8.0.0",
"vue": "^2.6.11",
"vue-template-compiler": "^2.6.11",
Expand Down
5 changes: 1 addition & 4 deletions rollup.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import commonjs from '@rollup/plugin-commonjs'
import chokidar from 'chokidar'
import { eslint } from 'rollup-plugin-eslint'
import vue from 'rollup-plugin-vue'
import svg from 'rollup-plugin-vue-inline-svg'

export default {
input: 'src/index.js',
Expand All @@ -15,10 +14,8 @@ export default {
plugins: [
commonjs(),
resolve(),
svg(),
eslint({
include: './src/**',
exclude: ['node_modules/**', 'src/icons/**']
include: './src/**'
}),
vue({
css: true,
Expand Down
2 changes: 0 additions & 2 deletions rollup.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ import commonjs from '@rollup/plugin-commonjs'
import replace from '@rollup/plugin-replace'
import { terser } from 'rollup-plugin-terser'
import vue from 'rollup-plugin-vue'
import svg from 'rollup-plugin-vue-inline-svg'

export default commandLineArgs => {
return {
input: 'src/index.js',
external: ['vue-focus-lock'],
plugins: [
commonjs(),
svg(),
replace({
'process.env.NODE_ENV': JSON.stringify('production')
}),
Expand Down
3 changes: 2 additions & 1 deletion src/ListChat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
>
<span
class="vsc-popup-body__link-avatar-brand"
:style="attendant.app ? `background-image: url(https://raw.githubusercontent.com/ktquez/vue-social-chat/master/src/logos/${attendant.app}.png)` : ''"
:style="attendant.app ? `background-image: url(${props.urlAsset}/logos/${attendant.app}.png)` : ''"
/>
</div>
<div class="vsc-popup-body__link-info">
Expand All @@ -42,6 +42,7 @@ export default {
name: 'ListChat',
props: {
urlAsset: String,
attendants: {
type: Array,
default: () => ([])
Expand Down
34 changes: 20 additions & 14 deletions src/SocialChat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
<div
id="vsc-popup-box"
class="vsc-popup-box"
:class="{
'vsc-popup-box--show': show
}"
:class="{ 'vsc-popup-box--show': show }"
>
<div
v-show="$slots.header"
Expand All @@ -19,7 +17,10 @@
</div>
<div class="vsc-popup-body">
<slot name="body">
<ListChat :attendants="attendants" />
<ListChat
:url-asset="urlAssets"
:attendants="attendants"
/>
</slot>
</div>
<div
Expand All @@ -31,9 +32,7 @@
</div>
<button
class="vsc-popup-button vsc-popup-button--default"
:class="{
'vsc-popup-button--no-icon': !icon
}"
:class="{ 'vsc-popup-button--no-icon': !icon }"
aria-haspopup="true"
aria-controls="vsc-popup-box"
aria-expanded="false"
Expand All @@ -46,28 +45,34 @@
name="icon"
:open="show"
>
<chatIcon />
<img
:src="`${urlAssets}/icons/chat.svg`"
alt="chat icon"
aria-hidden="true"
>
</slot>
</span>
<closeIcon v-show="show && icon" />
<img
v-show="show && icon"
:src="`${urlAssets}/icons/close.svg`"
alt="close icon"
aria-hidden="true"
>
</button>
</div>
</FocusLock>
</template>

<script>
import chatIcon from './icons/chat.svg'
import closeIcon from './icons/close.svg'
import ListChat from './ListChat.vue'
import FocusLock from 'vue-focus-lock'
import { URL_ASSETS } from './constants'
export default {
name: 'VueSocialChat',
components: {
chatIcon,
ListChat,
closeIcon,
FocusLock
},
Expand All @@ -83,7 +88,8 @@ export default {
},
data: () => ({
show: false
show: false,
urlAssets: URL_ASSETS
}),
computed: {
Expand Down
1 change: 1 addition & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const URL_ASSETS = 'https://raw.githubusercontent.com/ktquez/vue-social-chat/master/src/'

0 comments on commit b241124

Please sign in to comment.