Skip to content

Commit

Permalink
refactor: Cleanup MarkdownBlock and markdown-renderers files (#7218)
Browse files Browse the repository at this point in the history
* feat: cleanup and move files

* fix type

---------

Co-authored-by: Begoña Alvarez <[email protected]>
  • Loading branch information
evavirseda and begonaalvarezd authored Aug 1, 2023
1 parent 76ecb2f commit 212f876
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<script lang="ts">
import SvelteMarkdown from 'svelte-markdown'
import { SvelteComponent } from 'svelte'
import { ParagraphBlock, LinkBlock } from 'shared/components'
export let text: string
const renderers = {
const renderers: Record<string, typeof SvelteComponent | null> = {
heading: ParagraphBlock,
paragraph: ParagraphBlock,
image: ParagraphBlock,
Expand All @@ -28,12 +29,12 @@
}
</script>

<div class="markdown">
<markdown-wrapper>
<SvelteMarkdown source={text} {renderers} />
</div>
</markdown-wrapper>

<style lang="scss">
.markdown {
markdown-wrapper {
:global(p) {
@apply text-gray-600;
}
Expand Down
2 changes: 2 additions & 0 deletions packages/shared/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export { default as SubjectBox } from './SubjectBox.svelte'
export { default as NetworkIcon } from './NetworkIcon.svelte'
export { default as MenuItem } from './MenuItem.svelte'
export { default as LedgerAnimation } from './LedgerAnimation.svelte'
export { default as MarkdownBlock } from './MarkdownBlock.svelte'
export { default as MediaPlaceholder } from './MediaPlaceholder.svelte'

export * from './atoms'
Expand All @@ -71,3 +72,4 @@ export * from './iconButtons'
export * from './labels'
export * from './pills'
export * from './tiles'
export * from './markdown-renderers'
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="typescript">
<script lang="ts">
import { openUrlInBrowser } from '@core/app/utils'
import { Link } from '@ui'
export let href = ''
export let href: string = ''
function onLinkClick(): void {
openUrlInBrowser(href)
Expand Down
4 changes: 3 additions & 1 deletion packages/shared/components/molecules/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export { default as MarkdownBlock } from './MarkdownBlock.svelte'
export { default as ActivityInformation } from './ActivityInformation.svelte'
export { default as AliasActivityDetails } from './AliasActivityDetails.svelte'
export { default as AssetIcon } from './AssetIcon.svelte'
export { default as SelectorInput } from './SelectorInput.svelte'

0 comments on commit 212f876

Please sign in to comment.