Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Components/Circle.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import type { CircleProps, Point } from '../@types';
import { type NativeSyntheticEvent } from 'react-native';
import YamapLiteCircleView from '../YamapCircleViewNativeComponents';
import YamapLiteCircleView from '../YamapCircleViewNativeComponent';

export const Circle: React.FC<CircleProps> = ({
onPress,
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Marker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from 'react';
import type { MarkerProps, MarkerRef, Point } from '../@types';
import { Image, type NativeSyntheticEvent } from 'react-native';
import YamapLiteMarkerView from '../YamapMarkerViewNativeComponents';
import YamapLiteMarkerView from '../YamapMarkerViewNativeComponent';

export const Marker = forwardRef<MarkerRef, MarkerProps>(
({ onPress, source, zIndex, point: pointProp, ...props }, ref) => {
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Polygon.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import type { Point, PolygonProps } from '../@types';
import { type NativeSyntheticEvent } from 'react-native';
import YamapLitePolygonView from '../YamapPolygonViewNativeComponents';
import YamapLitePolygonView from '../YamapPolygonViewNativeComponent';

export const Polygon: React.FC<PolygonProps> = ({
onPress,
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Polyline.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import type { Point, PolylineProps } from '../@types';
import { type NativeSyntheticEvent } from 'react-native';
import YamapLitePolylineView from '../YamapPolylineViewNativeComponents';
import YamapLitePolylineView from '../YamapPolylineViewNativeComponent';

export const Polyline: React.FC<PolylineProps> = ({
onPress,
Expand Down
34 changes: 17 additions & 17 deletions src/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ describe('Marker', () => {
);
});
const native = instance.root.findByType(
require('../YamapMarkerViewNativeComponents').default
require('../YamapMarkerViewNativeComponent').default
);
act(() => {
native.props.onMarkerPress({ nativeEvent: { lat: 55.75, lon: 37.61 } });
Expand All @@ -675,7 +675,7 @@ describe('Marker', () => {
instance = renderer.create(<Marker point={{ lat: 55.75, lon: 37.61 }} />);
});
const native = instance.root.findByType(
require('../YamapMarkerViewNativeComponents').default
require('../YamapMarkerViewNativeComponent').default
);
expect(() => {
act(() => {
Expand All @@ -695,7 +695,7 @@ describe('Marker', () => {
);
});
const native = instance.root.findByType(
require('../YamapMarkerViewNativeComponents').default
require('../YamapMarkerViewNativeComponent').default
);
expect(typeof native.props.source).toBe('string');
});
Expand All @@ -705,7 +705,7 @@ describe('Marker', () => {
act(() => {
instance = renderer.create(<Marker point={{ lat: 55.75, lon: 37.61 }} />);
});
const native = findNative(instance, '../YamapMarkerViewNativeComponents');
const native = findNative(instance, '../YamapMarkerViewNativeComponent');
expect(native.props.source).toBe('');
});

Expand All @@ -719,11 +719,11 @@ describe('Marker', () => {
withoutZ = renderer.create(<Marker point={{ lat: 55.75, lon: 37.61 }} />);
});
expect(
findNative(withZ, '../YamapMarkerViewNativeComponents').props.zInd
findNative(withZ, '../YamapMarkerViewNativeComponent').props.zInd
).toBe(8);
// Marker defaults zInd to 1 when zIndex is omitted (zIndex ?? 1)
expect(
findNative(withoutZ, '../YamapMarkerViewNativeComponents').props.zInd
findNative(withoutZ, '../YamapMarkerViewNativeComponent').props.zInd
).toBe(1);
});

Expand All @@ -741,7 +741,7 @@ describe('Marker', () => {
});

const native = instance.root.findByType(
require('../YamapMarkerViewNativeComponents').default
require('../YamapMarkerViewNativeComponent').default
);
expect(native.props.point).toEqual(newPoint);
});
Expand All @@ -765,7 +765,7 @@ describe('Marker', () => {
});

const native = instance.root.findByType(
require('../YamapMarkerViewNativeComponents').default
require('../YamapMarkerViewNativeComponent').default
);
expect(native.props.point).toEqual({ lat: 60.0, lon: 31.0 });
});
Expand Down Expand Up @@ -808,7 +808,7 @@ describe('Circle', () => {
act(() => {
instance = renderer.create(<Circle {...defaults} zIndex={7} />);
});
const native = findNative(instance, '../YamapCircleViewNativeComponents');
const native = findNative(instance, '../YamapCircleViewNativeComponent');
expect(native.props.zInd).toBe(7);
});

Expand All @@ -819,7 +819,7 @@ describe('Circle', () => {
instance = renderer.create(<Circle {...defaults} onPress={onPress} />);
});
const native = instance.root.findByType(
require('../YamapCircleViewNativeComponents').default
require('../YamapCircleViewNativeComponent').default
);
act(() => {
native.props.onCirclePress({ nativeEvent: { lat: 55.75, lon: 37.61 } });
Expand All @@ -833,7 +833,7 @@ describe('Circle', () => {
instance = renderer.create(<Circle {...defaults} />);
});
const native = instance.root.findByType(
require('../YamapCircleViewNativeComponents').default
require('../YamapCircleViewNativeComponent').default
);
expect(() => {
act(() => {
Expand Down Expand Up @@ -878,7 +878,7 @@ describe('Polygon', () => {
act(() => {
instance = renderer.create(<Polygon points={pts} zIndex={9} />);
});
const native = findNative(instance, '../YamapPolygonViewNativeComponents');
const native = findNative(instance, '../YamapPolygonViewNativeComponent');
expect(native.props.zInd).toBe(9);
});

Expand All @@ -889,7 +889,7 @@ describe('Polygon', () => {
instance = renderer.create(<Polygon points={pts} onPress={onPress} />);
});
const native = instance.root.findByType(
require('../YamapPolygonViewNativeComponents').default
require('../YamapPolygonViewNativeComponent').default
);
act(() => {
native.props.onPolygonPress({ nativeEvent: { lat: 55.75, lon: 37.61 } });
Expand All @@ -903,7 +903,7 @@ describe('Polygon', () => {
instance = renderer.create(<Polygon points={pts} />);
});
const native = instance.root.findByType(
require('../YamapPolygonViewNativeComponents').default
require('../YamapPolygonViewNativeComponent').default
);
expect(() => {
act(() => {
Expand Down Expand Up @@ -956,7 +956,7 @@ describe('Polyline', () => {
act(() => {
instance = renderer.create(<Polyline points={pts} zIndex={5} />);
});
const native = findNative(instance, '../YamapPolylineViewNativeComponents');
const native = findNative(instance, '../YamapPolylineViewNativeComponent');
expect(native.props.zInd).toBe(5);
});

Expand All @@ -967,7 +967,7 @@ describe('Polyline', () => {
instance = renderer.create(<Polyline points={pts} onPress={onPress} />);
});
const native = instance.root.findByType(
require('../YamapPolylineViewNativeComponents').default
require('../YamapPolylineViewNativeComponent').default
);
act(() => {
native.props.onPolylinePress({ nativeEvent: { lat: 55.75, lon: 37.62 } });
Expand All @@ -981,7 +981,7 @@ describe('Polyline', () => {
instance = renderer.create(<Polyline points={pts} />);
});
const native = instance.root.findByType(
require('../YamapPolylineViewNativeComponents').default
require('../YamapPolylineViewNativeComponent').default
);
expect(() => {
act(() => {
Expand Down
Loading