Fix Carbon not being styled

This commit is contained in:
Sam Carlton 2022-07-27 12:24:24 -05:00
parent 75199e2183
commit 45680fc776
2 changed files with 15 additions and 2 deletions

View file

@ -39,6 +39,19 @@
import CarbonInline from './carbon-inline.vue' import CarbonInline from './carbon-inline.vue'
const ads = { const ads = {
// Since Vue renders the ad on the server
// but destroys the ad when hydrating on
// the browser, we render an empty placeholder ad
// so that it get's properly rendered at the browser
// and so that our ad css still get's imported.
'placeholder': {
url: '/',
imageSrc: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
imageAlt: '',
copy: '',
corner: '',
},
'new-world-1': { 'new-world-1': {
url: 'https://amzn.to/3bllXrC', url: 'https://amzn.to/3bllXrC',
imageSrc: 'https://vumbnail.com/OKnUBs-Ko44.jpg', imageSrc: 'https://vumbnail.com/OKnUBs-Ko44.jpg',
@ -77,7 +90,7 @@ export default {
name: { name: {
type: String, type: String,
default: 'default' default: 'default'
} },
}, },
computed: { computed: {
ad () { ad () {

View file

@ -47,7 +47,7 @@
<div class="slot-wrapper"> <div class="slot-wrapper">
<slot name="ad-inline"> <slot name="ad-inline">
<AdInline <AdInline
v-if="isSSR === false" :name="isSSR ? 'placeholder' : 'default'"
v-once v-once
/> />
</slot> </slot>