Browse Source

Allow clicking links on Planex title

Arnaud Vergnet 1 year ago
parent
commit
64e643f5c6
2 changed files with 6 additions and 5 deletions
  1. 2
    2
      src/components/Dialogs/AlertDialog.js
  2. 4
    3
      src/screens/Planex/PlanexScreen.js

+ 2
- 2
src/components/Dialogs/AlertDialog.js View File

@@ -26,8 +26,8 @@ import i18n from 'i18n-js';
26 26
 type PropsType = {
27 27
   visible: boolean,
28 28
   onDismiss: () => void,
29
-  title: string,
30
-  message: string,
29
+  title: string | React.Node,
30
+  message: string | React.Node,
31 31
 };
32 32
 
33 33
 class AlertDialog extends React.PureComponent<PropsType> {

+ 4
- 3
src/screens/Planex/PlanexScreen.js View File

@@ -20,11 +20,12 @@
20 20
 // @flow
21 21
 
22 22
 import * as React from 'react';
23
-import {withTheme} from 'react-native-paper';
23
+import {Title, withTheme} from 'react-native-paper';
24 24
 import i18n from 'i18n-js';
25 25
 import {View} from 'react-native';
26 26
 import {CommonActions} from '@react-navigation/native';
27 27
 import {StackNavigationProp} from '@react-navigation/stack';
28
+import Autolink from 'react-native-autolink';
28 29
 import type {CustomThemeType} from '../../managers/ThemeManager';
29 30
 import ThemeManager from '../../managers/ThemeManager';
30 31
 import WebViewScreen from '../../components/Screens/WebViewScreen';
@@ -46,7 +47,7 @@ type PropsType = {
46 47
 
47 48
 type StateType = {
48 49
   dialogVisible: boolean,
49
-  dialogTitle: string,
50
+  dialogTitle: string | React.Node,
50 51
   dialogMessage: string,
51 52
   currentGroup: PlanexGroupType,
52 53
 };
@@ -285,7 +286,7 @@ class PlanexScreen extends React.Component<PropsType, StateType> {
285 286
   showDialog = (title: string, message: string) => {
286 287
     this.setState({
287 288
       dialogVisible: true,
288
-      dialogTitle: title,
289
+      dialogTitle: <Autolink text={title} component={Title}/>,
289 290
       dialogMessage: message,
290 291
     });
291 292
   };

Loading…
Cancel
Save