Skip to content

Commit

Permalink
movies
Browse files Browse the repository at this point in the history
  • Loading branch information
ccelomary committed Dec 18, 2022
0 parents commit 8100fea
Show file tree
Hide file tree
Showing 186 changed files with 29,196 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .buckconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

[android]
target = Google Inc.:Google APIs:23

[maven_repositories]
central = https://repo1.maven.org/maven2
2 changes: 2 additions & 0 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
16 changes: 16 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
root: true,
extends: '@react-native-community',
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
'@typescript-eslint/no-shadow': ['error'],
'no-shadow': 'off',
'no-undef': 'off',
},
},
],
};
64 changes: 64 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# OSX
#
.DS_Store

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
ios/.xcode.env.local

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
*.hprof
.cxx/

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output

# Bundle artifact
*.jsbundle

# Ruby / CocoaPods
/ios/Pods/
/vendor/bundle/
7 changes: 7 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
singleQuote: true,
trailingComma: 'all',
};
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.5
1 change: 1 addition & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
18 changes: 18 additions & 0 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {Provider} from 'react-redux';
import store from './src/store';
import Navigation from './Navigation';
import React, {useEffect} from 'react';
import RNBootSplash from 'react-native-bootsplash';

const App = () => {
useEffect(() => {
RNBootSplash.hide({fade: true, duration: 500});
}, []);
return (
<Provider store={store}>
<Navigation />
</Provider>
);
};

export default App;
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '2.7.5'

gem 'cocoapods', '~> 1.11', '>= 1.11.2'
111 changes: 111 additions & 0 deletions Navigation.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import React, {useEffect, useCallback} from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import {Dimensions, StyleSheet, StatusBar} from 'react-native';
import {HomeIcon, SearchIcon, SavedIcon} from './src/components/ui';
import {Home, Detail, Saved, Search} from './src/screens';
import theme from './src/assets/theme';
import {connect, ConnectedProps} from 'react-redux';
import {addGenresService} from './src/services/genres.services';
import {setSavedService} from './src/services/saved.services';
import AsyncStorage from '@react-native-async-storage/async-storage';

type BottomTabBarProps = {
Home: undefined;
Search: undefined;
Saved: undefined;
Detail: {
id: string;
};
};

const Tab = createBottomTabNavigator<BottomTabBarProps>();
const Navigation = ({addGenres, setSaved}: NavigationProps) => {
const getSavedData = useCallback(async (): Promise<void> => {
try {
const data = await AsyncStorage.getItem('@savedItem');
if (data) {
setSaved(JSON.parse(data));
}
} catch (e) {}
}, [setSaved]);

useEffect(() => {
addGenres();
getSavedData();
}, [addGenres, getSavedData]);
return (
<NavigationContainer>
<StatusBar
barStyle="light-content"
backgroundColor={theme.ScreenBackgroundColor}
/>
<Tab.Navigator
backBehavior="history"
initialRouteName="Home"
screenOptions={{
tabBarStyle: styles.tabBarStyle,
tabBarShowLabel: false,
tabBarItemStyle: {
marginBottom: 14,
},
headerShown: false,
}}>
<Tab.Screen
name="Home"
component={Home}
options={{
tabBarIcon: ({focused}) => <HomeIcon empty={!focused} />,
}}
/>
<Tab.Screen
name="Search"
component={Search}
options={{
tabBarIcon: ({focused}) => <SearchIcon empty={!focused} />,
}}
/>
<Tab.Screen
name="Saved"
component={Saved}
options={{
tabBarIcon: ({focused}) => <SavedIcon empty={!focused} />,
}}
/>
<Tab.Screen
name="Detail"
component={Detail}
options={{
tabBarButton: () => null,
}}
/>
</Tab.Navigator>
</NavigationContainer>
);
};

const connector = connect(null, {
addGenres: addGenresService,
setSaved: setSavedService,
});

type NavigationProps = ConnectedProps<typeof connector>;
export default connector(Navigation);

const styles = StyleSheet.create({
tabBarStyle: {
position: 'absolute',
width: Dimensions.get('window').width * 0.8,
height: 80,
left: Dimensions.get('window').width * 0.1,
right: Dimensions.get('window').width * 0.1,
bottom: 12,
paddingHorizontal: 20,
paddingVertical: 16,
borderWidth: 0,
borderTopWidth: 0,
borderRadius: 40,
backgroundColor: 'rgba(31, 28, 44, 1)',
zIndex: 99,
},
});
1 change: 1 addition & 0 deletions _node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16
55 changes: 55 additions & 0 deletions android/app/_BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# To learn about Buck see [Docs](https://buckbuild.com/).
# To run your application with Buck:
# - install Buck
# - `npm start` - to start the packager
# - `cd android`
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
# - `buck install -r android/app` - compile, install and run application
#

load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")

lib_deps = []

create_aar_targets(glob(["libs/*.aar"]))

create_jar_targets(glob(["libs/*.jar"]))

android_library(
name = "all-libs",
exported_deps = lib_deps,
)

android_library(
name = "app-code",
srcs = glob([
"src/main/java/**/*.java",
]),
deps = [
":all-libs",
":build_config",
":res",
],
)

android_build_config(
name = "build_config",
package = "com.movies",
)

android_resource(
name = "res",
package = "com.movies",
res = "src/main/res",
)

android_binary(
name = "app",
keystore = "//android/keystores:debug",
manifest = "src/main/AndroidManifest.xml",
package_type = "debug",
deps = [
":app-code",
],
)
Loading

0 comments on commit 8100fea

Please sign in to comment.