Skip to content

Commit

Permalink
added: support for dark mode to Markdown component
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimir-8 committed Dec 28, 2023
1 parent f386df7 commit c5b2996
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/LegalText.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React, { Component } from 'react'
import { Button, Center, Row, ScrollView, Spinner } from 'native-base'
import { withTranslation } from 'react-i18next'
import { SafeAreaView } from 'react-native-safe-area-context'
import Markdown from 'react-native-markdown-display'

import NavigationHolder from '../NavigationHolder'
import Markdown from './Markdown'

class LegalText extends Component {

Expand Down
20 changes: 20 additions & 0 deletions src/components/Markdown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react'
import RNMarkdown from 'react-native-markdown-display'
import { useBaseTextColor } from '../styles/theme'

export default function Markdown({ children, style }) {
const baseTextColor = useBaseTextColor()

const componentStyle = {
body: {
color: baseTextColor,
},
...style,
}

return (
<RNMarkdown style={componentStyle} mergeStyle={true}>
{children}
</RNMarkdown>
)
}

0 comments on commit c5b2996

Please sign in to comment.