Skip to content

Commit

Permalink
Merge pull request #280 from includable/fix/popup
Browse files Browse the repository at this point in the history
fix: include Popup export
  • Loading branch information
tschoffelen committed Mar 29, 2024
2 parents 8ca4311 + 22f9a80 commit c750902
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .npmignore
@@ -1,12 +1,12 @@
/example
/docs
/tests
greenkeeper.json
.github
.editorconfig
.idea
.vscode
.travis.yml
.jest
.expo
.eslintrc.json
.prettierrc.json
babel.config.js
20 changes: 13 additions & 7 deletions example/App.tsx
@@ -1,7 +1,12 @@
import React, {useEffect, useState} from 'react';
import {useEffect, useState} from 'react';
import {Button, Image, Pressable, StyleSheet, Text, View} from 'react-native';
import {getApps, GetAppsResponse, Popup, showLocation} from 'react-native-map-link';
import { ShowLocationProps } from 'react-native-map-link/src/type';
import {
getApps,
GetAppsResponse,
Popup,
showLocation,
ShowLocationProps,
} from 'react-native-map-link';

const options = {
latitude: 38.8976763,
Expand Down Expand Up @@ -57,9 +62,7 @@ export default function App() {
availableApps.map(({icon, name, id, open}) => (
<Pressable key={id} onPress={open}>
<Image source={icon} />
<Text style={{
textAlign: 'center',
}}>{name}</Text>
<Text style={styles.option}>{name}</Text>
</Pressable>
))
) : (
Expand Down Expand Up @@ -95,5 +98,8 @@ const styles = StyleSheet.create({
},
buttonContainer: {
marginTop: 15,
}
},
option: {
textAlign: 'center',
},
});
7 changes: 2 additions & 5 deletions example/babel.config.js
@@ -1,6 +1,3 @@
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
};
2 changes: 1 addition & 1 deletion example/package.json
Expand Up @@ -13,7 +13,7 @@
"expo-status-bar": "~1.11.1",
"react": "18.2.0",
"react-native": "0.73.4",
"react-native-map-link": "3.0.0"
"react-native-map-link": "^3.0.0"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand Down
4 changes: 3 additions & 1 deletion example/tsconfig.json
@@ -1,4 +1,6 @@
{
"compilerOptions": {},
"compilerOptions": {
"jsx": "react-native"
},
"extends": "expo/tsconfig.base"
}
4 changes: 1 addition & 3 deletions src/components/popup/Popup.tsx
Expand Up @@ -54,7 +54,7 @@ interface PopupProps {

const SCREEN_HEIGHT = Dimensions.get('screen').height;

const Popup: React.FC<PopupProps> = ({
export const Popup: React.FC<PopupProps> = ({
isVisible,
showHeader = true,
customHeader,
Expand Down Expand Up @@ -168,5 +168,3 @@ const styles = StyleSheet.create({
elevation: 5,
},
});

export default Popup;
2 changes: 2 additions & 0 deletions src/index.ts
Expand Up @@ -22,6 +22,8 @@ export type {
ShowLocationProps,
} from './type';

export {Popup} from './components/popup/Popup';

export const showLocation = async ({
latitude,
longitude,
Expand Down

0 comments on commit c750902

Please sign in to comment.