Skip to content

Commit

Permalink
docs(vue): fix markup
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Sep 2, 2024
1 parent d729f6f commit 79d677f
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/components/markdown/DemoIntegrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ const formatParam = (param, useRealJson = false) => {
const DemoIntegrations = ({ caption, parameters = {}, showCard = true }) => {
const params = useMemo(() => ({ ...DEFAULTS, ...parameters }), [parameters])
const paramKeys = useMemo(() => Object.keys(params), [params])
const withoutUrl = useMemo(() => paramKeys.filter(k => k !== 'url'), [
paramKeys
])
const withoutUrl = useMemo(
() => paramKeys.filter(k => k !== 'url'),
[paramKeys]
)

const react = useMemo(
() =>
Expand Down Expand Up @@ -73,7 +74,7 @@ const DemoIntegrations = ({ caption, parameters = {}, showCard = true }) => {
const param = params[key]
const prefix = typeof param === 'string' ? '' : ':'
const attr = `${prefix}${kebabCase(key)}`
return `\n\t\t${attr}="${formatParam(param)}"`
return `\n ${attr}="${formatParam(param)}"`
})
.join(' '),
[params, paramKeys]
Expand Down Expand Up @@ -107,9 +108,10 @@ const DemoIntegrations = ({ caption, parameters = {}, showCard = true }) => {
return jParams.length ? ` ${jParams}` : ''
}, [params, withoutUrl])

const vanilla = useMemo(() => (jsObject.length ? `, { ${jsObject} }` : ''), [
jsObject
])
const vanilla = useMemo(
() => (jsObject.length ? `, { ${jsObject} }` : ''),
[jsObject]
)

return (
<>
Expand All @@ -120,7 +122,8 @@ const DemoIntegrations = ({ caption, parameters = {}, showCard = true }) => {
<Microlink ${react} />
`,
Vue: `<template>
<Microlink ${vue} />
<Microlink ${vue}
/>
</template>
`,

Expand Down

0 comments on commit 79d677f

Please sign in to comment.