Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fairchat.ReactNative
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hosting
chat
fairchat.ReactNative
Commits
6ab5ecdf
Commit
6ab5ecdf
authored
5 years ago
by
IlarionHalushka
Committed by
Diego Mello
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[FEATURE] Share app (#1109)
parent
7b2185d3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/constants/links.js
+3
-0
3 additions, 0 deletions
app/constants/links.js
app/views/SettingsView/index.js
+13
-8
13 additions, 8 deletions
app/views/SettingsView/index.js
with
16 additions
and
8 deletions
app/constants/links.js
0 → 100644
+
3
−
0
View file @
6ab5ecdf
export
const
PLAY_MARKET_LINK
=
'
https://play.google.com/store/apps/details?id=chat.rocket.reactnative
'
;
export
const
APP_STORE_LINK
=
'
https://itunes.apple.com/app/rocket-chat-experimental/id1272915472?ls=1&mt=8
'
;
export
const
LICENSE_LINK
=
'
https://github.com/RocketChat/Rocket.Chat.ReactNative/blob/develop/LICENSE
'
;
This diff is collapsed.
Click to expand it.
app/views/SettingsView/index.js
+
13
−
8
View file @
6ab5ecdf
import
React
from
'
react
'
;
import
{
View
,
Linking
,
ScrollView
,
AsyncStorage
,
SafeAreaView
,
Switch
View
,
Linking
,
ScrollView
,
AsyncStorage
,
SafeAreaView
,
Switch
,
Share
}
from
'
react-native
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
connect
}
from
'
react-redux
'
;
...
...
@@ -14,14 +14,14 @@ import { DisclosureImage } from '../../containers/DisclosureIndicator';
import
Separator
from
'
../../containers/Separator
'
;
import
I18n
from
'
../../i18n
'
;
import
{
MARKDOWN_KEY
}
from
'
../../lib/rocketchat
'
;
import
{
getReadableVersion
,
getDeviceModel
}
from
'
../../utils/deviceInfo
'
;
import
{
getReadableVersion
,
getDeviceModel
,
isAndroid
}
from
'
../../utils/deviceInfo
'
;
import
openLink
from
'
../../utils/openLink
'
;
import
scrollPersistTaps
from
'
../../utils/scrollPersistTaps
'
;
import
{
showErrorAlert
}
from
'
../../utils/info
'
;
import
styles
from
'
./styles
'
;
import
sharedStyles
from
'
../Styles
'
;
import
{
PLAY_MARKET_LINK
,
APP_STORE_LINK
,
LICENSE_LINK
}
from
'
../../constants/links
'
;
const
LICENSE_LINK
=
'
https://github.com/RocketChat/Rocket.Chat.ReactNative/blob/develop/LICENSE
'
;
const
SectionSeparator
=
React
.
memo
(()
=>
<
View
style
=
{
styles
.
sectionSeparatorBorder
}
/>
)
;
class
SettingsView
extends
React
.
Component
{
...
...
@@ -62,6 +62,10 @@ class SettingsView extends React.Component {
}
}
shareApp
=
()
=>
{
Share
.
share
({
message
:
isAndroid
?
PLAY_MARKET_LINK
:
APP_STORE_LINK
});
}
onPressLicense
=
()
=>
openLink
(
LICENSE_LINK
)
renderDisclosure
=
()
=>
<
DisclosureImage
/>
...
...
@@ -105,18 +109,19 @@ class SettingsView extends React.Component {
/
>
<
Separator
/>
<
ListItem
title
=
{
I18n
.
t
(
'
Theme
'
)}
title
=
{
I18n
.
t
(
'
Share_this_app
'
)}
onPress
=
{
this
.
shareApp
}
showActionIndicator
disabled
testID
=
'
settings-view-theme
'
testID
=
'
settings-view-share-app
'
/>
<
Separator
/>
<
ListItem
title
=
{
I18n
.
t
(
'
Share_this_app
'
)}
title
=
{
I18n
.
t
(
'
Theme
'
)}
showActionIndicator
disabled
testID
=
'
settings-view-
share-app
'
testID
=
'
settings-view-
theme
'
/>
<
Separator
/>
<
SectionSeparator
/>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment