Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/screens/ActDetail/ActDetailScreen.styles.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { StyleSheet } from "react-native";

import { Layout } from "style";
import { Colors, Layout } from "style";

export default StyleSheet.create({
container: {
...Layout.containerWithPadding,
},
linkStyle: {
color: Colors.primary,
textDecorationLine: "underline",
},
});
9 changes: 7 additions & 2 deletions app/screens/ActDetail/ActDetailScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ const ActDetailScreen: NavStatelessComponent = () => {
<HTML
source={{ html: body }}
contentWidth={contentWidth}
onLinkPress={ui.onHTMLBodyLinkPress}
baseFontStyle={baseFontStyle}
baseStyle={baseFontStyle}
tagsStyles={{ a: styles.linkStyle }}
renderersProps={{
a: {
onPress: ui.onHTMLBodyLinkPress,
},
}}
renderers={{
img: (attribs) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down
22 changes: 20 additions & 2 deletions app/screens/InfoModal/InfoModalScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
import React from "react";
import { ScrollView } from "react-native";
import { ScrollView, StyleSheet } from "react-native";
import { useRoute } from "@react-navigation/native";
import HTML from "react-native-render-html";

import { ui } from "utils";
import { NavStatelessComponent } from "interfaces";
import { Layout } from "constant";
import { Colors } from "style";

import styles from "./InfoModalScreen.styles";
import navigationOptions from "./InfoModal.navigationOptions";
import methodology from "../../../assets/methodology/methodology.json";
import emissionInfo from "../../../assets/emission-info/emission-info.json";

const InfoModalScreen: NavStatelessComponent = () => {
const linkStyle = StyleSheet.create({
a: {
color: Colors.primary,
textDecorationLine: "underline",
},
});
const route = useRoute();

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand All @@ -32,7 +40,17 @@ const InfoModalScreen: NavStatelessComponent = () => {
style={styles.container}
contentInsetAdjustmentBehavior="automatic"
>
<HTML source={{ html }} onLinkPress={ui.onHTMLBodyLinkPress} baseFontStyle={styles.text} />
<HTML
source={{ html }}
contentWidth={Layout.screen.width}
baseStyle={styles.text}
tagsStyles={linkStyle}
renderersProps={{
a: {
onPress: ui.onHTMLBodyLinkPress,
},
}}
/>
</ScrollView>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@ exports[`InfoModalScreen renders correctly 1`] = `
}
>
<HTML
baseFontStyle={
baseStyle={
{
"fontSize": 18,
}
}
onLinkPress={[Function]}
contentWidth={375}
renderersProps={
{
"a": {
"onPress": [Function],
},
}
}
source={
{
"html": "<h1>How is your carbon footprint calculated?</h1>
Expand All @@ -45,6 +52,14 @@ exports[`InfoModalScreen renders correctly 1`] = `
",
}
}
tagsStyles={
{
"a": {
"color": "#0F853B",
"textDecorationLine": "underline",
},
}
}
/>
</ScrollView>
`;
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"react-native-pager-view": "6.9.1",
"react-native-progress": "5.0.1",
"react-native-reanimated": "~4.1.1",
"react-native-render-html": "5.1.0",
"react-native-render-html": "^6.3.4",
"react-native-safe-area-context": "~5.6.0",
"react-native-screens": "^4.19.0",
"react-native-svg": "15.12.1",
Expand Down Expand Up @@ -126,4 +126,4 @@
},
"name": "nmf-app",
"version": "1.0.0"
}
}
Loading