Skip to content

Commit

Permalink
fix: include Popup export
Browse files Browse the repository at this point in the history
  • Loading branch information
tschoffelen committed Mar 29, 2024
1 parent 8ca4311 commit 22f9a80
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"compilerOptions": {},
"compilerOptions": {
"jsx": "react-native"
},
"extends": "expo/tsconfig.base"
}
4 changes: 1 addition & 3 deletions src/components/popup/Popup.tsx
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 22f9a80

Please sign in to comment.