Skip to content

Commit 77bf6b7

Browse files
committed
Revert "feat: tree shaking move to individual components"
This reverts commit 8aa8e55.
1 parent 5e46cd4 commit 77bf6b7

1,373 files changed

Lines changed: 7144 additions & 891 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
node_modules/
2-
src/all
3-
src/icons
4-
src/index.tsx
5-
# generated by bob
6-
/lib/
1+
node_modules/

.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
example/
33

44
# Scripts
5-
src/generate-svg.js
5+
src/generate_icons.sh
66
test.sh
77

88
# CI

example/.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
root: true,
3-
extends: '@react-native',
4-
};
3+
extends: '@react-native-community',
4+
};

example/.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,3 @@ yarn-error.log
6161

6262
# Temporary files created by Metro to check the health of the file watcher
6363
.metro-health-check*
64-
65-
# testing
66-
/coverage

example/.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
16

example/.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.7.6

example/Gemfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
source 'https://rubygems.org'
22

33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4-
ruby ">= 2.6.10"
5-
gem 'cocoapods', '~> 1.12'
4+
ruby File.read(File.join(__dir__, '.ruby-version')).strip
5+
6+
gem 'cocoapods', '~> 1.11', '>= 1.11.3'

example/IconsScreen.js

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ import {
1111
useWindowDimensions,
1212
Button
1313
} from 'react-native';
14-
import * as IconPack from '@mrkpatchaa/react-native-ionicons';
15-
const { IconContext, ...Icons } = IconPack;
14+
import {Icon} from '@mrkpatchaa/react-native-ionicons';
15+
import {Icons} from '@mrkpatchaa/react-native-ionicons/src/map';
16+
17+
const names = Object.keys(Icons);
1618

1719
function PickerItem({tag, selection, setSelection}) {
1820
return (
@@ -39,7 +41,7 @@ const App = () => {
3941
const iconSize = (width - 6 * 32) / 5;
4042
const [color, setColor] = useState('');
4143
const [display, setDisplay] = useState('grid');
42-
const [mirrorActive, setMirrorActive] = useState(false);
44+
const [iconStyle, setIconStyle] = useState('outline');
4345

4446
return (
4547
<SafeAreaView style={{flex: 1}}>
@@ -81,7 +83,7 @@ const App = () => {
8183
maxLength={6}
8284
/>
8385
<View style={{flex: 1}} />
84-
{/* <PickerItem
86+
<PickerItem
8587
tag="outline"
8688
selection={iconStyle}
8789
setSelection={setIconStyle}
@@ -95,25 +97,26 @@ const App = () => {
9597
tag="sharp"
9698
selection={iconStyle}
9799
setSelection={setIconStyle}
98-
/> */}
100+
/>
99101
</View>
100102
<FlatList
101103
contentContainerStyle={{paddingHorizontal: 16}}
102104
numColumns={display === 'grid' ? 5 : 1}
103-
data={Object.entries(Icons).filter(([, Icon]) => !!Icon)}
104-
keyExtractor={(item) => item[0]}
105+
data={names.filter(item => iconStyle === 'filled' && !(item.endsWith('-outline') || item.endsWith('-sharp')) || item.endsWith(`-${iconStyle}`))}
106+
keyExtractor={item => item}
105107
key={display}
106-
renderItem={({ item: [name, Icon] }) => (
108+
renderItem={({item}) => {
109+
return (
107110
<View style={{padding: 16, alignItems:'center', flexDirection: display === 'list' ? 'row' : 'column'}}>
108111
<Icon
112+
name={item}
109113
size={iconSize}
110114
color={color.length !== 6 ? '#000' : '#' + color}
111-
mirrored={mirrorActive}
112115
/>
113-
{display === 'list' && <Text style={{marginLeft: 5}}>{name}</Text> }
116+
{display === 'list' && <Text style={{marginLeft: 5}}>{item}</Text> }
114117
</View>
115-
)
116-
}
118+
);
119+
}}
117120
/>
118121
</SafeAreaView>
119122
);

example/README.md

Lines changed: 0 additions & 79 deletions
This file was deleted.
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ import 'react-native';
66
import React from 'react';
77
import App from '../App';
88

9-
// Note: import explicitly to use the types shiped with jest.
10-
import {it} from '@jest/globals';
11-
12-
139
// Note: test renderer must be required after react-native.
1410
import renderer from 'react-test-renderer';
1511

0 commit comments

Comments
 (0)