Skip to content

Commit

Permalink
feat(home): display pinned articles only once on the top (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
mheob authored Mar 24, 2021
1 parent 2bdc17a commit b4a3594
Show file tree
Hide file tree
Showing 3 changed files with 2,386 additions and 1,685 deletions.
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
"@expo-google-fonts/open-sans": "^0.1.0",
"@expo-google-fonts/vollkorn": "^0.1.0",
"@react-native-community/masked-view": "0.1.10",
"@react-navigation/bottom-tabs": "^5.11.3",
"@react-navigation/native": "^5.8.1",
"@react-navigation/stack": "^5.13.0",
"@react-navigation/bottom-tabs": "^5.11.8",
"@react-navigation/native": "^5.9.3",
"@react-navigation/stack": "^5.14.3",
"expo": "^40.0.0",
"expo-app-loading": "^1.0.1",
"expo-font": "~8.4.0",
Expand All @@ -64,31 +64,31 @@
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz",
"react-native-gesture-handler": "~1.8.0",
"react-native-reanimated": "~1.13.0",
"react-native-render-html": "^4.2.4",
"react-native-reanimated": "~1.13.3",
"react-native-render-html": "^4.2.5",
"react-native-safe-area-context": "3.1.9",
"react-native-screens": "~2.15.0",
"react-native-screens": "~2.15.2",
"react-native-snap-carousel": "^3.9.1",
"react-native-svg": "12.1.0",
"react-native-web": "~0.13.12",
"react-native-web": "~0.13.18",
"react-native-webview": "11.0.0",
"react-redux": "^7.2.2",
"redux": "^4.0.5"
},
"devDependencies": {
"@babel/core": "~7.9.0",
"@babel/core": "~7.9.6",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/git": "^9.0.0",
"@testing-library/jest-native": "^3.4.3",
"@testing-library/react-native": "^7.1.0",
"@types/jest": "^26.0.20",
"@types/react": "~16.9.35",
"@types/react-dom": "~16.9.8",
"@types/react-native": "~0.63.2",
"@types/react": "~16.9.56",
"@types/react-dom": "~16.9.12",
"@types/react-native": "~0.63.52",
"@types/react-native-snap-carousel": "^3.8.2",
"@types/react-test-renderer": "^16.9.4",
"@types/react-test-renderer": "^16.9.5",
"@typescript-eslint/eslint-plugin": "^4.14.0",
"@typescript-eslint/parser": "^4.14.0",
"babel-plugin-module-resolver": "^4.1.0",
Expand All @@ -106,7 +106,7 @@
"prettier": "^2.2.1",
"react-test-renderer": "^17.0.1",
"semantic-release": "^17.3.6",
"typescript": "~4.0.0"
"typescript": "~4.0.7"
},
"publishConfig": {
"access": "restricted"
Expand Down
2 changes: 1 addition & 1 deletion src/screens/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const HomeScreen: React.FC = () => {
sponsoredProperty !== undefined && sponsoredProperty !== null && sponsoredProperty.length > 0

useEffect(() => {
const filteredNewsArticle = articles.filter(article => article.categories.includes(1))
const filteredNewsArticle = articles.filter(article => article.categories.includes(1) && !article.acf?.pinned)

if (filteredNewsArticle.length === 0) return

Expand Down
Loading

0 comments on commit b4a3594

Please sign in to comment.