Skip to content

Commit

Permalink
bleh
Browse files Browse the repository at this point in the history
  • Loading branch information
Drzaln committed Jan 7, 2021
0 parents commit 44d0416
Show file tree
Hide file tree
Showing 72 changed files with 14,562 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
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@react-native-community',
};
73 changes: 73 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
[ignore]
; We fork some components by platform
.*/*[.]android.js

; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/

; Ignore polyfills
node_modules/react-native/Libraries/polyfills/.*

; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/warning')
node_modules/warning/.*

; Flow doesn't support platforms
.*/Libraries/Utilities/LoadingView.js

[untyped]
.*/node_modules/@react-native-community/cli/.*/.*

[include]

[libs]
node_modules/react-native/interface.js
node_modules/react-native/flow/

[options]
emoji=true

esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable

module.file_ext=.js
module.file_ext=.json
module.file_ext=.ios.js

munge_underscores=true

module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
sketchy-number=warn
untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error

[strict]
deprecated-type
nonstrict-import
sketchy-null
unclear-type
unsafe-getters-setters
untyped-import
untyped-type-import

[version]
^0.122.0
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pbxproj -text
32 changes: 32 additions & 0 deletions .github/workflow/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build Android
on:
push:
branches:
- master
jobs:

build-android:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- name: Checkout to Action V2
uses: actions/checkout@v2
- name: Checkout Node JS
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install npm dependencies
run: |
npm install
- name: Make gradlew executable
run: cd android && chmod +x ./gradlew
- name: Build Android Release
run: |
cd android && ./gradlew assembleRelease
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: RnFootball-apk
path: android/app/build/outputs/apk/release/app-release.apk
59 changes: 59 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 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

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

# 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

# Bundle artifact
*.jsbundle

# CocoaPods
/ios/Pods/
6 changes: 6 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
bracketSpacing: false,
jsxBracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
};
1 change: 1 addition & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
139 changes: 139 additions & 0 deletions App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import React, { createRef, useEffect, useRef, useState, useCallback } from 'react'
import { SafeAreaView, View, Text, StatusBar, TouchableOpacity, Animated as RnAnimated } from 'react-native'
import { ScrollView } from 'react-native-gesture-handler'
import { enableScreens } from 'react-native-screens'
enableScreens()

const App = () => {
const [ selectedNav, setSelectedNav ] = useState(0)
return (
<React.Fragment>
<StatusBar barStyle="light-content" backgroundColor="#000" />
<SafeAreaView style={{ backgroundColor: '#030610', flex: 1 }}>
<Header />
<TopNavigation selectedNav={selectedNav} onPress={(key) => setSelectedNav(key)} />
<View style={{ flexDirection: 'row' }}>
<Text
style={{
fontFamily: 'Oswald-Regular',
color: '#FAFAFA',
fontSize: 36,
textTransform: 'uppercase',
transform: [ { rotate: '-90deg' } ]
}}>
forward
</Text>
</View>
</SafeAreaView>
</React.Fragment>
)
}

const TopNavigation = ({ selectedNav, onPress }) => {
const containerRef = useRef()
const navPosition = useRef(new RnAnimated.Value(0)).current
const [ measures, setMeasures ] = useState([])
const nav = [ 'home', 'news', 'live', 'statistic', 'table', 'tickets' ]

const data = nav.map((item, i) => ({
key: i,
title: item,
ref: createRef()
}))

useEffect(() => {
let m = []
if (data.length > 0) {
data.forEach((item) => {
item.ref.current.measureLayout(containerRef.current, (x, y, width, height) => {
m.push({ x, y, width, height })
if (m.length === data.length) {
setMeasures(m)
}
})
})
}
}, [])

const changeNav = useCallback((key) => {
RnAnimated.timing(navPosition, {
toValue: key,
duration: 350,
useNativeDriver: false
}).start()
onPress(key)
}, [])

return (
<ScrollView ref={containerRef} horizontal style={{ paddingBottom: 8 }}>
{data.map((item) => {
return (
<RenderNav
key={item.key}
item={item}
selectedNav={selectedNav}
onPress={() => changeNav(item.key)}
/>
)
})}
{measures.length > 0 && <Indicator measures={measures} data={data} navPosition={navPosition} />}
</ScrollView>
)
}

const Indicator = ({ measures, data, navPosition }) => {
const inputRange = data.map((_, i) => i)
const indicatorWidth = navPosition.interpolate({
inputRange,
outputRange: measures.map((measure) => measure.width - 6)
})
const translateX = navPosition.interpolate({
inputRange,
outputRange: measures.map((measure) => measure.x + 3)
})
return (
<RnAnimated.View
style={{
height: 2,
position: 'absolute',
bottom: 0,
width: indicatorWidth,
backgroundColor: '#FAFAFA',
transform: [ { translateX } ]
}}
/>
)
}

const RenderNav = ({ item, onPress, selectedNav }) => {
return (
<TouchableOpacity onPress={onPress}>
<View ref={item.ref} style={{ marginHorizontal: 16 }}>
<Text
style={{
fontFamily: 'Oswald-Regular',
color: item.key === selectedNav ? '#FAFAFA' : '#3E4346',
fontSize: 16,
textTransform: 'uppercase'
}}>
{item.title}
</Text>
</View>
</TouchableOpacity>
)
}

const Header = () => (
<View
style={{
justifyContent: 'center',
alignItems: 'center',
flexDirection: 'row',
paddingBottom: 16
}}>
<Text style={{ fontFamily: 'JuventusFans-Bold', color: '#FAFAFA', fontSize: 30 }}>JUVENTUS</Text>
<Text style={{ fontFamily: 'Oswald-ExtraLight', color: '#FAFAFA', fontSize: 25 }}> TEAM</Text>
</View>
)

export default App
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
currently only Juventus
14 changes: 14 additions & 0 deletions __tests__/App-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @format
*/

import 'react-native';
import React from 'react';
import App from '../App';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';

it('renders correctly', () => {
renderer.create(<App />);
});
Loading

0 comments on commit 44d0416

Please sign in to comment.