Skip to content

Commit

Permalink
Merge pull request #45 from viniciusmoreria/feat/allow-sharing-launches
Browse files Browse the repository at this point in the history
feat: allow sharing launches and fixing deploy workflow
  • Loading branch information
viniciusmoreria committed May 11, 2024
2 parents 5855507 + 3ac43ae commit 6201047
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 14 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,16 @@ jobs:
- name: Bump version
run: npx standard-version --no-verify --release-as minor

- name: Update dev branch
run: |
git fetch --all --unshallow
git stash
git checkout dev
git merge main
git push
- name: Push version bump
run: git push --follow-tags

- name: Build on EAS
run: eas build --profile production --platform all --non-interactive --no-wait --auto-submit

- name: Update dev branch
run: |
git fetch --all
git checkout dev
git merge --no-ff main
git push
10 changes: 6 additions & 4 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"owner": "viniciusmoreria",
"privacy": "public",
"primaryColor": "#16171B",
"version": "2.4.1",
"version": "2.6.0",
"orientation": "portrait",
"icon": "./src/assets/icon.png",
"backgroundColor": "#16171B",
Expand All @@ -24,7 +24,7 @@
"supportsTablet": true,
"bundleIdentifier": "com.viniciusmoreria.liftoff",
"googleServicesFile": "./src/libs/firebase/GoogleService-Info.plist",
"buildNumber": "2.4.1",
"buildNumber": "2.6.0",
"config": {
"usesNonExemptEncryption": false
},
Expand All @@ -41,7 +41,7 @@
"package": "com.viniciusmoreria.liftoff",
"playStoreUrl": "https://play.google.com/store/apps/details?id=com.viniciusmoreria.liftoff",
"googleServicesFile": "./src/libs/firebase/google-services.json",
"versionCode": 460020401
"versionCode": 460020600
},
"notification": {
"icon": "./src/assets/push-icon.png",
Expand All @@ -61,7 +61,9 @@
"expo-build-properties",
{
"android": {
"extraProguardRules": "-keep class com.google.android.gms.internal.consent_sdk.** { *; }"
"extraProguardRules": "-keep class com.google.android.gms.internal.consent_sdk.** { *; }",
"compileSdkVersion": 33,
"targetSdkVersion": 33
}
}
],
Expand Down
37 changes: 34 additions & 3 deletions src/features/launch-detail/launch-detail-screen.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Alert, Pressable, Text, View } from 'react-native';
import { Alert, Pressable, Share, Text, View } from 'react-native';

import { Container } from '@components/container';
import { Ionicons } from '@expo/vector-icons';
Expand All @@ -16,15 +16,15 @@ import { RootStackParams } from '@navigation/types';
import { RouteProp, useRoute } from '@react-navigation/native';
// import { NativeStackScreenProps } from '@react-navigation/native-stack';
import { format } from 'date-fns';
import * as Application from 'expo-application';
import * as WebBrowser from 'expo-web-browser';
import { Skeleton } from 'moti/skeleton';
import FastImage from 'react-native-fast-image';
import YoutubePlayer from 'react-native-youtube-iframe';

// import { LaunchArticles } from './components/launch-articles';
import { LocationMap } from './components/location-map';

// type Props = NativeStackScreenProps<RootStackParams, 'launch-detail'>;
// import { LaunchArticles } from './components/launch-articles';

export const LaunchDetailScreen = () => {
const { params } = useRoute<RouteProp<RootStackParams, 'launch-detail'>>();
Expand Down Expand Up @@ -59,6 +59,30 @@ export const LaunchDetailScreen = () => {
]);
};

const onShareLaunchButtonTap = async () => {
logEvent('share_launch', { launch: launch.name });

const shareURL = launch?.vidURLs[0]?.url ? `\n\n${launch?.vidURLs[0]?.url}` : '';
const location = launch?.pad?.location?.name
? `\n\nLocation: ${launch?.pad?.location?.name}\n\n`
: '';

const message = `${launch.name} on ${format(new Date(launch.net), 'MMM d, yyyy')} at ${format(
new Date(launch.net),
'HH:mm O'
)}${shareURL}${location}${
launch?.mission?.description || ''
}\n\nDownload Liftoff for Android: https://play.google.com/store/apps/details?id=${
Application.applicationId
}
`;

await Share.share({
title: 'Liftoff - Rocket Launch Tracker',
message: message,
});
};

return (
<Container useScrollView>
<View className={`flex-1 px-4 mt-${[isIOS ? '14' : '6']}`}>
Expand Down Expand Up @@ -135,6 +159,13 @@ export const LaunchDetailScreen = () => {
</View>
)}

<Pressable
onPress={onShareLaunchButtonTap}
className="bg-secondary w-full rounded-lg py-5 mt-6 items-center justify-center"
>
<Text className="text-white text-xs font-bold mr-2">Share this launch</Text>
</Pressable>

{launch.mission && (
<View className="bg-secondary rounded-lg p-4 justify-between mt-6">
<View className="flex-1 space-y-3">
Expand Down

0 comments on commit 6201047

Please sign in to comment.