Browse Source

Allow clicking links on Planex title

Arnaud Vergnet 3 years 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
 type PropsType = {
26
 type PropsType = {
27
   visible: boolean,
27
   visible: boolean,
28
   onDismiss: () => void,
28
   onDismiss: () => void,
29
-  title: string,
30
-  message: string,
29
+  title: string | React.Node,
30
+  message: string | React.Node,
31
 };
31
 };
32
 
32
 
33
 class AlertDialog extends React.PureComponent<PropsType> {
33
 class AlertDialog extends React.PureComponent<PropsType> {

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

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

Loading…
Cancel
Save