Skip to content

Commit

Permalink
chore: new version: 0.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
sevvaleygul0 committed Aug 10, 2022
1 parent f98be22 commit ccf925b
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 196 deletions.
Binary file modified assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 0 additions & 11 deletions example/lib/LanguagePicker.style.ts

This file was deleted.

64 changes: 0 additions & 64 deletions example/lib/LanguagePicker.tsx

This file was deleted.

41 changes: 0 additions & 41 deletions example/lib/language-item/LanguageItem.style.ts

This file was deleted.

67 changes: 0 additions & 67 deletions example/lib/language-item/LanguageItem.tsx

This file was deleted.

Binary file removed example/lib/local-assets/america.png
Binary file not shown.
Binary file removed example/lib/local-assets/check.png
Binary file not shown.
Binary file removed example/lib/local-assets/germany.png
Binary file not shown.
Binary file removed example/lib/local-assets/italy.png
Binary file not shown.
Binary file removed example/lib/local-assets/japan.png
Binary file not shown.
Binary file removed example/lib/local-assets/sweden.png
Binary file not shown.
Binary file removed example/lib/local-assets/turkey.png
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/LanguagePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ const LanguagePicker: React.FC<ILanguagePickerProps> = ({
onSelect={handleOnSelectItem}
isActive={selectedItem === item}
item={item}
{...rest}
/>
);

return (
<FlatList
{...rest}
data={data}
style={[_container(containerWidth, containerHeight), flatListStyle]}
renderItem={({ item }) => renderItem(item)}
Expand Down
1 change: 1 addition & 0 deletions lib/language-item/LanguageItem.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ export default StyleSheet.create({
right: 24,
width: 20,
height: 20,
color: "red",
},
});
25 changes: 14 additions & 11 deletions lib/language-item/LanguageItem.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import RNBounceable from "@freakycoder/react-native-bounceable";
import React from "react";
import { Dimensions, Image, Text, ViewStyle } from "react-native";
import { ILanguagePicker } from "../LanguagePicker";
import {
Dimensions,
Image,
ImageSourcePropType,
Text,
ViewStyle,
} from "react-native";
import RNBounceable from "@freakycoder/react-native-bounceable";
/**
* ? Local Imports
*/
import { ILanguagePicker } from "../LanguagePicker";
import styles, { _itemContainer, _titleStyle } from "./LanguageItem.style";

const windowWidth = Dimensions.get("window").width;
Expand All @@ -19,6 +25,7 @@ interface ILanguageItem {
itemContainer?: ViewStyle;
imageComponent?: React.ReactNode | React.ReactNode[];
checkComponent?: React.ReactNode | React.ReactNode[];
rightImageSource?: ImageSourcePropType;
onSelect?: (selectedItem: ILanguagePicker) => void;
}

Expand All @@ -33,30 +40,26 @@ const LanguageItem: React.FC<ILanguageItem> = ({
imageComponent,
checkComponent,
activeBorderColor = "#504ED9",
rightImageSource,
onSelect,
...rest
}) => {
const borderColor = isActive ? activeBorderColor : backgroundColor;
return (
<RNBounceable
{...rest}
style={[
_itemContainer(backgroundColor, borderColor, width, height),
itemContainer,
]}
onPress={() => onSelect && onSelect(item)}
>
{imageComponent || (
<Image {...rest} source={item.imageSource} style={styles.imageStyle} />
<Image source={item.imageSource} style={styles.imageStyle} />
)}
<Text {...rest} style={_titleStyle(textColor)}>
{item.title}
</Text>
<Text style={_titleStyle(textColor)}>{item.title}</Text>
{isActive &&
(checkComponent || (
<Image
{...rest}
source={require("../local-assets/check.png")}
source={rightImageSource || require("../local-assets/check.png")}
style={styles.checkImageStyle}
/>
))}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-language-select",
"version": "0.0.8",
"version": "0.0.9",
"description": "Useful and customizable language picker",
"main": "./build/dist/LanguagePicker.js",
"repository": "[email protected]:sevvaleygul0/react-native-language-picker.git",
Expand Down

0 comments on commit ccf925b

Please sign in to comment.