-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add initial fixture app and config * Fix lint errors * Add fixture app contents * Limit fixture lint to ts and tsx files * Fix to run on Android emulator * Code cleanup
- Loading branch information
1 parent
906e59d
commit f12a5c2
Showing
28 changed files
with
8,861 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
*.binlog | ||
*.hprof | ||
*.xcworkspace/ | ||
*.zip | ||
.DS_Store | ||
.gradle/ | ||
.idea/ | ||
.vs/ | ||
.xcode.env | ||
Pods/ | ||
build/ | ||
dist/ | ||
local.properties | ||
msbuild.binlog | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React, {useState} from 'react'; | ||
import { | ||
ThemeProvider, | ||
createBox, | ||
createText, | ||
createRestyleComponent, | ||
createVariant, | ||
VariantProps, | ||
} from '@shopify/restyle'; | ||
import {SafeAreaView, Switch} from 'react-native'; | ||
|
||
import {theme, darkTheme, Theme} from './theme'; | ||
|
||
const Box = createBox<Theme>(); | ||
const Text = createText<Theme>(); | ||
|
||
const Card = createRestyleComponent< | ||
VariantProps<Theme, 'cardVariants'> & React.ComponentProps<typeof Box>, | ||
Theme | ||
>([createVariant({themeKey: 'cardVariants'})], Box); | ||
|
||
const App = () => { | ||
const [darkMode, setDarkMode] = useState(false); | ||
|
||
const selectedTheme = darkMode ? darkTheme : theme; | ||
|
||
return ( | ||
<ThemeProvider theme={selectedTheme}> | ||
<Box backgroundColor="background" flex={1}> | ||
<SafeAreaView style={{flex: 1}}> | ||
<Box flex={1} paddingHorizontal="m" gap="s"> | ||
<Text variant="header">Welcome</Text> | ||
<Card variant="primary"> | ||
<Text variant="body"> | ||
This is a simple example displaying how to use Restyle | ||
</Text> | ||
</Card> | ||
<Card variant="secondary"> | ||
<Text variant="body"> | ||
You can find the theme in theme.ts. Update the theme values to | ||
see how it changes this screen | ||
</Text> | ||
</Card> | ||
<Card | ||
variant="primary" | ||
flexDirection="row" | ||
justifyContent="space-between" | ||
alignItems="center" | ||
> | ||
<Text variant="body">Toggle dark mode</Text> | ||
<Switch | ||
value={darkMode} | ||
onValueChange={(value: boolean) => setDarkMode(value)} | ||
/> | ||
</Card> | ||
</Box> | ||
</SafeAreaView> | ||
</Box> | ||
</ThemeProvider> | ||
); | ||
}; | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
buildscript { | ||
def androidTestAppDir = "../node_modules/react-native-test-app/android" | ||
apply(from: "${androidTestAppDir}/dependencies.gradle") | ||
|
||
repositories { | ||
mavenCentral() | ||
google() | ||
} | ||
|
||
dependencies { | ||
getReactNativeDependencies().each { dependency -> | ||
classpath(dependency) | ||
} | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
maven { | ||
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm | ||
url("${rootDir}/../node_modules/react-native/android") | ||
} | ||
mavenCentral() | ||
google() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Project-wide Gradle settings. | ||
|
||
# IDE (e.g. Android Studio) users: | ||
# Gradle settings configured through the IDE *will override* | ||
# any settings specified in this file. | ||
|
||
# For more details on how to configure your build environment visit | ||
# http://www.gradle.org/docs/current/userguide/build_environment.html | ||
|
||
# Specifies the JVM arguments used for the Gradle Daemon. The setting is | ||
# particularly useful for configuring JVM memory settings for build performance. | ||
# This does not affect the JVM settings for the Gradle client VM. | ||
# The default is `-Xmx512m -XX:MaxMetaspaceSize=256m`. | ||
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
|
||
# When configured, Gradle will fork up to org.gradle.workers.max JVMs to execute | ||
# projects in parallel. To learn more about parallel task execution, see the | ||
# section on Gradle build performance: | ||
# https://docs.gradle.org/current/userguide/performance.html#parallel_execution. | ||
# Default is `false`. | ||
#org.gradle.parallel=true | ||
|
||
# AndroidX package structure to make it clearer which packages are bundled with the | ||
# Android operating system, and which are packaged with your app's APK | ||
# https://developer.android.com/topic/libraries/support-library/androidx-rn | ||
android.useAndroidX=true | ||
# Automatically convert third-party libraries to use AndroidX | ||
android.enableJetifier=true | ||
|
||
# Version of Flipper to use with React Native. Default value is whatever React | ||
# Native defaults to. To disable Flipper, set it to `false`. | ||
#FLIPPER_VERSION=0.125.0 | ||
|
||
# Enable Fabric at runtime. | ||
#USE_FABRIC=1 | ||
|
||
# Enable new architecture, i.e. Fabric + TurboModule - implies USE_FABRIC=1. | ||
# Note that this is incompatible with web debugging. | ||
#newArchEnabled=true | ||
|
||
# Uncomment the line below if building react-native from source | ||
#ANDROID_NDK_VERSION=21.4.7075529 | ||
|
||
# Version of Kotlin to build against. | ||
#KOTLIN_VERSION=1.7.10 |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.