Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SWM icon pack support. #3114

Merged
merged 10 commits into from
Sep 20, 2024
5 changes: 3 additions & 2 deletions example/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
StackScreenProps,
} from '@react-navigation/stack';
import { NavigationContainer, ParamListBase } from '@react-navigation/native';
import Entypo from '@expo/vector-icons/Entypo';
import {
GestureHandlerRootView,
RectButton,
Expand Down Expand Up @@ -77,6 +76,8 @@
import RectButtonBorders from './src/release_tests/rectButton';
import { ListWithHeader } from './src/ListWithHeader';

import { Icon } from '@swmansion/icons';

interface Example {
name: string;
component: React.ComponentType;
Expand Down Expand Up @@ -276,7 +277,7 @@
renderSectionHeader={({ section: { sectionTitle } }) => (
<Text style={styles.sectionTitle}>{sectionTitle}</Text>
)}
ItemSeparatorComponent={() => <View style={styles.separator} />}

Check warning on line 280 in example/App.tsx

View workflow job for this annotation

GitHub Actions / check (example)

Do not define components during render. React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state (https://reactjs.org/docs/reconciliation.html#elements-of-different-types). Instead, move this component definition out of the parent component “MainScreen” and pass data as props. If you want to allow component creation in props, set allowAsProps option to true
/>
</SafeAreaView>
);
Expand Down Expand Up @@ -326,7 +327,7 @@
return (
<RectButton style={[styles.button]} onPress={() => onPressItem(name)}>
<Text>{name}</Text>
<Entypo name="chevron-right" size={24} color="#bbb" />
<Icon name="chevron-small-right" size={24} color="#bbb" />
</RectButton>
);
}
Expand Down
14 changes: 13 additions & 1 deletion example/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@
},
"web": {
"favicon": "./assets/favicon.png"
}
},
"plugins": [
[
"expo-font",
{
"fonts": [
"./node_modules/@swmansion/icons/fonts/broken/swm-icons-broken.ttf",
"./node_modules/@swmansion/icons/fonts/outline/swm-icons-outline.ttf",
"./node_modules/@swmansion/icons/fonts/curved/swm-icons-curved.ttf"
]
}
]
]
}
}
2 changes: 2 additions & 0 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"@react-navigation/elements": "^1.3.7",
"@react-navigation/native": "^6.1.17",
"@react-navigation/stack": "^6.3.29",
"@swmansion/icons": "^0.0.1",
"expo": "^51.0.0",
"expo-font": "~12.0.10",
"hoist-non-react-statics": "^3.3.2",
"invariant": "^2.2.4",
"patch-package": "^6.5.1",
Expand Down
12 changes: 12 additions & 0 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2024,6 +2024,11 @@
dependencies:
"@sinonjs/commons" "^3.0.0"

"@swmansion/icons@^0.0.1":
version "0.0.1"
resolved "https://registry.yarnpkg.com/@swmansion/icons/-/icons-0.0.1.tgz#8171b857be9885e1565138bf358b073f6585ca43"
integrity sha512-MjqBDtxzMRa++iPT0RkBPPOV+wIGvzVMGKQTw9thk8GKt+UAhT9NKkfK4BhiKKvKnKkCHfYCvdidNlN+jpHLrQ==

"@tsconfig/react-native@^3.0.5":
version "3.0.5"
resolved "https://registry.yarnpkg.com/@tsconfig/react-native/-/react-native-3.0.5.tgz#c4971b1eca2e8cdf7b0d25f40193a782039c1abd"
Expand Down Expand Up @@ -4039,6 +4044,13 @@ expo-file-system@~17.0.1:
resolved "https://registry.yarnpkg.com/expo-file-system/-/expo-file-system-17.0.1.tgz#b9f8af8c1c06ec71d96fd7a0d2567fa9e1c88f15"
integrity sha512-dYpnZJqTGj6HCYJyXAgpFkQWsiCH3HY1ek2cFZVHFoEc5tLz9gmdEgTF6nFHurvmvfmXqxi7a5CXyVm0aFYJBw==

expo-font@~12.0.10:
version "12.0.10"
resolved "https://registry.yarnpkg.com/expo-font/-/expo-font-12.0.10.tgz#62deaf1f46159d7839f01305f44079268781b1db"
integrity sha512-Q1i2NuYri3jy32zdnBaHHCya1wH1yMAsI+3CCmj9zlQzlhsS9Bdwcj2W3c5eU5FvH2hsNQy4O+O1NnM6o/pDaQ==
dependencies:
fontfaceobserver "^2.1.0"

expo-font@~12.0.4:
version "12.0.4"
resolved "https://registry.yarnpkg.com/expo-font/-/expo-font-12.0.4.tgz#c3d9b7fc152286c1e2beae80f97b94ca4622db34"
Expand Down
Loading