Compare commits
3 Commits
develop
...
improve/sy
Author | SHA1 | Date |
---|---|---|
|
675fab1b2a | |
|
2508cace5c | |
|
c543e4df75 |
|
@ -1,12 +1,9 @@
|
||||||
defaults: &defaults
|
defaults: &defaults
|
||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
|
|
||||||
orbs:
|
|
||||||
android: circleci/android@2.1.2
|
|
||||||
|
|
||||||
macos: &macos
|
macos: &macos
|
||||||
macos:
|
macos:
|
||||||
xcode: "14.2.0"
|
xcode: "13.3.0"
|
||||||
resource_class: large
|
resource_class: large
|
||||||
|
|
||||||
bash-env: &bash-env
|
bash-env: &bash-env
|
||||||
|
@ -54,14 +51,14 @@ save-gems-cache: &save-gems-cache
|
||||||
update-fastlane-ios: &update-fastlane-ios
|
update-fastlane-ios: &update-fastlane-ios
|
||||||
name: Update Fastlane
|
name: Update Fastlane
|
||||||
command: |
|
command: |
|
||||||
echo "ruby-2.7.7" > ~/.ruby-version
|
echo "ruby-2.6.4" > ~/.ruby-version
|
||||||
bundle install
|
bundle install
|
||||||
working_directory: ios
|
working_directory: ios
|
||||||
|
|
||||||
update-fastlane-android: &update-fastlane-android
|
update-fastlane-android: &update-fastlane-android
|
||||||
name: Update Fastlane
|
name: Update Fastlane
|
||||||
command: |
|
command: |
|
||||||
echo "ruby-2.7.7" > ~/.ruby-version
|
echo "ruby-2.6.4" > ~/.ruby-version
|
||||||
bundle install
|
bundle install
|
||||||
working_directory: android
|
working_directory: android
|
||||||
|
|
||||||
|
@ -121,26 +118,26 @@ commands:
|
||||||
if [[ $CIRCLE_JOB == "android-build-official" ]]; then
|
if [[ $CIRCLE_JOB == "android-build-official" ]]; then
|
||||||
echo -e "APPLICATION_ID=chat.rocket.android" >> ./gradle.properties
|
echo -e "APPLICATION_ID=chat.rocket.android" >> ./gradle.properties
|
||||||
echo -e "BugsnagAPIKey=$BUGSNAG_KEY_OFFICIAL" >> ./gradle.properties
|
echo -e "BugsnagAPIKey=$BUGSNAG_KEY_OFFICIAL" >> ./gradle.properties
|
||||||
echo $KEYSTORE_OFFICIAL_BASE64 | base64 --decode > ./app/$KEYSTORE_OFFICIAL
|
echo $CHAT_ROCKET_ANDROID_STORE_FILE_BASE64_JKS | base64 --decode > ./app/$KEYSTORE_OFFICIAL
|
||||||
echo -e "KEYSTORE=$KEYSTORE_OFFICIAL" >> ./gradle.properties
|
echo -e "KEYSTORE=$KEYSTORE_OFFICIAL" >> ./gradle.properties
|
||||||
echo -e "KEYSTORE_PASSWORD=$KEYSTORE_OFFICIAL_PASSWORD" >> ./gradle.properties
|
echo -e "KEYSTORE_PASSWORD=$CHAT_ROCKET_ANDROID_STORE_PASSWORD" >> ./gradle.properties
|
||||||
echo -e "KEY_ALIAS=$KEYSTORE_OFFICIAL_ALIAS" >> ./gradle.properties
|
echo -e "KEY_ALIAS=$CHAT_ROCKET_ANDROID_KEY_ALIAS" >> ./gradle.properties
|
||||||
echo -e "KEY_PASSWORD=$KEYSTORE_OFFICIAL_PASSWORD" >> ./gradle.properties
|
echo -e "KEY_PASSWORD=$CHAT_ROCKET_ANDROID_KEY_PASSWORD" >> ./gradle.properties
|
||||||
else
|
else
|
||||||
echo -e "APPLICATION_ID=chat.rocket.reactnative" >> ./gradle.properties
|
echo -e "APPLICATION_ID=chat.rocket.reactnative" >> ./gradle.properties
|
||||||
echo -e "BugsnagAPIKey=$BUGSNAG_KEY" >> ./gradle.properties
|
echo -e "BugsnagAPIKey=$BUGSNAG_KEY" >> ./gradle.properties
|
||||||
echo $KEYSTORE_EXPERIMENTAL_BASE64 | base64 --decode > ./app/$KEYSTORE_EXPERIMENTAL
|
echo $KEYSTORE_BASE64 | base64 --decode > ./app/$KEYSTORE
|
||||||
echo -e "KEYSTORE=$KEYSTORE_EXPERIMENTAL" >> ./gradle.properties
|
echo -e "KEYSTORE=$KEYSTORE" >> ./gradle.properties
|
||||||
echo -e "KEYSTORE_PASSWORD=$KEYSTORE_EXPERIMENTAL_PASSWORD" >> ./gradle.properties
|
echo -e "KEYSTORE_PASSWORD=$KEYSTORE_PASSWORD" >> ./gradle.properties
|
||||||
echo -e "KEY_ALIAS=$KEYSTORE_EXPERIMENTAL_ALIAS" >> ./gradle.properties
|
echo -e "KEY_ALIAS=$KEY_ALIAS" >> ./gradle.properties
|
||||||
echo -e "KEY_PASSWORD=$KEYSTORE_EXPERIMENTAL_PASSWORD" >> ./gradle.properties
|
echo -e "KEY_PASSWORD=$KEYSTORE_PASSWORD" >> ./gradle.properties
|
||||||
fi
|
fi
|
||||||
working_directory: android
|
working_directory: android
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Set Google Services
|
name: Set Google Services
|
||||||
command: |
|
command: |
|
||||||
if [[ $GOOGLE_SERVICES_ANDROID ]]; then
|
if [[ $KEYSTORE ]]; then
|
||||||
echo $GOOGLE_SERVICES_ANDROID | base64 --decode > google-services.json
|
echo $GOOGLE_SERVICES_ANDROID | base64 --decode > google-services.json
|
||||||
fi
|
fi
|
||||||
working_directory: android/app
|
working_directory: android/app
|
||||||
|
@ -154,7 +151,7 @@ commands:
|
||||||
if [[ $CIRCLE_JOB == "android-build-experimental" || "android-automatic-build-experimental" ]]; then
|
if [[ $CIRCLE_JOB == "android-build-experimental" || "android-automatic-build-experimental" ]]; then
|
||||||
./gradlew bundleExperimentalPlayRelease
|
./gradlew bundleExperimentalPlayRelease
|
||||||
fi
|
fi
|
||||||
if [[ ! $GOOGLE_SERVICES_ANDROID ]]; then
|
if [[ ! $KEYSTORE ]]; then
|
||||||
./gradlew assembleExperimentalPlayDebug
|
./gradlew assembleExperimentalPlayDebug
|
||||||
fi
|
fi
|
||||||
working_directory: android
|
working_directory: android
|
||||||
|
@ -203,12 +200,8 @@ commands:
|
||||||
- run:
|
- run:
|
||||||
name: Set Google Services
|
name: Set Google Services
|
||||||
command: |
|
command: |
|
||||||
if [[ $APP_STORE_CONNECT_API_KEY_BASE64 ]]; then
|
if [[ $KEYSTORE ]]; then
|
||||||
if [[ $CIRCLE_JOB == "ios-build-official" ]]; then
|
echo $GOOGLE_SERVICES_IOS | base64 --decode > GoogleService-Info.plist
|
||||||
echo $GOOGLE_SERVICES_IOS | base64 --decode > GoogleService-Info.plist
|
|
||||||
else
|
|
||||||
echo $GOOGLE_SERVICES_IOS_EXPERIMENTAL | base64 --decode > GoogleService-Info.plist
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
working_directory: ios
|
working_directory: ios
|
||||||
- run:
|
- run:
|
||||||
|
@ -230,12 +223,12 @@ commands:
|
||||||
/usr/libexec/PlistBuddy -c "Set IS_OFFICIAL NO" ./NotificationService/Info.plist
|
/usr/libexec/PlistBuddy -c "Set IS_OFFICIAL NO" ./NotificationService/Info.plist
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $APP_STORE_CONNECT_API_KEY_BASE64 ]]; then
|
if [[ $APP_STORE_CONNECT_API_BASE64 ]]; then
|
||||||
echo $APP_STORE_CONNECT_API_KEY_BASE64 | base64 --decode > ./fastlane/app_store_connect_api_key.p8
|
echo $APP_STORE_CONNECT_API_BASE64 | base64 --decode > ./fastlane/app_store_connect_api_key.p8
|
||||||
if [[ $CIRCLE_JOB == "ios-build-official" ]]; then
|
if [[ $CIRCLE_JOB == "ios-build-official" ]]; then
|
||||||
bundle exec fastlane ios build_official
|
bundle exec fastlane ios build_official
|
||||||
else
|
else
|
||||||
if [[ $APP_STORE_CONNECT_API_KEY_BASE64 ]]; then
|
if [[ $KEYSTORE ]]; then
|
||||||
bundle exec fastlane ios build_experimental
|
bundle exec fastlane ios build_experimental
|
||||||
else
|
else
|
||||||
bundle exec fastlane ios build_fork
|
bundle exec fastlane ios build_fork
|
||||||
|
@ -325,19 +318,11 @@ commands:
|
||||||
- run:
|
- run:
|
||||||
name: Fastlane Tesflight Upload
|
name: Fastlane Tesflight Upload
|
||||||
command: |
|
command: |
|
||||||
echo $APP_STORE_CONNECT_API_KEY_BASE64 | base64 --decode > ./fastlane/app_store_connect_api_key.p8
|
echo $APP_STORE_CONNECT_API_BASE64 | base64 --decode > ./fastlane/app_store_connect_api_key.p8
|
||||||
bundle exec fastlane ios beta official:<< parameters.official >>
|
bundle exec fastlane ios beta official:<< parameters.official >>
|
||||||
working_directory: ios
|
working_directory: ios
|
||||||
- save_cache: *save-gems-cache
|
- save_cache: *save-gems-cache
|
||||||
|
|
||||||
create-e2e-account-file:
|
|
||||||
description: "Create e2e account file"
|
|
||||||
steps:
|
|
||||||
- run:
|
|
||||||
command: |
|
|
||||||
echo $E2E_ACCOUNT | base64 --decode > ./e2e_account.ts
|
|
||||||
working_directory: e2e
|
|
||||||
|
|
||||||
version: 2.1
|
version: 2.1
|
||||||
|
|
||||||
# EXECUTORS
|
# EXECUTORS
|
||||||
|
@ -449,94 +434,6 @@ jobs:
|
||||||
- upload-to-google-play-beta:
|
- upload-to-google-play-beta:
|
||||||
official: true
|
official: true
|
||||||
|
|
||||||
e2e-build-android:
|
|
||||||
<<: *defaults
|
|
||||||
executor:
|
|
||||||
name: android/android-machine
|
|
||||||
resource-class: xlarge
|
|
||||||
tag: 2022.12.1
|
|
||||||
environment:
|
|
||||||
<<: *android-env
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- restore_cache: *restore-npm-cache-linux
|
|
||||||
- run: *install-npm-modules
|
|
||||||
- save_cache: *save-npm-cache-linux
|
|
||||||
- restore_cache: *restore-gradle-cache
|
|
||||||
- run:
|
|
||||||
name: Configure Gradle
|
|
||||||
command: |
|
|
||||||
echo -e "" > ./gradle.properties
|
|
||||||
# echo -e "android.enableAapt2=false" >> ./gradle.properties
|
|
||||||
echo -e "android.useAndroidX=true" >> ./gradle.properties
|
|
||||||
echo -e "android.enableJetifier=true" >> ./gradle.properties
|
|
||||||
echo -e "newArchEnabled=false" >> ./gradle.properties
|
|
||||||
echo -e "FLIPPER_VERSION=0.125.0" >> ./gradle.properties
|
|
||||||
echo -e "VERSIONCODE=$CIRCLE_BUILD_NUM" >> ./gradle.properties
|
|
||||||
echo -e "APPLICATION_ID=chat.rocket.reactnative" >> ./gradle.properties
|
|
||||||
echo -e "BugsnagAPIKey=$BUGSNAG_KEY" >> ./gradle.properties
|
|
||||||
echo $KEYSTORE_EXPERIMENTAL_BASE64 | base64 --decode > ./app/$KEYSTORE_EXPERIMENTAL
|
|
||||||
echo -e "KEYSTORE=$KEYSTORE_EXPERIMENTAL" >> ./gradle.properties
|
|
||||||
echo -e "KEYSTORE_PASSWORD=$KEYSTORE_EXPERIMENTAL_PASSWORD" >> ./gradle.properties
|
|
||||||
echo -e "KEY_ALIAS=$KEYSTORE_EXPERIMENTAL_ALIAS" >> ./gradle.properties
|
|
||||||
echo -e "KEY_PASSWORD=$KEYSTORE_EXPERIMENTAL_PASSWORD" >> ./gradle.properties
|
|
||||||
working_directory: android
|
|
||||||
- run:
|
|
||||||
name: Build Android
|
|
||||||
command: |
|
|
||||||
echo "RUNNING_E2E_TESTS=true" > ./.env
|
|
||||||
yarn e2e:android-build
|
|
||||||
- save_cache: *save-gradle-cache
|
|
||||||
- store_artifacts:
|
|
||||||
path: android/app/build/outputs/apk/experimentalPlay/release/app-experimental-play-release.apk
|
|
||||||
- store_artifacts:
|
|
||||||
path: android/app/build/outputs/apk/androidTest/experimentalPlay/release/app-experimental-play-release-androidTest.apk
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: /home/circleci/repo
|
|
||||||
paths:
|
|
||||||
- android/app/build/outputs/apk/
|
|
||||||
|
|
||||||
e2e-test-android:
|
|
||||||
<<: *defaults
|
|
||||||
executor:
|
|
||||||
name: android/android-machine
|
|
||||||
resource-class: xlarge
|
|
||||||
tag: 2022.12.1
|
|
||||||
parallelism: 4
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- attach_workspace:
|
|
||||||
at: /home/circleci/repo
|
|
||||||
- restore_cache: *restore-npm-cache-linux
|
|
||||||
- run: *install-npm-modules
|
|
||||||
- save_cache: *save-npm-cache-linux
|
|
||||||
- run: mkdir ~/junit
|
|
||||||
- create-e2e-account-file
|
|
||||||
- android/create-avd:
|
|
||||||
avd-name: Pixel_API_31_AOSP
|
|
||||||
install: true
|
|
||||||
system-image: system-images;android-31;default;x86_64
|
|
||||||
- run:
|
|
||||||
name: Setup emulator
|
|
||||||
command: |
|
|
||||||
echo "hw.lcd.density = 440" >> ~/.android/avd/Pixel_API_31_AOSP.avd/config.ini
|
|
||||||
echo "hw.lcd.height = 2280" >> ~/.android/avd/Pixel_API_31_AOSP.avd/config.ini
|
|
||||||
echo "hw.lcd.width = 1080" >> ~/.android/avd/Pixel_API_31_AOSP.avd/config.ini
|
|
||||||
- run:
|
|
||||||
name: Run Detox Tests
|
|
||||||
command: |
|
|
||||||
TEST=$(circleci tests glob "e2e/tests/**/*.ts" | circleci tests split --split-by=timings)
|
|
||||||
yarn e2e:android-test $TEST
|
|
||||||
- store_artifacts:
|
|
||||||
path: artifacts
|
|
||||||
- run:
|
|
||||||
command: cp junit.xml ~/junit/
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/junit
|
|
||||||
- store_artifacts:
|
|
||||||
path: ~/junit
|
|
||||||
|
|
||||||
# iOS builds
|
# iOS builds
|
||||||
ios-build-experimental:
|
ios-build-experimental:
|
||||||
executor: mac-env
|
executor: mac-env
|
||||||
|
@ -560,89 +457,11 @@ jobs:
|
||||||
- upload-to-testflight:
|
- upload-to-testflight:
|
||||||
official: true
|
official: true
|
||||||
|
|
||||||
e2e-build-ios:
|
|
||||||
executor: mac-env
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- restore_cache: *restore-gems-cache
|
|
||||||
- restore_cache: *restore-npm-cache-mac
|
|
||||||
- run: *install-npm-modules
|
|
||||||
- run: *update-fastlane-ios
|
|
||||||
- save_cache: *save-npm-cache-mac
|
|
||||||
- save_cache: *save-gems-cache
|
|
||||||
- manage-pods
|
|
||||||
- run:
|
|
||||||
name: Configure Detox
|
|
||||||
command: |
|
|
||||||
brew tap wix/brew
|
|
||||||
brew install applesimutils
|
|
||||||
- run:
|
|
||||||
name: Build
|
|
||||||
command: |
|
|
||||||
/usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey $BUGSNAG_KEY" ./ios/RocketChatRN/Info.plist
|
|
||||||
/usr/libexec/PlistBuddy -c "Set :bugsnag:apiKey $BUGSNAG_KEY" ./ios/ShareRocketChatRN/Info.plist
|
|
||||||
yarn detox clean-framework-cache && yarn detox build-framework-cache
|
|
||||||
echo "RUNNING_E2E_TESTS=true" > ./.env
|
|
||||||
yarn e2e:ios-build
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: /Users/distiller/project
|
|
||||||
paths:
|
|
||||||
- ios/build/Build/Products/Release-iphonesimulator/Rocket.Chat Experimental.app
|
|
||||||
|
|
||||||
e2e-test-ios:
|
|
||||||
executor: mac-env
|
|
||||||
parallelism: 5
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- attach_workspace:
|
|
||||||
at: /Users/distiller/project
|
|
||||||
- restore_cache: *restore-npm-cache-mac
|
|
||||||
- run: *install-npm-modules
|
|
||||||
- save_cache: *save-npm-cache-mac
|
|
||||||
- run: mkdir ~/junit
|
|
||||||
- run:
|
|
||||||
name: Configure Detox
|
|
||||||
command: |
|
|
||||||
brew tap wix/brew
|
|
||||||
brew install applesimutils
|
|
||||||
yarn detox clean-framework-cache && yarn detox build-framework-cache
|
|
||||||
- create-e2e-account-file
|
|
||||||
- run:
|
|
||||||
name: Run tests
|
|
||||||
command: |
|
|
||||||
TEST=$(circleci tests glob "e2e/tests/**/*.ts" | circleci tests split --split-by=timings)
|
|
||||||
yarn e2e:ios-test $TEST
|
|
||||||
- store_artifacts:
|
|
||||||
path: artifacts
|
|
||||||
- run:
|
|
||||||
command: cp junit.xml ~/junit/
|
|
||||||
when: always
|
|
||||||
- store_test_results:
|
|
||||||
path: ~/junit
|
|
||||||
- store_artifacts:
|
|
||||||
path: ~/junit
|
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
jobs:
|
jobs:
|
||||||
- lint-testunit
|
- lint-testunit
|
||||||
|
|
||||||
# E2E tests
|
|
||||||
- e2e-hold:
|
|
||||||
type: approval
|
|
||||||
- e2e-build-ios:
|
|
||||||
requires:
|
|
||||||
- e2e-hold
|
|
||||||
- e2e-test-ios:
|
|
||||||
requires:
|
|
||||||
- e2e-build-ios
|
|
||||||
- e2e-build-android:
|
|
||||||
requires:
|
|
||||||
- e2e-hold
|
|
||||||
- e2e-test-android:
|
|
||||||
requires:
|
|
||||||
- e2e-build-android
|
|
||||||
|
|
||||||
# iOS Experimental
|
# iOS Experimental
|
||||||
- ios-hold-build-experimental:
|
- ios-hold-build-experimental:
|
||||||
type: approval
|
type: approval
|
||||||
|
|
91
.detoxrc.js
91
.detoxrc.js
|
@ -1,91 +0,0 @@
|
||||||
/** @type {Detox.DetoxConfig} */
|
|
||||||
module.exports = {
|
|
||||||
testRunner: {
|
|
||||||
args: {
|
|
||||||
$0: 'jest',
|
|
||||||
config: 'e2e/jest.config.js'
|
|
||||||
},
|
|
||||||
retries: process.env.CI ? 3 : 0
|
|
||||||
},
|
|
||||||
artifacts: {
|
|
||||||
plugins: {
|
|
||||||
screenshot: 'failing',
|
|
||||||
video: 'failing',
|
|
||||||
uiHierarchy: 'enabled'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
apps: {
|
|
||||||
'ios.debug': {
|
|
||||||
type: 'ios.app',
|
|
||||||
binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/Rocket.Chat Experimental.app',
|
|
||||||
build:
|
|
||||||
'xcodebuild -workspace ios/RocketChatRN.xcworkspace -scheme RocketChatRN -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build'
|
|
||||||
},
|
|
||||||
'ios.release': {
|
|
||||||
type: 'ios.app',
|
|
||||||
binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/Rocket.Chat Experimental.app',
|
|
||||||
build:
|
|
||||||
'xcodebuild -workspace ios/RocketChatRN.xcworkspace -scheme RocketChatRN -configuration Release -sdk iphonesimulator -derivedDataPath ios/build'
|
|
||||||
},
|
|
||||||
'android.debug': {
|
|
||||||
type: 'android.apk',
|
|
||||||
binaryPath: 'android/app/build/outputs/apk/experimentalPlay/debug/app-experimental-play-debug.apk',
|
|
||||||
build:
|
|
||||||
'cd android ; ./gradlew assembleExperimentalPlayDebug assembleExperimentalPlayDebugAndroidTest -DtestBuildType=debug ; cd -',
|
|
||||||
reversePorts: [8081]
|
|
||||||
},
|
|
||||||
'android.release': {
|
|
||||||
type: 'android.apk',
|
|
||||||
binaryPath: 'android/app/build/outputs/apk/experimentalPlay/release/app-experimental-play-release.apk',
|
|
||||||
build:
|
|
||||||
'cd android ; ./gradlew assembleExperimentalPlayRelease assembleExperimentalPlayReleaseAndroidTest -DtestBuildType=release ; cd -'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
devices: {
|
|
||||||
simulator: {
|
|
||||||
type: 'ios.simulator',
|
|
||||||
device: {
|
|
||||||
type: 'iPhone 14'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
attached: {
|
|
||||||
type: 'android.attached',
|
|
||||||
device: {
|
|
||||||
adbName: '.*'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
emulator: {
|
|
||||||
type: 'android.emulator',
|
|
||||||
device: {
|
|
||||||
avdName: 'Pixel_API_31_AOSP'
|
|
||||||
},
|
|
||||||
headless: process.env.CI ? true : false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
configurations: {
|
|
||||||
'ios.sim.debug': {
|
|
||||||
device: 'simulator',
|
|
||||||
app: 'ios.debug'
|
|
||||||
},
|
|
||||||
'ios.sim.release': {
|
|
||||||
device: 'simulator',
|
|
||||||
app: 'ios.release'
|
|
||||||
},
|
|
||||||
'android.att.debug': {
|
|
||||||
device: 'attached',
|
|
||||||
app: 'android.debug'
|
|
||||||
},
|
|
||||||
'android.att.release': {
|
|
||||||
device: 'attached',
|
|
||||||
app: 'android.release'
|
|
||||||
},
|
|
||||||
'android.emu.debug': {
|
|
||||||
device: 'emulator',
|
|
||||||
app: 'android.debug'
|
|
||||||
},
|
|
||||||
'android.emu.release': {
|
|
||||||
device: 'emulator',
|
|
||||||
app: 'android.release'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
24
.eslintrc.js
24
.eslintrc.js
|
@ -2,7 +2,7 @@ module.exports = {
|
||||||
settings: {
|
settings: {
|
||||||
'import/resolver': {
|
'import/resolver': {
|
||||||
node: {
|
node: {
|
||||||
extensions: ['.ts', '.tsx', '.js', '.ios.js', '.android.js', '.native.js', '.ios.tsx', '.android.tsx']
|
extensions: ['.ts', '.tsx', '.js', '.ios.js', '.android.js', '.native.js']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -156,6 +156,22 @@ module.exports = {
|
||||||
__DEV__: true
|
__DEV__: true
|
||||||
},
|
},
|
||||||
overrides: [
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['e2e/**'],
|
||||||
|
globals: {
|
||||||
|
by: true,
|
||||||
|
detox: true,
|
||||||
|
device: true,
|
||||||
|
element: true,
|
||||||
|
expect: true,
|
||||||
|
waitFor: true
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'import/no-extraneous-dependencies': 0,
|
||||||
|
'no-await-in-loop': 0,
|
||||||
|
'no-restricted-syntax': 0
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
files: ['**/*.ts', '**/*.tsx'],
|
files: ['**/*.ts', '**/*.tsx'],
|
||||||
extends: [
|
extends: [
|
||||||
|
@ -237,12 +253,6 @@ module.exports = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['e2e/**'],
|
|
||||||
rules: {
|
|
||||||
'no-await-in-loop': 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,5 +3,5 @@ updates:
|
||||||
- package-ecosystem: "npm"
|
- package-ecosystem: "npm"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "daily"
|
||||||
open-pull-requests-limit: 25
|
open-pull-requests-limit: 25
|
|
@ -66,7 +66,5 @@ artifacts
|
||||||
e2e/docker/rc_test_env/docker-compose.yml
|
e2e/docker/rc_test_env/docker-compose.yml
|
||||||
e2e/docker/data/db
|
e2e/docker/data/db
|
||||||
e2e/e2e_account.js
|
e2e/e2e_account.js
|
||||||
e2e/e2e_account.ts
|
|
||||||
junit.xml
|
|
||||||
|
|
||||||
*.p8
|
*.p8
|
|
@ -23,8 +23,6 @@ SECURITY.md
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
|
|
||||||
.storybook/
|
|
||||||
|
|
||||||
app/i18n/locales/
|
app/i18n/locales/
|
||||||
app/containers/CustomIcon/mappedIcons.js
|
app/containers/CustomIcon/mappedIcons.js
|
||||||
app/containers/CustomIcon/selection.json
|
app/containers/CustomIcon/selection.json
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
2.7.7
|
2.7.4
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
import { getStorybookUI } from '@storybook/react-native';
|
|
||||||
import './storybook.requires';
|
|
||||||
|
|
||||||
import RNBootSplash from 'react-native-bootsplash';
|
|
||||||
|
|
||||||
import { selectServerRequest } from '../app/actions/server';
|
|
||||||
import { mockedStore as store } from '../app/reducers/mockedStore';
|
|
||||||
import database from '../app/lib/database';
|
|
||||||
import { setUser } from '../app/actions/login';
|
|
||||||
|
|
||||||
RNBootSplash.hide();
|
|
||||||
|
|
||||||
const baseUrl = 'https://open.rocket.chat';
|
|
||||||
store.dispatch(selectServerRequest(baseUrl));
|
|
||||||
store.dispatch(setUser({ id: 'abc', username: 'rocket.cat', name: 'Rocket Cat' }));
|
|
||||||
database.setActiveDB(baseUrl);
|
|
||||||
|
|
||||||
const StorybookUIRoot = getStorybookUI({});
|
|
||||||
export default StorybookUIRoot;
|
|
|
@ -1,4 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
stories: ['../app/**/*.stories.?(ts|tsx|js|jsx)'],
|
|
||||||
addons: []
|
|
||||||
};
|
|
|
@ -1,40 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import { Provider } from 'react-redux';
|
|
||||||
|
|
||||||
import { themes } from '../app/lib/constants';
|
|
||||||
import MessageContext from '../app/containers/message/Context';
|
|
||||||
import { selectServerRequest } from '../app/actions/server';
|
|
||||||
import { mockedStore as store } from '../app/reducers/mockedStore';
|
|
||||||
import { setUser } from '../app/actions/login';
|
|
||||||
|
|
||||||
const baseUrl = 'https://open.rocket.chat';
|
|
||||||
store.dispatch(selectServerRequest(baseUrl));
|
|
||||||
store.dispatch(setUser({ id: 'abc', username: 'rocket.cat', name: 'Rocket Cat' }));
|
|
||||||
|
|
||||||
export const decorators = [
|
|
||||||
Story => (
|
|
||||||
<Provider store={store}>
|
|
||||||
<MessageContext.Provider
|
|
||||||
value={{
|
|
||||||
user: {
|
|
||||||
id: 'y8bd77ptZswPj3EW8',
|
|
||||||
username: 'diego.mello',
|
|
||||||
token: 'abc'
|
|
||||||
},
|
|
||||||
baseUrl,
|
|
||||||
onPress: () => {},
|
|
||||||
onLongPress: () => {},
|
|
||||||
reactionInit: () => {},
|
|
||||||
onErrorPress: () => {},
|
|
||||||
replyBroadcast: () => {},
|
|
||||||
onReactionPress: () => {},
|
|
||||||
onDiscussionPress: () => {},
|
|
||||||
onReactionLongPress: () => {},
|
|
||||||
threadBadgeColor: themes.light.tunreadColor
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Story />
|
|
||||||
</MessageContext.Provider>
|
|
||||||
</Provider>
|
|
||||||
)
|
|
||||||
];
|
|
|
@ -1,50 +0,0 @@
|
||||||
/* do not change this file, it is auto generated by storybook. */
|
|
||||||
|
|
||||||
import {
|
|
||||||
configure,
|
|
||||||
addDecorator,
|
|
||||||
addParameters,
|
|
||||||
addArgsEnhancer,
|
|
||||||
} from "@storybook/react-native";
|
|
||||||
|
|
||||||
import { decorators, parameters } from "./preview";
|
|
||||||
|
|
||||||
if (decorators) {
|
|
||||||
decorators.forEach((decorator) => addDecorator(decorator));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parameters) {
|
|
||||||
addParameters(parameters);
|
|
||||||
}
|
|
||||||
|
|
||||||
const getStories = () => {
|
|
||||||
return [
|
|
||||||
require("../app/containers/Avatar/Avatar.stories.tsx"),
|
|
||||||
require("../app/containers/BackgroundContainer/index.stories.tsx"),
|
|
||||||
require("../app/containers/Button/Button.stories.tsx"),
|
|
||||||
require("../app/containers/Chip/Chip.stories.tsx"),
|
|
||||||
require("../app/containers/HeaderButton/HeaderButtons.stories.tsx"),
|
|
||||||
require("../app/containers/List/List.stories.tsx"),
|
|
||||||
require("../app/containers/LoginServices/LoginServices.stories.tsx"),
|
|
||||||
require("../app/containers/markdown/Markdown.stories.tsx"),
|
|
||||||
require("../app/containers/markdown/new/NewMarkdown.stories.tsx"),
|
|
||||||
require("../app/containers/message/Components/CollapsibleQuote/CollapsibleQuote.stories.tsx"),
|
|
||||||
require("../app/containers/message/Message.stories.tsx"),
|
|
||||||
require("../app/containers/ReactionsList/ReactionsList.stories.tsx"),
|
|
||||||
require("../app/containers/RoomHeader/RoomHeader.stories.tsx"),
|
|
||||||
require("../app/containers/RoomItem/RoomItem.stories.tsx"),
|
|
||||||
require("../app/containers/SearchBox/SearchBox.stories.tsx"),
|
|
||||||
require("../app/containers/ServerItem/ServerItem.stories.tsx"),
|
|
||||||
require("../app/containers/TextInput/TextInput.stories.tsx"),
|
|
||||||
require("../app/containers/UIKit/UiKitMessage.stories.tsx"),
|
|
||||||
require("../app/containers/UIKit/UiKitModal.stories.tsx"),
|
|
||||||
require("../app/containers/UnreadBadge/UnreadBadge.stories.tsx"),
|
|
||||||
require("../app/views/CannedResponsesListView/CannedResponseItem.stories.tsx"),
|
|
||||||
require("../app/views/CreateChannelView/RoomSettings/SwitchItem.stories.tsx"),
|
|
||||||
require("../app/views/DiscussionsView/Item.stories.tsx"),
|
|
||||||
require("../app/views/RoomView/LoadMore/LoadMore.stories.tsx"),
|
|
||||||
require("../app/views/ThreadMessagesView/Item.stories.tsx"),
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
configure(getStories, module, false);
|
|
2
Gemfile
2
Gemfile
|
@ -1,4 +1,4 @@
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
|
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
|
||||||
ruby '2.7.7'
|
ruby '2.7.4'
|
||||||
gem 'cocoapods', '~> 1.11', '>= 1.11.2'
|
gem 'cocoapods', '~> 1.11', '>= 1.11.2'
|
|
@ -1,17 +0,0 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
||||||
|
|
||||||
exports[`Storyshots BackgroundContainer Basic 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessibilityIgnoresInvertColors\\":true,\\"style\\":{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\",\\"position\\":\\"absolute\\"}},\\"children\\":[{\\"type\\":\\"Image\\",\\"props\\":{\\"source\\":{\\"uri\\":\\"message_empty_light\\"},\\"style\\":[{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\"},null]},\\"children\\":null}]}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots BackgroundContainer Black Theme Loading 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessibilityIgnoresInvertColors\\":true,\\"style\\":{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\",\\"position\\":\\"absolute\\"}},\\"children\\":[{\\"type\\":\\"Image\\",\\"props\\":{\\"source\\":{\\"uri\\":\\"message_empty_black\\"},\\"style\\":[{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\"},null]},\\"children\\":null}]},{\\"type\\":\\"ActivityIndicator\\",\\"props\\":{\\"style\\":{\\"position\\":\\"absolute\\",\\"top\\":60,\\"left\\":0,\\"right\\":0,\\"fontSize\\":16,\\"paddingHorizontal\\":24,\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},\\"color\\":\\"#f9f9f9\\"},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots BackgroundContainer Black Theme Text 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessibilityIgnoresInvertColors\\":true,\\"style\\":{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\",\\"position\\":\\"absolute\\"}},\\"children\\":[{\\"type\\":\\"Image\\",\\"props\\":{\\"source\\":{\\"uri\\":\\"message_empty_black\\"},\\"style\\":[{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\"},null]},\\"children\\":null}]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"position\\":\\"absolute\\",\\"top\\":60,\\"left\\":0,\\"right\\":0,\\"fontSize\\":16,\\"paddingHorizontal\\":24,\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#f9f9f9\\"}]},\\"children\\":[\\"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries\\"]}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots BackgroundContainer Dark Theme Loading 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessibilityIgnoresInvertColors\\":true,\\"style\\":{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\",\\"position\\":\\"absolute\\"}},\\"children\\":[{\\"type\\":\\"Image\\",\\"props\\":{\\"source\\":{\\"uri\\":\\"message_empty_dark\\"},\\"style\\":[{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\"},null]},\\"children\\":null}]},{\\"type\\":\\"ActivityIndicator\\",\\"props\\":{\\"style\\":{\\"position\\":\\"absolute\\",\\"top\\":60,\\"left\\":0,\\"right\\":0,\\"fontSize\\":16,\\"paddingHorizontal\\":24,\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},\\"color\\":\\"#f9f9f9\\"},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots BackgroundContainer Dark Theme Text 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessibilityIgnoresInvertColors\\":true,\\"style\\":{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\",\\"position\\":\\"absolute\\"}},\\"children\\":[{\\"type\\":\\"Image\\",\\"props\\":{\\"source\\":{\\"uri\\":\\"message_empty_dark\\"},\\"style\\":[{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\"},null]},\\"children\\":null}]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"position\\":\\"absolute\\",\\"top\\":60,\\"left\\":0,\\"right\\":0,\\"fontSize\\":16,\\"paddingHorizontal\\":24,\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#f9f9f9\\"}]},\\"children\\":[\\"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries\\"]}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots BackgroundContainer Loading 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessibilityIgnoresInvertColors\\":true,\\"style\\":{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\",\\"position\\":\\"absolute\\"}},\\"children\\":[{\\"type\\":\\"Image\\",\\"props\\":{\\"source\\":{\\"uri\\":\\"message_empty_light\\"},\\"style\\":[{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\"},null]},\\"children\\":null}]},{\\"type\\":\\"ActivityIndicator\\",\\"props\\":{\\"style\\":{\\"position\\":\\"absolute\\",\\"top\\":60,\\"left\\":0,\\"right\\":0,\\"fontSize\\":16,\\"paddingHorizontal\\":24,\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},\\"color\\":\\"#6C727A\\"},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots BackgroundContainer Long Text 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessibilityIgnoresInvertColors\\":true,\\"style\\":{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\",\\"position\\":\\"absolute\\"}},\\"children\\":[{\\"type\\":\\"Image\\",\\"props\\":{\\"source\\":{\\"uri\\":\\"message_empty_light\\"},\\"style\\":[{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\"},null]},\\"children\\":null}]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"position\\":\\"absolute\\",\\"top\\":60,\\"left\\":0,\\"right\\":0,\\"fontSize\\":16,\\"paddingHorizontal\\":24,\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#6C727A\\"}]},\\"children\\":[\\"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries\\"]}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots BackgroundContainer Text 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessibilityIgnoresInvertColors\\":true,\\"style\\":{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\",\\"position\\":\\"absolute\\"}},\\"children\\":[{\\"type\\":\\"Image\\",\\"props\\":{\\"source\\":{\\"uri\\":\\"message_empty_light\\"},\\"style\\":[{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\"},null]},\\"children\\":null}]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"position\\":\\"absolute\\",\\"top\\":60,\\"left\\":0,\\"right\\":0,\\"fontSize\\":16,\\"paddingHorizontal\\":24,\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#6C727A\\"}]},\\"children\\":[\\"Text here\\"]}]}"`;
|
|
|
@ -1,13 +0,0 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
||||||
|
|
||||||
exports[`Storyshots Button Custom Button 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"Press me!\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"testButton\\",\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"paddingHorizontal\\":14,\\"justifyContent\\":\\"center\\",\\"height\\":48,\\"borderRadius\\":4,\\"marginBottom\\":12,\\"backgroundColor\\":\\"purple\\",\\"padding\\":10,\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"yellow\\",\\"fontSize\\":18},[{\\"textAlign\\":\\"left\\"}]],\\"accessibilityLabel\\":\\"Press me!\\"},\\"children\\":[\\"Press me!\\"]}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots Button Disabled Button 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"Press me!\\",\\"accessibilityState\\":{\\"disabled\\":true},\\"testID\\":\\"testButton\\",\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"paddingHorizontal\\":14,\\"justifyContent\\":\\"center\\",\\"height\\":48,\\"borderRadius\\":4,\\"marginBottom\\":12,\\"backgroundColor\\":\\"#1d74f5\\",\\"opacity\\":0.3}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"#ffffff\\",\\"fontSize\\":16},null],\\"accessibilityLabel\\":\\"Press me!\\"},\\"children\\":[\\"Press me!\\"]}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots Button Disabled Loading Button 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"Press me!\\",\\"accessibilityState\\":{\\"disabled\\":true},\\"testID\\":\\"testButton\\",\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"paddingHorizontal\\":14,\\"justifyContent\\":\\"center\\",\\"height\\":48,\\"borderRadius\\":4,\\"marginBottom\\":12,\\"backgroundColor\\":\\"#1d74f5\\",\\"opacity\\":0.3}},\\"children\\":[{\\"type\\":\\"ActivityIndicator\\",\\"props\\":{\\"style\\":[{\\"padding\\":16,\\"flex\\":1},null],\\"color\\":\\"#ffffff\\"},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots Button Loading Button 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"Press me!\\",\\"accessibilityState\\":{\\"disabled\\":true},\\"testID\\":\\"testButton\\",\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"paddingHorizontal\\":14,\\"justifyContent\\":\\"center\\",\\"height\\":48,\\"borderRadius\\":4,\\"marginBottom\\":12,\\"backgroundColor\\":\\"#1d74f5\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"ActivityIndicator\\",\\"props\\":{\\"style\\":[{\\"padding\\":16,\\"flex\\":1},null],\\"color\\":\\"#ffffff\\"},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots Button Primary Button 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"Press me!\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"testButton\\",\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"paddingHorizontal\\":14,\\"justifyContent\\":\\"center\\",\\"height\\":48,\\"borderRadius\\":4,\\"marginBottom\\":12,\\"backgroundColor\\":\\"#1d74f5\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"#ffffff\\",\\"fontSize\\":16},null],\\"accessibilityLabel\\":\\"Press me!\\"},\\"children\\":[\\"Press me!\\"]}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots Button Secondary Button 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"Press me!\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"testButton\\",\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"paddingHorizontal\\":14,\\"justifyContent\\":\\"center\\",\\"height\\":48,\\"borderRadius\\":4,\\"marginBottom\\":12,\\"backgroundColor\\":\\"#ffffff\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"#2f343d\\",\\"fontSize\\":16},null],\\"accessibilityLabel\\":\\"Press me!\\"},\\"children\\":[\\"Press me!\\"]}]}"`;
|
|
|
@ -1,11 +0,0 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
||||||
|
|
||||||
exports[`Storyshots Chip Chip Text 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"alignItems\\":\\"flex-start\\",\\"padding\\":16}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityState\\":{\\"disabled\\":false},\\"focusable\\":true,\\"style\\":[{\\"paddingHorizontal\\":8,\\"marginRight\\":8,\\"borderRadius\\":4,\\"justifyContent\\":\\"center\\",\\"maxWidth\\":192},{\\"backgroundColor\\":\\"#efeff4\\"},null],\\"collapsable\\":false},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flexDirection\\":\\"row\\",\\"alignItems\\":\\"center\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"width\\":28,\\"height\\":28,\\"borderRadius\\":4},{\\"marginRight\\":8,\\"marginVertical\\":8}],\\"testID\\":\\"avatar\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"overflow\\":\\"hidden\\"},{\\"width\\":28,\\"height\\":28,\\"borderRadius\\":4}]},\\"children\\":[{\\"type\\":\\"FastImageView\\",\\"props\\":{\\"style\\":{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},\\"source\\":{\\"uri\\":\\"https://open.rocket.chat/avatar/rocket.cat?format=png&size=56\\",\\"headers\\":{\\"User-Agent\\":\\"RC Mobile; ios unknown; vunknown (unknown)\\"},\\"priority\\":\\"high\\"},\\"resizeMode\\":\\"cover\\"},\\"children\\":null}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"marginRight\\":8,\\"maxWidth\\":120}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"fontSize\\":16,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"#2f343d\\"}],\\"numberOfLines\\":1},\\"children\\":[\\"Rocket.Cat\\"]}]},{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#6C727A\\"},null,{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]}]}]}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots Chip Chip With Short Text 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"alignItems\\":\\"flex-start\\",\\"padding\\":16}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityState\\":{\\"disabled\\":false},\\"focusable\\":true,\\"style\\":[{\\"paddingHorizontal\\":8,\\"marginRight\\":8,\\"borderRadius\\":4,\\"justifyContent\\":\\"center\\",\\"maxWidth\\":192},{\\"backgroundColor\\":\\"#efeff4\\"},null],\\"collapsable\\":false},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flexDirection\\":\\"row\\",\\"alignItems\\":\\"center\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"width\\":28,\\"height\\":28,\\"borderRadius\\":4},{\\"marginRight\\":8,\\"marginVertical\\":8}],\\"testID\\":\\"avatar\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"overflow\\":\\"hidden\\"},{\\"width\\":28,\\"height\\":28,\\"borderRadius\\":4}]},\\"children\\":[{\\"type\\":\\"FastImageView\\",\\"props\\":{\\"style\\":{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},\\"source\\":{\\"uri\\":\\"https://open.rocket.chat/avatar/rocket.cat?format=png&size=56\\",\\"headers\\":{\\"User-Agent\\":\\"RC Mobile; ios unknown; vunknown (unknown)\\"},\\"priority\\":\\"high\\"},\\"resizeMode\\":\\"cover\\"},\\"children\\":null}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"marginRight\\":8,\\"maxWidth\\":120}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"fontSize\\":16,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"#2f343d\\"}],\\"numberOfLines\\":1},\\"children\\":[\\"Short\\"]}]},{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#6C727A\\"},null,{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]}]}]}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots Chip Chip Without Avatar 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"alignItems\\":\\"flex-start\\",\\"padding\\":16}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityState\\":{\\"disabled\\":false},\\"focusable\\":true,\\"style\\":[{\\"paddingHorizontal\\":8,\\"marginRight\\":8,\\"borderRadius\\":4,\\"justifyContent\\":\\"center\\",\\"maxWidth\\":192},{\\"backgroundColor\\":\\"#efeff4\\"},null],\\"collapsable\\":false},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flexDirection\\":\\"row\\",\\"alignItems\\":\\"center\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"marginRight\\":8,\\"maxWidth\\":120}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"fontSize\\":16,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"#2f343d\\"}],\\"numberOfLines\\":1},\\"children\\":[\\"Without Avatar\\"]}]},{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":16,\\"color\\":\\"#6C727A\\"},null,{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]}]}]}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots Chip Chip Without Avatar And Icon 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"alignItems\\":\\"flex-start\\",\\"padding\\":16}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityState\\":{\\"disabled\\":true},\\"focusable\\":true,\\"style\\":[{\\"paddingHorizontal\\":8,\\"marginRight\\":8,\\"borderRadius\\":4,\\"justifyContent\\":\\"center\\",\\"maxWidth\\":192},{\\"backgroundColor\\":\\"#efeff4\\"},null],\\"collapsable\\":false},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flexDirection\\":\\"row\\",\\"alignItems\\":\\"center\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"marginRight\\":8,\\"maxWidth\\":120}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"fontSize\\":16,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"#2f343d\\"}],\\"numberOfLines\\":1},\\"children\\":[\\"Without Avatar and Icon\\"]}]}]}]}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots Chip Chip Without Icon 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"alignItems\\":\\"flex-start\\",\\"padding\\":16}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityState\\":{\\"disabled\\":true},\\"focusable\\":true,\\"style\\":[{\\"paddingHorizontal\\":8,\\"marginRight\\":8,\\"borderRadius\\":4,\\"justifyContent\\":\\"center\\",\\"maxWidth\\":192},{\\"backgroundColor\\":\\"#efeff4\\"},null],\\"collapsable\\":false},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flexDirection\\":\\"row\\",\\"alignItems\\":\\"center\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"width\\":28,\\"height\\":28,\\"borderRadius\\":4},{\\"marginRight\\":8,\\"marginVertical\\":8}],\\"testID\\":\\"avatar\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"overflow\\":\\"hidden\\"},{\\"width\\":28,\\"height\\":28,\\"borderRadius\\":4}]},\\"children\\":[{\\"type\\":\\"FastImageView\\",\\"props\\":{\\"style\\":{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},\\"source\\":{\\"uri\\":\\"https://open.rocket.chat/avatar/rocket.cat?format=png&size=56\\",\\"headers\\":{\\"User-Agent\\":\\"RC Mobile; ios unknown; vunknown (unknown)\\"},\\"priority\\":\\"high\\"},\\"resizeMode\\":\\"cover\\"},\\"children\\":null}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"marginRight\\":8,\\"maxWidth\\":120}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"fontSize\\":16,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"#2f343d\\"}],\\"numberOfLines\\":1},\\"children\\":[\\"Without Icon\\"]}]}]}]}]}"`;
|
|
|
@ -1,11 +0,0 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
||||||
|
|
||||||
exports[`Storyshots HeaderButtons Badge 1`] = `"{\\"type\\":\\"RNCSafeAreaProvider\\",\\"props\\":{\\"style\\":[{\\"flex\\":1},null]},\\"children\\":null}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots HeaderButtons Common 1`] = `"{\\"type\\":\\"RNCSafeAreaProvider\\",\\"props\\":{\\"style\\":[{\\"flex\\":1},null]},\\"children\\":null}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots HeaderButtons Icons 1`] = `"{\\"type\\":\\"RNCSafeAreaProvider\\",\\"props\\":{\\"style\\":[{\\"flex\\":1},null]},\\"children\\":null}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots HeaderButtons Themes 1`] = `"{\\"type\\":\\"RNCSafeAreaProvider\\",\\"props\\":{\\"style\\":[{\\"flex\\":1},null]},\\"children\\":null}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots HeaderButtons Title 1`] = `"{\\"type\\":\\"RNCSafeAreaProvider\\",\\"props\\":{\\"style\\":[{\\"flex\\":1},null]},\\"children\\":null}"`;
|
|
File diff suppressed because one or more lines are too long
|
@ -1,5 +0,0 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
||||||
|
|
||||||
exports[`Storyshots Login Services Separators 1`] = `"[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"More options\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"paddingHorizontal\\":14,\\"justifyContent\\":\\"center\\",\\"height\\":48,\\"borderRadius\\":4,\\"marginBottom\\":0,\\"backgroundColor\\":\\"#ffffff\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"#1d74f5\\",\\"fontSize\\":16},null],\\"accessibilityLabel\\":\\"More options\\"},\\"children\\":[\\"More options\\"]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flexDirection\\":\\"row\\",\\"alignItems\\":\\"center\\",\\"marginVertical\\":24}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"height\\":1,\\"flex\\":1},{\\"backgroundColor\\":\\"#e1e5e8\\"}]},\\"children\\":null},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"fontSize\\":14,\\"marginLeft\\":14,\\"marginRight\\":14,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"#9ca2a8\\"}]},\\"children\\":[\\"OR\\"]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"height\\":1,\\"flex\\":1},{\\"backgroundColor\\":\\"#e1e5e8\\"}]},\\"children\\":null}]},{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"Less options\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"paddingHorizontal\\":14,\\"justifyContent\\":\\"center\\",\\"height\\":48,\\"borderRadius\\":4,\\"marginBottom\\":0,\\"backgroundColor\\":\\"#ffffff\\",\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"#1d74f5\\",\\"fontSize\\":16},null],\\"accessibilityLabel\\":\\"Less options\\"},\\"children\\":[\\"Less options\\"]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flexDirection\\":\\"row\\",\\"alignItems\\":\\"center\\",\\"marginVertical\\":24}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"height\\":1,\\"flex\\":1},{\\"backgroundColor\\":\\"#e1e5e8\\"}]},\\"children\\":null},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"fontSize\\":14,\\"marginLeft\\":14,\\"marginRight\\":14,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"#9ca2a8\\"}]},\\"children\\":[\\"OR\\"]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"height\\":1,\\"flex\\":1},{\\"backgroundColor\\":\\"#e1e5e8\\"}]},\\"children\\":null}]}]"`;
|
|
||||||
|
|
||||||
exports[`Storyshots Login Services Service List 1`] = `"[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"borderRadius\\":4,\\"width\\":\\"100%\\",\\"height\\":48,\\"flexDirection\\":\\"row\\",\\"alignItems\\":\\"center\\",\\"justifyContent\\":\\"center\\",\\"paddingHorizontal\\":15}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":24,\\"color\\":\\"#0d0e12\\"},{\\"position\\":\\"absolute\\",\\"left\\":15,\\"top\\":12,\\"width\\":24,\\"height\\":24},{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\",\\"fontSize\\":16},{\\"color\\":\\"#0d0e12\\"}]},\\"children\\":[\\"Continue with\\",\\" \\",{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":{\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"}},\\"children\\":[\\"github\\"]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"borderRadius\\":4,\\"width\\":\\"100%\\",\\"height\\":48,\\"flexDirection\\":\\"row\\",\\"alignItems\\":\\"center\\",\\"justifyContent\\":\\"center\\",\\"paddingHorizontal\\":15}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":24,\\"color\\":\\"#0d0e12\\"},{\\"position\\":\\"absolute\\",\\"left\\":15,\\"top\\":12,\\"width\\":24,\\"height\\":24},{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\",\\"fontSize\\":16},{\\"color\\":\\"#0d0e12\\"}]},\\"children\\":[\\"Continue with\\",\\" \\",{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":{\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"}},\\"children\\":[\\"gitlab\\"]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"borderRadius\\":4,\\"width\\":\\"100%\\",\\"height\\":48,\\"flexDirection\\":\\"row\\",\\"alignItems\\":\\"center\\",\\"justifyContent\\":\\"center\\",\\"paddingHorizontal\\":15}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":24,\\"color\\":\\"#0d0e12\\"},{\\"position\\":\\"absolute\\",\\"left\\":15,\\"top\\":12,\\"width\\":24,\\"height\\":24},{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\",\\"fontSize\\":16},{\\"color\\":\\"#0d0e12\\"}]},\\"children\\":[\\"Continue with\\",\\" \\",{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":{\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"}},\\"children\\":[\\"google\\"]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"borderRadius\\":4,\\"width\\":\\"100%\\",\\"height\\":48,\\"flexDirection\\":\\"row\\",\\"alignItems\\":\\"center\\",\\"justifyContent\\":\\"center\\",\\"paddingHorizontal\\":15}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":24,\\"color\\":\\"#0d0e12\\"},{\\"position\\":\\"absolute\\",\\"left\\":15,\\"top\\":12,\\"width\\":24,\\"height\\":24},{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\",\\"fontSize\\":16},{\\"color\\":\\"#0d0e12\\"}]},\\"children\\":[\\"Continue with\\",\\" \\",{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":{\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"600\\"}},\\"children\\":[\\"apple\\"]}]}]}]"`;
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,3 +0,0 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
||||||
|
|
||||||
exports[`Storyshots SearchBox Basic 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"testID\\":\\"searchbox\\",\\"style\\":{\\"backgroundColor\\":\\"#ffffff\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"marginBottom\\":10},{\\"margin\\":16,\\"marginBottom\\":16}]},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"position\\":\\"relative\\",\\"justifyContent\\":\\"center\\"}},\\"children\\":[{\\"type\\":\\"TextInput\\",\\"props\\":{\\"style\\":[{\\"color\\":\\"#0d0e12\\"},[{\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\",\\"height\\":48,\\"fontSize\\":16,\\"paddingHorizontal\\":16,\\"paddingVertical\\":10,\\"borderWidth\\":1,\\"borderRadius\\":4},null,{\\"paddingRight\\":45},{\\"backgroundColor\\":\\"#ffffff\\",\\"borderColor\\":\\"#cbcbcc\\",\\"color\\":\\"#0d0e12\\"},null,null],{\\"textAlign\\":\\"auto\\"}],\\"placeholderTextColor\\":\\"#9ca2a8\\",\\"keyboardAppearance\\":\\"light\\",\\"autoCorrect\\":false,\\"autoCapitalize\\":\\"none\\",\\"underlineColorAndroid\\":\\"transparent\\",\\"accessibilityLabel\\":\\"Search\\",\\"placeholder\\":\\"Search\\",\\"value\\":\\"\\",\\"blurOnSubmit\\":true,\\"returnKeyType\\":\\"search\\"},\\"children\\":null},{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":20,\\"color\\":\\"#2f343d\\"},[{\\"position\\":\\"absolute\\"},{\\"right\\":12}],{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]}]}]}]}"`;
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,27 +0,0 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitMessage Action - Buttons 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitMessage Action - Select 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitMessage Context 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitMessage Fields 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitMessage Image 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitMessage Section + DatePicker 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitMessage Section + Markdown List 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitMessage Section + Multi Select 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitMessage Section + Overflow 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitMessage Section + Select 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitMessage Section + button 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitMessage Section + image 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitMessage Section 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
|
@ -1,21 +0,0 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitModal Modal - Actions 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitModal Modal - Contexts and Dividers 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitModal Modal - DatePicker with error 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitModal Modal - Form Input 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitModal Modal - Form TextArea 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitModal Modal - Images 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitModal Modal - Input with error 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitModal Modal - Multilne with error 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitModal Modal - Section and Accessories 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
||||||
|
|
||||||
exports[`Storyshots UIKit/UiKitModal Modal - Section and Selects 1`] = `"{\\"type\\":\\"RCTScrollView\\",\\"props\\":{\\"style\\":[{\\"flex\\":1,\\"backgroundColor\\":\\"#fff\\"},{\\"paddingHorizontal\\":16}],\\"keyboardShouldPersistTaps\\":\\"always\\"},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{},\\"children\\":null}]}"`;
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,3 +0,0 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
||||||
|
|
||||||
exports[`Storyshots CollapsibleQuote Item 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"padding\\":10}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"testID\\":\\"collapsibleQuoteTouchable-Engineering (9 today)\\",\\"hitSlop\\":{\\"top\\":4,\\"right\\":4,\\"bottom\\":4,\\"left\\":4},\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"flexDirection\\":\\"row\\",\\"alignItems\\":\\"center\\",\\"marginTop\\":6,\\"borderWidth\\":1,\\"borderRadius\\":4,\\"minHeight\\":40,\\"backgroundColor\\":\\"#f3f4f5\\",\\"borderLeftColor\\":\\"#CBCED1\\",\\"borderTopColor\\":\\"#e1e5e8\\",\\"borderRightColor\\":\\"#e1e5e8\\",\\"borderBottomColor\\":\\"#e1e5e8\\",\\"borderLeftWidth\\":2,\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"borderRadius\\":4,\\"padding\\":8}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flexDirection\\":\\"row\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"fontSize\\":16,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"#6C727A\\"}]},\\"children\\":[\\"Engineering (9 today)\\"]}]}]},{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"width\\":20,\\"height\\":20,\\"right\\":8,\\"top\\":8,\\"justifyContent\\":\\"center\\",\\"alignItems\\":\\"center\\"}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"selectable\\":false,\\"allowFontScaling\\":false,\\"style\\":[{\\"fontSize\\":22,\\"color\\":\\"#6C727A\\"},null,{\\"fontFamily\\":\\"custom\\",\\"fontWeight\\":\\"normal\\",\\"fontStyle\\":\\"normal\\"},{}]},\\"children\\":[\\"\\"]}]}]}]}]}"`;
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,3 +0,0 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
||||||
|
|
||||||
exports[`Storyshots SwitchItem Switch 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"alignItems\\":\\"flex-start\\",\\"padding\\":16}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":[{\\"minHeight\\":54,\\"alignItems\\":\\"center\\",\\"justifyContent\\":\\"space-between\\",\\"flexDirection\\":\\"row\\",\\"maxHeight\\":80,\\"marginBottom\\":12},{\\"backgroundColor\\":\\"#ffffff\\"}]},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1,\\"marginRight\\":8}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"fontSize\\":14,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"#0d0e12\\"}]},\\"children\\":[\\"Welcome to Rocket.Chat\\"]},{\\"type\\":\\"Text\\",\\"props\\":{\\"testID\\":\\"create-channel-switch-id-hint\\",\\"style\\":[{\\"fontSize\\":14,\\"textAlign\\":\\"left\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"Inter\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#9ca2a8\\"}]},\\"children\\":[\\"Only authorized users can write new messages\\"]}]},{\\"type\\":\\"RCTSwitch\\",\\"props\\":{\\"testID\\":\\"create-channel-switch-id\\",\\"disabled\\":false,\\"onTintColor\\":\\"#2de0a5\\",\\"style\\":{\\"height\\":31,\\"width\\":51},\\"tintColor\\":\\"#f5455c\\",\\"value\\":false,\\"accessibilityRole\\":\\"switch\\"},\\"children\\":null}]}]}"`;
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -147,7 +147,7 @@ android {
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode VERSIONCODE as Integer
|
versionCode VERSIONCODE as Integer
|
||||||
versionName "4.37.0"
|
versionName "4.30.0"
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
if (!isFoss) {
|
if (!isFoss) {
|
||||||
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
|
manifestPlaceholders = [BugsnagAPIKey: BugsnagAPIKey as String]
|
||||||
|
@ -250,7 +250,6 @@ android {
|
||||||
release {
|
release {
|
||||||
minifyEnabled enableProguardInReleaseBuilds
|
minifyEnabled enableProguardInReleaseBuilds
|
||||||
setProguardFiles([getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'])
|
setProguardFiles([getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'])
|
||||||
proguardFile "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro"
|
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
if (!isFoss) {
|
if (!isFoss) {
|
||||||
firebaseCrashlytics {
|
firebaseCrashlytics {
|
||||||
|
@ -269,11 +268,6 @@ android {
|
||||||
// pickFirst '**/x86_64/libc++_shared.so'
|
// pickFirst '**/x86_64/libc++_shared.so'
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// FIXME: Remove when we update RN
|
|
||||||
packagingOptions {
|
|
||||||
pickFirst '**/*.so'
|
|
||||||
}
|
|
||||||
|
|
||||||
// applicationVariants are e.g. debug, release
|
// applicationVariants are e.g. debug, release
|
||||||
|
|
||||||
flavorDimensions "app", "type"
|
flavorDimensions "app", "type"
|
||||||
|
@ -286,6 +280,10 @@ android {
|
||||||
dimension = "app"
|
dimension = "app"
|
||||||
buildConfigField "boolean", "IS_OFFICIAL", "false"
|
buildConfigField "boolean", "IS_OFFICIAL", "false"
|
||||||
}
|
}
|
||||||
|
e2e {
|
||||||
|
dimension = "app"
|
||||||
|
buildConfigField "boolean", "IS_OFFICIAL", "false"
|
||||||
|
}
|
||||||
foss {
|
foss {
|
||||||
dimension = "type"
|
dimension = "type"
|
||||||
buildConfigField "boolean", "FDROID_BUILD", "true"
|
buildConfigField "boolean", "FDROID_BUILD", "true"
|
||||||
|
@ -313,6 +311,16 @@ android {
|
||||||
java.srcDirs = ['src/main/java', 'src/play/java']
|
java.srcDirs = ['src/main/java', 'src/play/java']
|
||||||
manifest.srcFile 'src/play/AndroidManifest.xml'
|
manifest.srcFile 'src/play/AndroidManifest.xml'
|
||||||
}
|
}
|
||||||
|
e2ePlayDebug {
|
||||||
|
java.srcDirs = ['src/main/java', 'src/play/java']
|
||||||
|
res.srcDirs = ['src/experimental/res']
|
||||||
|
manifest.srcFile 'src/play/AndroidManifest.xml'
|
||||||
|
}
|
||||||
|
e2ePlayRelease {
|
||||||
|
java.srcDirs = ['src/main/java', 'src/play/java']
|
||||||
|
res.srcDirs = ['src/experimental/res']
|
||||||
|
manifest.srcFile 'src/play/AndroidManifest.xml'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
|
@ -343,12 +351,14 @@ android {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(':@react-native-community_viewpager')
|
implementation project(':@react-native-community_viewpager')
|
||||||
implementation "androidx.core:core-splashscreen:1.0.0"
|
|
||||||
playImplementation project(':react-native-notifications')
|
playImplementation project(':react-native-notifications')
|
||||||
playImplementation 'com.google.firebase:firebase-core:16.0.0'
|
playImplementation 'com.google.firebase:firebase-core:16.0.0'
|
||||||
playImplementation project(':@react-native-firebase_app')
|
playImplementation project(':@react-native-firebase_app')
|
||||||
playImplementation project(':@react-native-firebase_analytics')
|
playImplementation project(':@react-native-firebase_analytics')
|
||||||
playImplementation project(':@react-native-firebase_crashlytics')
|
playImplementation project(':@react-native-firebase_crashlytics')
|
||||||
|
implementation(project(':react-native-jitsi-meet')) { // https://github.com/skrafft/react-native-jitsi-meet#side-note
|
||||||
|
exclude group: 'com.facebook.react',module:'react-native-svg'
|
||||||
|
}
|
||||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||||
|
|
||||||
//noinspection GradleDynamicVersion
|
//noinspection GradleDynamicVersion
|
||||||
|
@ -377,9 +387,8 @@ dependencies {
|
||||||
implementation "com.github.bumptech.glide:glide:4.9.0"
|
implementation "com.github.bumptech.glide:glide:4.9.0"
|
||||||
annotationProcessor "com.github.bumptech.glide:compiler:4.9.0"
|
annotationProcessor "com.github.bumptech.glide:compiler:4.9.0"
|
||||||
implementation "com.tencent:mmkv-static:1.2.10"
|
implementation "com.tencent:mmkv-static:1.2.10"
|
||||||
androidTestImplementation('com.wix:detox:+')
|
androidTestImplementation('com.wix:detox:+') { transitive = true }
|
||||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
androidTestImplementation 'junit:junit:4.12'
|
||||||
implementation 'com.facebook.soloader:soloader:0.10.4'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNewArchitectureEnabled()) {
|
if (isNewArchitectureEnabled()) {
|
||||||
|
|
|
@ -18,7 +18,7 @@ public class DetoxTest {
|
||||||
@Rule
|
@Rule
|
||||||
// Replace 'MainActivity' with the value of android:name entry in
|
// Replace 'MainActivity' with the value of android:name entry in
|
||||||
// <activity> in AndroidManifest.xml
|
// <activity> in AndroidManifest.xml
|
||||||
public ActivityTestRule<chat.rocket.reactnative.MainActivity> mActivityRule = new ActivityTestRule<>(chat.rocket.reactnative.MainActivity.class, false, false);
|
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void runDetoxTests() {
|
public void runDetoxTests() {
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package chat.rocket.reactnative;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.facebook.react.ReactInstanceManager;
|
||||||
|
|
||||||
|
public class MainDebugApplication extends MainApplication {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
|
||||||
|
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
||||||
|
*
|
||||||
|
* @param context
|
||||||
|
* @param reactInstanceManager
|
||||||
|
*/
|
||||||
|
private static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
|
||||||
|
ReactNativeFlipper.initializeFlipper(context, reactInstanceManager);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<network-security-config xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<base-config cleartextTrafficPermitted="true">
|
||||||
|
<trust-anchors>
|
||||||
|
<certificates src="system" />
|
||||||
|
<certificates src="user"
|
||||||
|
tools:ignore="AcceptsUserCertificates" />
|
||||||
|
</trust-anchors>
|
||||||
|
</base-config>
|
||||||
|
</network-security-config>
|
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
|
@ -5,15 +5,6 @@
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
|
||||||
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
|
||||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
|
||||||
<uses-permission android:name="android.permission.VIDEO_CAPTURE" />
|
|
||||||
<uses-permission android:name="android.permission.AUDIO_CAPTURE" />
|
|
||||||
|
|
||||||
<!-- permissions related to jitsi call -->
|
|
||||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name="chat.rocket.reactnative.MainApplication"
|
android:name="chat.rocket.reactnative.MainApplication"
|
||||||
android:allowBackup="false"
|
android:allowBackup="false"
|
||||||
|
@ -22,9 +13,17 @@
|
||||||
android:networkSecurityConfig="@xml/network_security_config"
|
android:networkSecurityConfig="@xml/network_security_config"
|
||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/BootTheme"
|
android:theme="@style/AppTheme"
|
||||||
android:hardwareAccelerated="true"
|
|
||||||
tools:replace="android:allowBackup">
|
tools:replace="android:allowBackup">
|
||||||
|
<activity
|
||||||
|
android:name="com.zoontek.rnbootsplash.RNBootSplashActivity"
|
||||||
|
android:theme="@style/BootTheme"
|
||||||
|
android:exported="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="chat.rocket.reactnative.MainActivity"
|
android:name="chat.rocket.reactnative.MainActivity"
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
|
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
|
||||||
|
@ -57,10 +56,6 @@
|
||||||
android:host="jitsi.rocket.chat"
|
android:host="jitsi.rocket.chat"
|
||||||
android:scheme="rocketchat" />
|
android:scheme="rocketchat" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="chat.rocket.reactnative.share.ShareActivity"
|
android:name="chat.rocket.reactnative.share.ShareActivity"
|
||||||
|
@ -68,7 +63,7 @@
|
||||||
android:label="@string/share_extension_name"
|
android:label="@string/share_extension_name"
|
||||||
android:noHistory="true"
|
android:noHistory="true"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/ShareTheme"
|
android:theme="@style/AppTheme"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.SEND" />
|
<action android:name="android.intent.action.SEND" />
|
||||||
|
@ -79,10 +74,5 @@
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
<queries>
|
|
||||||
<package android:name="org.jitsi.meet" />
|
|
||||||
<intent>
|
|
||||||
<action android:name="android.intent.action.SEND" />
|
|
||||||
</intent>
|
|
||||||
</queries>
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,23 +1,24 @@
|
||||||
package chat.rocket.reactnative;
|
package chat.rocket.reactnative;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
import com.facebook.react.ReactActivity;
|
|
||||||
import com.facebook.react.ReactActivityDelegate;
|
|
||||||
import com.facebook.react.ReactRootView;
|
import com.facebook.react.ReactRootView;
|
||||||
import com.zoontek.rnbootsplash.RNBootSplash;
|
import com.facebook.react.ReactActivityDelegate;
|
||||||
|
import com.facebook.react.ReactActivity;
|
||||||
|
|
||||||
import expo.modules.ReactActivityDelegateWrapper;
|
import expo.modules.ReactActivityDelegateWrapper;
|
||||||
|
|
||||||
|
import com.zoontek.rnbootsplash.RNBootSplash;
|
||||||
|
|
||||||
public class MainActivity extends ReactActivity {
|
public class MainActivity extends ReactActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
RNBootSplash.init(this);
|
|
||||||
// https://github.com/software-mansion/react-native-screens/issues/17#issuecomment-424704067
|
// https://github.com/software-mansion/react-native-screens/issues/17#issuecomment-424704067
|
||||||
super.onCreate(null);
|
super.onCreate(null);
|
||||||
|
RNBootSplash.init(R.drawable.launch_screen, MainActivity.this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -9,16 +9,13 @@ import com.facebook.react.ReactApplication;
|
||||||
import com.facebook.react.ReactNativeHost;
|
import com.facebook.react.ReactNativeHost;
|
||||||
import com.facebook.react.ReactPackage;
|
import com.facebook.react.ReactPackage;
|
||||||
import com.facebook.react.config.ReactFeatureFlags;
|
import com.facebook.react.config.ReactFeatureFlags;
|
||||||
import com.facebook.react.ReactInstanceManager;
|
|
||||||
import com.facebook.soloader.SoLoader;
|
import com.facebook.soloader.SoLoader;
|
||||||
import com.reactnativecommunity.viewpager.RNCViewPagerPackage;
|
import com.reactnativecommunity.viewpager.RNCViewPagerPackage;
|
||||||
import com.facebook.react.bridge.JSIModulePackage;
|
import com.facebook.react.bridge.JSIModulePackage;
|
||||||
import com.swmansion.reanimated.ReanimatedJSIModulePackage;
|
import com.swmansion.reanimated.ReanimatedJSIModulePackage;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import expo.modules.ApplicationLifecycleDispatcher;
|
import expo.modules.ApplicationLifecycleDispatcher;
|
||||||
import expo.modules.ReactNativeHostWrapper;
|
import expo.modules.ReactNativeHostWrapper;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -79,7 +76,6 @@ public class MainApplication extends Application implements ReactApplication {
|
||||||
// If you opted-in for the New Architecture, we enable the TurboModule system
|
// If you opted-in for the New Architecture, we enable the TurboModule system
|
||||||
ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
||||||
SoLoader.init(this, /* native exopackage */ false);
|
SoLoader.init(this, /* native exopackage */ false);
|
||||||
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
||||||
ApplicationLifecycleDispatcher.onApplicationCreate(this);
|
ApplicationLifecycleDispatcher.onApplicationCreate(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,35 +84,4 @@ public class MainApplication extends Application implements ReactApplication {
|
||||||
super.onConfigurationChanged(newConfig);
|
super.onConfigurationChanged(newConfig);
|
||||||
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);
|
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
|
|
||||||
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
||||||
*
|
|
||||||
* @param context
|
|
||||||
* @param reactInstanceManager
|
|
||||||
*/
|
|
||||||
private static void initializeFlipper(
|
|
||||||
Context context, ReactInstanceManager reactInstanceManager) {
|
|
||||||
if (BuildConfig.DEBUG) {
|
|
||||||
try {
|
|
||||||
/*
|
|
||||||
We use reflection here to pick up the class that initializes Flipper,
|
|
||||||
since Flipper library is not available in release mode
|
|
||||||
*/
|
|
||||||
Class<?> aClass = Class.forName("chat.rocket.reactnative.ReactNativeFlipper");
|
|
||||||
aClass
|
|
||||||
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
|
|
||||||
.invoke(null, context, reactInstanceManager);
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (NoSuchMethodException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (InvocationTargetException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package chat.rocket.reactnative.share;
|
package chat.rocket.reactnative.share;
|
||||||
|
|
||||||
import com.facebook.react.ReactActivity;
|
import com.facebook.react.ReactActivity;
|
||||||
|
import com.facebook.react.ReactActivityDelegate;
|
||||||
|
import com.facebook.react.ReactRootView;
|
||||||
|
|
||||||
public class ShareActivity extends ReactActivity {
|
public class ShareActivity extends ReactActivity {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque">
|
||||||
|
<!-- the background color. it can be a system color or a custom one defined in colors.xml -->
|
||||||
|
<item android:drawable="@color/splashBackground" />
|
||||||
|
<item>
|
||||||
|
<!-- the app logo, centered horizontally and vertically -->
|
||||||
|
<bitmap
|
||||||
|
android:src="@drawable/splash"
|
||||||
|
android:gravity="center" />
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
|
@ -7,16 +7,26 @@
|
||||||
<!-- RN 0.68.2 -->
|
<!-- RN 0.68.2 -->
|
||||||
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
|
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="ShareTheme" parent="AppTheme">
|
<style name="Share.Window" parent="android:Theme">
|
||||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
<item name="android:windowEnterAnimation">@null</item>
|
||||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
<item name="android:windowExitAnimation">@null</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="BootTheme" parent="Theme.SplashScreen">
|
<style name="Theme.Share.Transparent" parent="android:Theme">
|
||||||
<item name="windowSplashScreenBackground">@color/splashBackground</item>
|
<item name="android:windowIsTranslucent">true</item>
|
||||||
<item name="windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
|
<item name="android:windowBackground">@color/primary_dark</item>
|
||||||
<item name="postSplashScreenTheme">@style/AppTheme</item>
|
<item name="android:windowContentOverlay">@null</item>
|
||||||
|
<item name="android:windowNoTitle">true</item>
|
||||||
|
<item name="android:windowIsFloating">true</item>
|
||||||
|
<item name="android:backgroundDimEnabled">true</item>
|
||||||
|
<item name="android:windowAnimationStyle">@style/Share.Window</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="BootTheme" parent="AppTheme">
|
||||||
|
<item name="android:background">@drawable/launch_screen</item>
|
||||||
|
<item name="colorPrimaryDark">@color/splashBackground</item>
|
||||||
|
<item name="android:navigationBarColor">@color/splashBackground</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!-- https://github.com/facebook/react-native/blob/d1ab03235cb4b93304150878d2b9057ab45bba77/ReactAndroid/src/main/res/views/modal/values/themes.xml#L5 -->
|
<!-- https://github.com/facebook/react-native/blob/d1ab03235cb4b93304150878d2b9057ab45bba77/ReactAndroid/src/main/res/views/modal/values/themes.xml#L5 -->
|
||||||
|
|
|
@ -7,8 +7,4 @@
|
||||||
tools:ignore="AcceptsUserCertificates" />
|
tools:ignore="AcceptsUserCertificates" />
|
||||||
</trust-anchors>
|
</trust-anchors>
|
||||||
</base-config>
|
</base-config>
|
||||||
<domain-config cleartextTrafficPermitted="true">
|
|
||||||
<domain includeSubdomains="true">10.0.2.2</domain>
|
|
||||||
<domain includeSubdomains="true">localhost</domain>
|
|
||||||
</domain-config>
|
|
||||||
</network-security-config>
|
</network-security-config>
|
Binary file not shown.
After Width: | Height: | Size: 7.5 KiB |
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque">
|
||||||
|
<!-- the background color. it can be a system color or a custom one defined in colors.xml -->
|
||||||
|
<item android:drawable="@color/splashBackground" />
|
||||||
|
<item>
|
||||||
|
<!-- the app logo, centered horizontally and vertically -->
|
||||||
|
<bitmap
|
||||||
|
android:src="@drawable/splash"
|
||||||
|
android:gravity="center" />
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
|
@ -6,6 +6,7 @@
|
||||||
android:name="chat.rocket.reactnative.MainPlayApplication"
|
android:name="chat.rocket.reactnative.MainPlayApplication"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
android:theme="@style/AppTheme"
|
||||||
android:networkSecurityConfig="@xml/network_security_config"
|
android:networkSecurityConfig="@xml/network_security_config"
|
||||||
tools:replace="android:name"
|
tools:replace="android:name"
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package chat.rocket.reactnative;
|
package chat.rocket.reactnative;
|
||||||
|
|
||||||
import static com.wix.reactnativenotifications.Defs.NOTIFICATION_RECEIVED_EVENT_NAME;
|
|
||||||
|
|
||||||
import android.app.Notification;
|
import android.app.Notification;
|
||||||
import android.app.NotificationChannel;
|
import android.app.NotificationChannel;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
|
@ -37,6 +35,8 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
|
||||||
|
import static com.wix.reactnativenotifications.Defs.NOTIFICATION_RECEIVED_EVENT_NAME;
|
||||||
|
|
||||||
public class CustomPushNotification extends PushNotification {
|
public class CustomPushNotification extends PushNotification {
|
||||||
public static ReactApplicationContext reactApplicationContext;
|
public static ReactApplicationContext reactApplicationContext;
|
||||||
final NotificationManager notificationManager;
|
final NotificationManager notificationManager;
|
||||||
|
@ -322,12 +322,7 @@ public class CustomPushNotification extends PushNotification {
|
||||||
replyIntent.setAction(KEY_REPLY);
|
replyIntent.setAction(KEY_REPLY);
|
||||||
replyIntent.putExtra("pushNotification", bundle);
|
replyIntent.putExtra("pushNotification", bundle);
|
||||||
|
|
||||||
PendingIntent replyPendingIntent;
|
PendingIntent replyPendingIntent = PendingIntent.getBroadcast(mContext, notificationId, replyIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
|
||||||
replyPendingIntent = PendingIntent.getBroadcast(mContext, notificationId, replyIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE);
|
|
||||||
} else {
|
|
||||||
replyPendingIntent = PendingIntent.getBroadcast(mContext, notificationId, replyIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
RemoteInput remoteInput = new RemoteInput.Builder(KEY_REPLY)
|
RemoteInput remoteInput = new RemoteInput.Builder(KEY_REPLY)
|
||||||
.setLabel(label)
|
.setLabel(label)
|
||||||
|
@ -348,13 +343,12 @@ public class CustomPushNotification extends PushNotification {
|
||||||
Intent intent = new Intent(mContext, DismissNotification.class);
|
Intent intent = new Intent(mContext, DismissNotification.class);
|
||||||
intent.putExtra(NOTIFICATION_ID, notificationId);
|
intent.putExtra(NOTIFICATION_ID, notificationId);
|
||||||
|
|
||||||
PendingIntent dismissPendingIntent = PendingIntent.getBroadcast(mContext, notificationId, intent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);
|
PendingIntent dismissPendingIntent = PendingIntent.getBroadcast(mContext, notificationId, intent, 0);
|
||||||
|
|
||||||
notification.setDeleteIntent(dismissPendingIntent);
|
notification.setDeleteIntent(dismissPendingIntent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void notificationLoad(Ejson ejson, Callback callback) {
|
private void notificationLoad(Ejson ejson, Callback callback) {
|
||||||
LoadNotification loadNotification = new LoadNotification();
|
LoadNotification.load(reactApplicationContext, ejson, callback);
|
||||||
loadNotification.load(reactApplicationContext, ejson, callback);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,20 @@
|
||||||
package chat.rocket.reactnative;
|
package chat.rocket.reactnative;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
import com.facebook.react.bridge.ReactApplicationContext;
|
import okhttp3.Call;
|
||||||
import com.google.gson.Gson;
|
|
||||||
|
|
||||||
import okhttp3.HttpUrl;
|
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.HttpUrl;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
|
import okhttp3.Interceptor;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.facebook.react.bridge.ReactApplicationContext;
|
||||||
|
|
||||||
class JsonResponse {
|
class JsonResponse {
|
||||||
Data data;
|
Data data;
|
||||||
|
@ -43,11 +49,11 @@ class JsonResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
public class LoadNotification {
|
public class LoadNotification {
|
||||||
private int RETRY_COUNT = 0;
|
private static int RETRY_COUNT = 0;
|
||||||
private int[] TIMEOUT = new int[]{0, 1, 3, 5, 10};
|
private static int[] TIMEOUT = new int[]{0, 1, 3, 5, 10};
|
||||||
private String TOKEN_KEY = "reactnativemeteor_usertoken-";
|
private static String TOKEN_KEY = "reactnativemeteor_usertoken-";
|
||||||
|
|
||||||
public void load(ReactApplicationContext reactApplicationContext, final Ejson ejson, Callback callback) {
|
public static void load(ReactApplicationContext reactApplicationContext, final Ejson ejson, Callback callback) {
|
||||||
final OkHttpClient client = new OkHttpClient();
|
final OkHttpClient client = new OkHttpClient();
|
||||||
HttpUrl.Builder url = HttpUrl.parse(ejson.serverURL().concat("/api/v1/push.get")).newBuilder();
|
HttpUrl.Builder url = HttpUrl.parse(ejson.serverURL().concat("/api/v1/push.get")).newBuilder();
|
||||||
|
|
||||||
|
@ -67,7 +73,7 @@ public class LoadNotification {
|
||||||
runRequest(client, request, callback);
|
runRequest(client, request, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void runRequest(OkHttpClient client, Request request, Callback callback) {
|
private static void runRequest(OkHttpClient client, Request request, Callback callback) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(TIMEOUT[RETRY_COUNT] * 1000);
|
Thread.sleep(TIMEOUT[RETRY_COUNT] * 1000);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
import org.apache.tools.ant.taskdefs.condition.Os
|
import org.apache.tools.ant.taskdefs.condition.Os
|
||||||
|
|
||||||
|
def safeExtGet(prop, fallback) {
|
||||||
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
||||||
|
}
|
||||||
|
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
buildscript {
|
buildscript {
|
||||||
def taskRequests = getGradle().getStartParameter().getTaskRequests().toString().toLowerCase()
|
def taskRequests = getGradle().getStartParameter().getTaskRequests().toString().toLowerCase()
|
||||||
|
@ -9,7 +13,8 @@ buildscript {
|
||||||
buildToolsVersion = "31.0.0"
|
buildToolsVersion = "31.0.0"
|
||||||
minSdkVersion = 23
|
minSdkVersion = 23
|
||||||
compileSdkVersion = 31
|
compileSdkVersion = 31
|
||||||
targetSdkVersion = 31
|
// TODO: Fix "android:exported" issue and target 31 again
|
||||||
|
targetSdkVersion = 30
|
||||||
if (System.properties['os.arch'] == "aarch64") {
|
if (System.properties['os.arch'] == "aarch64") {
|
||||||
// For M1 Users we need to use the NDK 24 which added support for aarch64
|
// For M1 Users we need to use the NDK 24 which added support for aarch64
|
||||||
ndkVersion = "24.0.8215888"
|
ndkVersion = "24.0.8215888"
|
||||||
|
@ -22,6 +27,8 @@ buildscript {
|
||||||
kotlinVersion = '1.6.10'
|
kotlinVersion = '1.6.10'
|
||||||
supportLibVersion = "28.0.0"
|
supportLibVersion = "28.0.0"
|
||||||
libre_build = !(isPlay.toBoolean())
|
libre_build = !(isPlay.toBoolean())
|
||||||
|
jitsi_url = isPlay ? "https://github.com/RocketChat/jitsi-maven-repository/raw/master/releases" : "https://github.com/RocketChat/jitsi-maven-repository/raw/libre/releases"
|
||||||
|
jitsi_version = isPlay ? "3.6.0" : "3.6.0-libre"
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -62,6 +69,9 @@ allprojects {
|
||||||
url "$rootDir/../node_modules/detox/Detox-android"
|
url "$rootDir/../node_modules/detox/Detox-android"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
maven {
|
||||||
|
url jitsi_url
|
||||||
|
}
|
||||||
mavenCentral {
|
mavenCentral {
|
||||||
content {
|
content {
|
||||||
excludeGroup "com.facebook.react"
|
excludeGroup "com.facebook.react"
|
||||||
|
@ -71,38 +81,5 @@ allprojects {
|
||||||
google()
|
google()
|
||||||
maven { url 'https://maven.google.com' }
|
maven { url 'https://maven.google.com' }
|
||||||
maven { url 'https://www.jitpack.io' }
|
maven { url 'https://www.jitpack.io' }
|
||||||
|
|
||||||
// https://stackoverflow.com/a/74333788/5447468
|
|
||||||
// TODO: remove once we update RN
|
|
||||||
exclusiveContent {
|
|
||||||
// We get React Native's Android binaries exclusively through npm,
|
|
||||||
// from a local Maven repo inside node_modules/react-native/.
|
|
||||||
// (The use of exclusiveContent prevents looking elsewhere like Maven Central
|
|
||||||
// and potentially getting a wrong version.)
|
|
||||||
filter {
|
|
||||||
includeGroup "com.facebook.react"
|
|
||||||
}
|
|
||||||
forRepository {
|
|
||||||
maven {
|
|
||||||
// NOTE: if you are in a monorepo, you may have "$rootDir/../../../node_modules/react-native/android"
|
|
||||||
url "$rootDir/../node_modules/react-native/android"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
subprojects { subproject ->
|
|
||||||
afterEvaluate {
|
|
||||||
if (!project.name.equalsIgnoreCase("app") && project.hasProperty("android")) {
|
|
||||||
android {
|
|
||||||
compileSdkVersion 31
|
|
||||||
buildToolsVersion "31.0.0"
|
|
||||||
defaultConfig {
|
|
||||||
minSdkVersion 23
|
|
||||||
targetSdkVersion 31
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -23,7 +23,7 @@ android.useAndroidX=true
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
|
|
||||||
# Version of flipper SDK to use with React Native
|
# Version of flipper SDK to use with React Native
|
||||||
FLIPPER_VERSION=0.175.0
|
FLIPPER_VERSION=0.125.0
|
||||||
|
|
||||||
# Use this property to specify which architecture you want to build.
|
# Use this property to specify which architecture you want to build.
|
||||||
# You can also override it from the CLI using
|
# You can also override it from the CLI using
|
||||||
|
|
|
@ -1,24 +1,23 @@
|
||||||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
/* eslint-disable */
|
||||||
import { NativeModules, LogBox } from 'react-native';
|
import AsyncStorage from '@react-native-community/async-storage';
|
||||||
|
import { NativeModules } from 'react-native';
|
||||||
import Reactotron from 'reactotron-react-native';
|
import Reactotron from 'reactotron-react-native';
|
||||||
import { reactotronRedux } from 'reactotron-redux';
|
import { reactotronRedux } from 'reactotron-redux';
|
||||||
import sagaPlugin from 'reactotron-redux-saga';
|
import sagaPlugin from 'reactotron-redux-saga';
|
||||||
|
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
const { scriptURL } = NativeModules.SourceCode;
|
const scriptURL = NativeModules.SourceCode.scriptURL;
|
||||||
const scriptHostname = scriptURL.split('://')[1].split(':')[0];
|
const scriptHostname = scriptURL.split('://')[1].split(':')[0];
|
||||||
Reactotron.setAsyncStorageHandler?.(AsyncStorage)
|
Reactotron.setAsyncStorageHandler(AsyncStorage)
|
||||||
.configure({ host: scriptHostname })
|
.configure({ host: scriptHostname })
|
||||||
.useReactNative()
|
.useReactNative()
|
||||||
.use(reactotronRedux())
|
.use(reactotronRedux())
|
||||||
.use(sagaPlugin({}))
|
.use(sagaPlugin())
|
||||||
.connect();
|
.connect();
|
||||||
// Running on android device
|
// Running on android device
|
||||||
// $ adb reverse tcp:9090 tcp:9090
|
// $ adb reverse tcp:9090 tcp:9090
|
||||||
Reactotron.clear?.();
|
Reactotron.clear();
|
||||||
// @ts-ignore
|
|
||||||
console.warn = Reactotron.log;
|
console.warn = Reactotron.log;
|
||||||
// @ts-ignore
|
|
||||||
console.log = Reactotron.log;
|
console.log = Reactotron.log;
|
||||||
LogBox.ignoreAllLogs(true);
|
console.disableYellowBox = true;
|
||||||
}
|
}
|
|
@ -28,9 +28,7 @@ export const ROOM = createRequestTypes('ROOM', [
|
||||||
'DELETE',
|
'DELETE',
|
||||||
'REMOVED',
|
'REMOVED',
|
||||||
'FORWARD',
|
'FORWARD',
|
||||||
'USER_TYPING',
|
'USER_TYPING'
|
||||||
'HISTORY_REQUEST',
|
|
||||||
'HISTORY_FINISHED'
|
|
||||||
]);
|
]);
|
||||||
export const INQUIRY = createRequestTypes('INQUIRY', [
|
export const INQUIRY = createRequestTypes('INQUIRY', [
|
||||||
...defaultTypes,
|
...defaultTypes,
|
||||||
|
@ -40,14 +38,7 @@ export const INQUIRY = createRequestTypes('INQUIRY', [
|
||||||
'QUEUE_UPDATE',
|
'QUEUE_UPDATE',
|
||||||
'QUEUE_REMOVE'
|
'QUEUE_REMOVE'
|
||||||
]);
|
]);
|
||||||
export const APP = createRequestTypes('APP', [
|
export const APP = createRequestTypes('APP', ['START', 'READY', 'INIT', 'INIT_LOCAL_SETTINGS', 'SET_MASTER_DETAIL']);
|
||||||
'START',
|
|
||||||
'READY',
|
|
||||||
'INIT',
|
|
||||||
'INIT_LOCAL_SETTINGS',
|
|
||||||
'SET_MASTER_DETAIL',
|
|
||||||
'SET_NOTIFICATION_PRESENCE_CAP'
|
|
||||||
]);
|
|
||||||
export const MESSAGES = createRequestTypes('MESSAGES', ['REPLY_BROADCAST']);
|
export const MESSAGES = createRequestTypes('MESSAGES', ['REPLY_BROADCAST']);
|
||||||
export const CREATE_CHANNEL = createRequestTypes('CREATE_CHANNEL', [...defaultTypes]);
|
export const CREATE_CHANNEL = createRequestTypes('CREATE_CHANNEL', [...defaultTypes]);
|
||||||
export const CREATE_DISCUSSION = createRequestTypes('CREATE_DISCUSSION', [...defaultTypes]);
|
export const CREATE_DISCUSSION = createRequestTypes('CREATE_DISCUSSION', [...defaultTypes]);
|
||||||
|
|
|
@ -12,11 +12,7 @@ interface ISetMasterDetail extends Action {
|
||||||
isMasterDetail: boolean;
|
isMasterDetail: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ISetNotificationPresenceCap extends Action {
|
export type TActionApp = IAppStart & ISetMasterDetail;
|
||||||
show: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type TActionApp = IAppStart & ISetMasterDetail & ISetNotificationPresenceCap;
|
|
||||||
|
|
||||||
interface Params {
|
interface Params {
|
||||||
root: RootEnum;
|
root: RootEnum;
|
||||||
|
@ -55,10 +51,3 @@ export function setMasterDetail(isMasterDetail: boolean): ISetMasterDetail {
|
||||||
isMasterDetail
|
isMasterDetail
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setNotificationPresenceCap(show: boolean): ISetNotificationPresenceCap {
|
|
||||||
return {
|
|
||||||
type: APP.SET_NOTIFICATION_PRESENCE_CAP,
|
|
||||||
show
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ interface ILoginRequest extends Action {
|
||||||
credentials: any;
|
credentials: any;
|
||||||
logoutOnError?: boolean;
|
logoutOnError?: boolean;
|
||||||
isFromWebView?: boolean;
|
isFromWebView?: boolean;
|
||||||
registerCustomFields?: any;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ILoginSuccess extends Action {
|
interface ILoginSuccess extends Action {
|
||||||
|
@ -57,15 +56,13 @@ export type TActionsLogin = ILoginRequest &
|
||||||
export function loginRequest(
|
export function loginRequest(
|
||||||
credentials: Partial<ICredentials>,
|
credentials: Partial<ICredentials>,
|
||||||
logoutOnError?: boolean,
|
logoutOnError?: boolean,
|
||||||
isFromWebView?: boolean,
|
isFromWebView?: boolean
|
||||||
registerCustomFields?: any
|
|
||||||
): ILoginRequest {
|
): ILoginRequest {
|
||||||
return {
|
return {
|
||||||
type: types.LOGIN.REQUEST,
|
type: types.LOGIN.REQUEST,
|
||||||
credentials,
|
credentials,
|
||||||
logoutOnError,
|
logoutOnError,
|
||||||
isFromWebView,
|
isFromWebView
|
||||||
registerCustomFields
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Action } from 'redux';
|
import { Action } from 'redux';
|
||||||
|
|
||||||
import { ERoomType, RoomType } from '../definitions';
|
import { ERoomType } from '../definitions/ERoomType';
|
||||||
import { ROOM } from './actionsTypes';
|
import { ROOM } from './actionsTypes';
|
||||||
|
|
||||||
// TYPE RETURN RELATED
|
// TYPE RETURN RELATED
|
||||||
|
@ -44,24 +44,7 @@ interface IUserTyping extends Action {
|
||||||
status: boolean;
|
status: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IRoomHistoryRequest extends Action {
|
export type TActionsRoom = TSubscribeRoom & TUnsubscribeRoom & ILeaveRoom & IDeleteRoom & IForwardRoom & IUserTyping;
|
||||||
rid: string;
|
|
||||||
t: RoomType;
|
|
||||||
loaderId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IRoomHistoryFinished extends Action {
|
|
||||||
loaderId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type TActionsRoom = TSubscribeRoom &
|
|
||||||
TUnsubscribeRoom &
|
|
||||||
ILeaveRoom &
|
|
||||||
IDeleteRoom &
|
|
||||||
IForwardRoom &
|
|
||||||
IUserTyping &
|
|
||||||
IRoomHistoryRequest &
|
|
||||||
IRoomHistoryFinished;
|
|
||||||
|
|
||||||
export function subscribeRoom(rid: string): TSubscribeRoom {
|
export function subscribeRoom(rid: string): TSubscribeRoom {
|
||||||
return {
|
return {
|
||||||
|
@ -116,19 +99,3 @@ export function userTyping(rid: string, status = true): IUserTyping {
|
||||||
status
|
status
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function roomHistoryRequest({ rid, t, loaderId }: { rid: string; t: RoomType; loaderId: string }): IRoomHistoryRequest {
|
|
||||||
return {
|
|
||||||
type: ROOM.HISTORY_REQUEST,
|
|
||||||
rid,
|
|
||||||
t,
|
|
||||||
loaderId
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function roomHistoryFinished({ loaderId }: { loaderId: string }): IRoomHistoryFinished {
|
|
||||||
return {
|
|
||||||
type: ROOM.HISTORY_FINISHED,
|
|
||||||
loaderId
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
|
@ -18,10 +18,10 @@ const HANDLE_HEIGHT = isIOS ? 40 : 56;
|
||||||
const MIN_SNAP_HEIGHT = 16;
|
const MIN_SNAP_HEIGHT = 16;
|
||||||
const CANCEL_HEIGHT = 64;
|
const CANCEL_HEIGHT = 64;
|
||||||
|
|
||||||
export const ACTION_SHEET_ANIMATION_DURATION = 250;
|
const ANIMATION_DURATION = 250;
|
||||||
|
|
||||||
const ANIMATION_CONFIG = {
|
const ANIMATION_CONFIG = {
|
||||||
duration: ACTION_SHEET_ANIMATION_DURATION,
|
duration: ANIMATION_DURATION,
|
||||||
// https://easings.net/#easeInOutCubic
|
// https://easings.net/#easeInOutCubic
|
||||||
easing: Easing.bezier(0.645, 0.045, 0.355, 1.0)
|
easing: Easing.bezier(0.645, 0.045, 0.355, 1.0)
|
||||||
};
|
};
|
||||||
|
@ -140,7 +140,7 @@ const ActionSheet = React.memo(
|
||||||
style={{ ...styles.container, ...bottomSheet }}
|
style={{ ...styles.container, ...bottomSheet }}
|
||||||
backgroundStyle={{ backgroundColor: colors.focusedBackground }}
|
backgroundStyle={{ backgroundColor: colors.focusedBackground }}
|
||||||
onChange={index => index === -1 && onClose()}
|
onChange={index => index === -1 && onClose()}
|
||||||
// We need this to allow horizontal swipe gesture inside the bottom sheet like in reaction picker
|
// We need this to allow horizontal swipe gestures inside bottom sheet like in reaction picker
|
||||||
enableContentPanningGesture={data?.enableContentPanningGesture ?? true}
|
enableContentPanningGesture={data?.enableContentPanningGesture ?? true}
|
||||||
{...androidTablet}
|
{...androidTablet}
|
||||||
>
|
>
|
||||||
|
|
|
@ -122,6 +122,7 @@ const ActionSheetContentWithInputAndSubmit = ({
|
||||||
}}
|
}}
|
||||||
testID={testID}
|
testID={testID}
|
||||||
secureTextEntry={secureTextEntry}
|
secureTextEntry={secureTextEntry}
|
||||||
|
inputStyle={{ borderWidth: 2 }}
|
||||||
bottomSheet={isIOS}
|
bottomSheet={isIOS}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
|
@ -2,13 +2,13 @@ import { Text } from 'react-native';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { BottomSheetView, BottomSheetFlatList } from '@gorhom/bottom-sheet';
|
import { BottomSheetView, BottomSheetFlatList } from '@gorhom/bottom-sheet';
|
||||||
|
|
||||||
|
import { Button } from './Button';
|
||||||
import I18n from '../../i18n';
|
import I18n from '../../i18n';
|
||||||
import { useTheme } from '../../theme';
|
import { useTheme } from '../../theme';
|
||||||
import { IActionSheetItem, Item } from './Item';
|
import { IActionSheetItem, Item } from './Item';
|
||||||
import { TActionSheetOptionsItem } from './Provider';
|
import { TActionSheetOptionsItem } from './Provider';
|
||||||
import styles from './styles';
|
import styles from './styles';
|
||||||
import * as List from '../List';
|
import * as List from '../List';
|
||||||
import Touch from '../Touch';
|
|
||||||
|
|
||||||
interface IBottomSheetContentProps {
|
interface IBottomSheetContentProps {
|
||||||
hasCancel?: boolean;
|
hasCancel?: boolean;
|
||||||
|
@ -18,17 +18,19 @@ interface IBottomSheetContentProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
const BottomSheetContent = React.memo(({ options, hasCancel, hide, children }: IBottomSheetContentProps) => {
|
const BottomSheetContent = React.memo(({ options, hasCancel, hide, children }: IBottomSheetContentProps) => {
|
||||||
const { colors } = useTheme();
|
const { theme, colors } = useTheme();
|
||||||
|
|
||||||
const renderFooter = () =>
|
const renderFooter = () =>
|
||||||
hasCancel ? (
|
hasCancel ? (
|
||||||
<Touch
|
<Button
|
||||||
onPress={hide}
|
onPress={hide}
|
||||||
style={[styles.button, { backgroundColor: colors.auxiliaryBackground }]}
|
style={[styles.button, { backgroundColor: colors.auxiliaryBackground }]}
|
||||||
|
// TODO: Remove when migrate Touch
|
||||||
|
theme={theme}
|
||||||
accessibilityLabel={I18n.t('Cancel')}
|
accessibilityLabel={I18n.t('Cancel')}
|
||||||
>
|
>
|
||||||
<Text style={[styles.text, { color: colors.bodyText }]}>{I18n.t('Cancel')}</Text>
|
<Text style={[styles.text, { color: colors.bodyText }]}>{I18n.t('Cancel')}</Text>
|
||||||
</Touch>
|
</Button>
|
||||||
) : null;
|
) : null;
|
||||||
|
|
||||||
const renderItem = ({ item }: { item: IActionSheetItem['item'] }) => <Item item={item} hide={hide} />;
|
const renderItem = ({ item }: { item: IActionSheetItem['item'] }) => <Item item={item} hide={hide} />;
|
||||||
|
@ -52,11 +54,7 @@ const BottomSheetContent = React.memo(({ options, hasCancel, hide, children }: I
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (
|
return <BottomSheetView style={styles.contentContainer}>{children}</BottomSheetView>;
|
||||||
<BottomSheetView testID='action-sheet' style={styles.contentContainer}>
|
|
||||||
{children}
|
|
||||||
</BottomSheetView>
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default BottomSheetContent;
|
export default BottomSheetContent;
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
import React from 'react';
|
||||||
|
import { TouchableOpacity } from 'react-native';
|
||||||
|
|
||||||
|
import { isAndroid } from '../../lib/methods/helpers';
|
||||||
|
import Touch from '../../lib/methods/helpers/touch';
|
||||||
|
|
||||||
|
// Taken from https://github.com/rgommezz/react-native-scroll-bottom-sheet#touchables
|
||||||
|
export const Button: typeof React.Component = isAndroid ? Touch : TouchableOpacity;
|
|
@ -4,9 +4,9 @@ import { Text, View } from 'react-native';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import { CustomIcon } from '../CustomIcon';
|
import { CustomIcon } from '../CustomIcon';
|
||||||
import { useTheme } from '../../theme';
|
import { useTheme } from '../../theme';
|
||||||
|
import { Button } from './Button';
|
||||||
import { TActionSheetOptionsItem } from './Provider';
|
import { TActionSheetOptionsItem } from './Provider';
|
||||||
import styles from './styles';
|
import styles from './styles';
|
||||||
import Touch from '../Touch';
|
|
||||||
|
|
||||||
export interface IActionSheetItem {
|
export interface IActionSheetItem {
|
||||||
item: TActionSheetOptionsItem;
|
item: TActionSheetOptionsItem;
|
||||||
|
@ -21,7 +21,12 @@ export const Item = React.memo(({ item, hide }: IActionSheetItem) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Touch onPress={onPress} style={[styles.item, { backgroundColor: themes[theme].focusedBackground }]} testID={item.testID}>
|
<Button
|
||||||
|
onPress={onPress}
|
||||||
|
style={[styles.item, { backgroundColor: themes[theme].focusedBackground }]}
|
||||||
|
theme={theme}
|
||||||
|
testID={item.testID}
|
||||||
|
>
|
||||||
{item.icon ? (
|
{item.icon ? (
|
||||||
<CustomIcon name={item.icon} size={20} color={item.danger ? themes[theme].dangerColor : themes[theme].bodyText} />
|
<CustomIcon name={item.icon} size={20} color={item.danger ? themes[theme].dangerColor : themes[theme].bodyText} />
|
||||||
) : null}
|
) : null}
|
||||||
|
@ -37,6 +42,6 @@ export const Item = React.memo(({ item, hide }: IActionSheetItem) => {
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
{item.right ? <View style={styles.rightContainer}>{item.right ? item.right() : null}</View> : null}
|
{item.right ? <View style={styles.rightContainer}>{item.right ? item.right() : null}</View> : null}
|
||||||
</Touch>
|
</Button>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
export * from './Provider';
|
export * from './Provider';
|
||||||
export * from './ActionSheet';
|
export * from './Button';
|
||||||
|
|
|
@ -52,7 +52,7 @@ export default StyleSheet.create({
|
||||||
paddingHorizontal: 14,
|
paddingHorizontal: 14,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
height: ITEM_HEIGHT,
|
height: ITEM_HEIGHT,
|
||||||
borderRadius: 4,
|
borderRadius: 2,
|
||||||
marginBottom: 12
|
marginBottom: 12
|
||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
|
|
|
@ -1,69 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import { StyleSheet } from 'react-native';
|
|
||||||
|
|
||||||
import Status from '../Status/Status';
|
|
||||||
import sharedStyles from '../../views/Styles';
|
|
||||||
import Avatar from './Avatar';
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
custom: {
|
|
||||||
padding: 16
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const server = 'https://open.rocket.chat';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
title: 'Avatar'
|
|
||||||
};
|
|
||||||
|
|
||||||
export const AvatarText = () => <Avatar text='Avatar' server={server} size={56} />;
|
|
||||||
|
|
||||||
export const AvatarRoomId = () => <Avatar type='p' rid='devWBbYr7inwupPqK' server={server} size={56} />;
|
|
||||||
|
|
||||||
export const AvatarUrl = () => (
|
|
||||||
<Avatar
|
|
||||||
avatar='https://user-images.githubusercontent.com/29778115/89444446-14738480-d728-11ea-9412-75fd978d95fb.jpg'
|
|
||||||
server={server}
|
|
||||||
size={56}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
|
|
||||||
export const AvatarPath = () => <Avatar avatar='/avatar/diego.mello' server={server} size={56} />;
|
|
||||||
|
|
||||||
export const WithETag = () => (
|
|
||||||
<Avatar type='d' text='djorkaeff.alexandre' avatarETag='5ag8KffJcZj9m5rCv' server={server} size={56} />
|
|
||||||
);
|
|
||||||
|
|
||||||
export const WithoutETag = () => <Avatar type='d' text='djorkaeff.alexandre' server={server} size={56} />;
|
|
||||||
|
|
||||||
export const Emoji = () => (
|
|
||||||
<Avatar emoji='troll' getCustomEmoji={() => ({ name: 'troll', extension: 'jpg' })} server={server} size={56} />
|
|
||||||
);
|
|
||||||
|
|
||||||
export const Direct = () => <Avatar text='diego.mello' server={server} type='d' size={56} />;
|
|
||||||
|
|
||||||
export const Channel = () => <Avatar text='general' server={server} type='c' size={56} />;
|
|
||||||
|
|
||||||
export const Touchable = () => <Avatar text='Avatar' server={server} onPress={() => console.log('Pressed!')} size={56} />;
|
|
||||||
|
|
||||||
export const Static = () => (
|
|
||||||
<Avatar
|
|
||||||
avatar='https://user-images.githubusercontent.com/29778115/89444446-14738480-d728-11ea-9412-75fd978d95fb.jpg'
|
|
||||||
server={server}
|
|
||||||
isStatic
|
|
||||||
size={56}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
|
|
||||||
export const CustomBorderRadius = () => <Avatar text='Avatar' server={server} borderRadius={28} size={56} />;
|
|
||||||
|
|
||||||
export const Children = () => (
|
|
||||||
<Avatar text='Avatar' server={server} size={56}>
|
|
||||||
<Status size={24} style={[sharedStyles.status]} status='busy' />
|
|
||||||
</Avatar>
|
|
||||||
);
|
|
||||||
|
|
||||||
export const WrongServer = () => <Avatar text='Avatar' server='https://google.com' size={56} />;
|
|
||||||
|
|
||||||
export const CustomStyle = () => <Avatar text='Avatar' server={server} size={56} style={styles.custom} />;
|
|
|
@ -43,7 +43,9 @@ const Avatar = React.memo(
|
||||||
|
|
||||||
let image;
|
let image;
|
||||||
if (emoji) {
|
if (emoji) {
|
||||||
image = <Emoji getCustomEmoji={getCustomEmoji} isMessageContainsOnlyEmoji literal={emoji} style={avatarStyle} />;
|
image = (
|
||||||
|
<Emoji baseUrl={server} getCustomEmoji={getCustomEmoji} isMessageContainsOnlyEmoji literal={emoji} style={avatarStyle} />
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
let uri = avatar;
|
let uri = avatar;
|
||||||
if (!isStatic) {
|
if (!isStatic) {
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { ViewStyle } from 'react-native';
|
|
||||||
|
|
||||||
import { TGetCustomEmoji } from '../../definitions/IEmoji';
|
import { TGetCustomEmoji } from '../../definitions/IEmoji';
|
||||||
|
|
||||||
export interface IAvatar {
|
export interface IAvatar {
|
||||||
server?: string;
|
server?: string;
|
||||||
style?: ViewStyle;
|
style?: any;
|
||||||
text?: string;
|
text?: string;
|
||||||
avatar?: string;
|
avatar?: string;
|
||||||
emoji?: string;
|
emoji?: string;
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`Storyshots BackgroundContainer basic 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessibilityIgnoresInvertColors\\":true,\\"style\\":{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\",\\"position\\":\\"absolute\\"}},\\"children\\":[{\\"type\\":\\"Image\\",\\"props\\":{\\"source\\":{\\"uri\\":\\"message_empty_light\\"},\\"style\\":[{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\"},null]},\\"children\\":null}]}]}"`;
|
||||||
|
|
||||||
|
exports[`Storyshots BackgroundContainer black theme - loading 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessibilityIgnoresInvertColors\\":true,\\"style\\":{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\",\\"position\\":\\"absolute\\"}},\\"children\\":[{\\"type\\":\\"Image\\",\\"props\\":{\\"source\\":{\\"uri\\":\\"message_empty_black\\"},\\"style\\":[{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\"},null]},\\"children\\":null}]},{\\"type\\":\\"ActivityIndicator\\",\\"props\\":{\\"style\\":{\\"position\\":\\"absolute\\",\\"top\\":60,\\"left\\":0,\\"right\\":0,\\"fontSize\\":16,\\"paddingHorizontal\\":24,\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"System\\",\\"fontWeight\\":\\"400\\"},\\"color\\":\\"#f9f9f9\\"},\\"children\\":null}]}"`;
|
||||||
|
|
||||||
|
exports[`Storyshots BackgroundContainer black theme - text 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessibilityIgnoresInvertColors\\":true,\\"style\\":{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\",\\"position\\":\\"absolute\\"}},\\"children\\":[{\\"type\\":\\"Image\\",\\"props\\":{\\"source\\":{\\"uri\\":\\"message_empty_black\\"},\\"style\\":[{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\"},null]},\\"children\\":null}]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"position\\":\\"absolute\\",\\"top\\":60,\\"left\\":0,\\"right\\":0,\\"fontSize\\":16,\\"paddingHorizontal\\":24,\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"System\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#f9f9f9\\"}]},\\"children\\":[\\"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries\\"]}]}"`;
|
||||||
|
|
||||||
|
exports[`Storyshots BackgroundContainer dark theme - loading 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessibilityIgnoresInvertColors\\":true,\\"style\\":{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\",\\"position\\":\\"absolute\\"}},\\"children\\":[{\\"type\\":\\"Image\\",\\"props\\":{\\"source\\":{\\"uri\\":\\"message_empty_dark\\"},\\"style\\":[{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\"},null]},\\"children\\":null}]},{\\"type\\":\\"ActivityIndicator\\",\\"props\\":{\\"style\\":{\\"position\\":\\"absolute\\",\\"top\\":60,\\"left\\":0,\\"right\\":0,\\"fontSize\\":16,\\"paddingHorizontal\\":24,\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"System\\",\\"fontWeight\\":\\"400\\"},\\"color\\":\\"#f9f9f9\\"},\\"children\\":null}]}"`;
|
||||||
|
|
||||||
|
exports[`Storyshots BackgroundContainer dark theme - text 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessibilityIgnoresInvertColors\\":true,\\"style\\":{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\",\\"position\\":\\"absolute\\"}},\\"children\\":[{\\"type\\":\\"Image\\",\\"props\\":{\\"source\\":{\\"uri\\":\\"message_empty_dark\\"},\\"style\\":[{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\"},null]},\\"children\\":null}]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"position\\":\\"absolute\\",\\"top\\":60,\\"left\\":0,\\"right\\":0,\\"fontSize\\":16,\\"paddingHorizontal\\":24,\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"System\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#f9f9f9\\"}]},\\"children\\":[\\"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries\\"]}]}"`;
|
||||||
|
|
||||||
|
exports[`Storyshots BackgroundContainer loading 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessibilityIgnoresInvertColors\\":true,\\"style\\":{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\",\\"position\\":\\"absolute\\"}},\\"children\\":[{\\"type\\":\\"Image\\",\\"props\\":{\\"source\\":{\\"uri\\":\\"message_empty_light\\"},\\"style\\":[{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\"},null]},\\"children\\":null}]},{\\"type\\":\\"ActivityIndicator\\",\\"props\\":{\\"style\\":{\\"position\\":\\"absolute\\",\\"top\\":60,\\"left\\":0,\\"right\\":0,\\"fontSize\\":16,\\"paddingHorizontal\\":24,\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"System\\",\\"fontWeight\\":\\"400\\"},\\"color\\":\\"#6C727A\\"},\\"children\\":null}]}"`;
|
||||||
|
|
||||||
|
exports[`Storyshots BackgroundContainer long text 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessibilityIgnoresInvertColors\\":true,\\"style\\":{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\",\\"position\\":\\"absolute\\"}},\\"children\\":[{\\"type\\":\\"Image\\",\\"props\\":{\\"source\\":{\\"uri\\":\\"message_empty_light\\"},\\"style\\":[{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\"},null]},\\"children\\":null}]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"position\\":\\"absolute\\",\\"top\\":60,\\"left\\":0,\\"right\\":0,\\"fontSize\\":16,\\"paddingHorizontal\\":24,\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"System\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#6C727A\\"}]},\\"children\\":[\\"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries\\"]}]}"`;
|
||||||
|
|
||||||
|
exports[`Storyshots BackgroundContainer text 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"style\\":{\\"flex\\":1}},\\"children\\":[{\\"type\\":\\"View\\",\\"props\\":{\\"accessibilityIgnoresInvertColors\\":true,\\"style\\":{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\",\\"position\\":\\"absolute\\"}},\\"children\\":[{\\"type\\":\\"Image\\",\\"props\\":{\\"source\\":{\\"uri\\":\\"message_empty_light\\"},\\"style\\":[{\\"position\\":\\"absolute\\",\\"left\\":0,\\"right\\":0,\\"top\\":0,\\"bottom\\":0},{\\"width\\":\\"100%\\",\\"height\\":\\"100%\\"},null]},\\"children\\":null}]},{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"position\\":\\"absolute\\",\\"top\\":60,\\"left\\":0,\\"right\\":0,\\"fontSize\\":16,\\"paddingHorizontal\\":24,\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"System\\",\\"fontWeight\\":\\"400\\"},{\\"color\\":\\"#6C727A\\"}]},\\"children\\":[\\"Text here\\"]}]}"`;
|
|
@ -0,0 +1,31 @@
|
||||||
|
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved, import/extensions, react/prop-types */
|
||||||
|
import React from 'react';
|
||||||
|
import { storiesOf } from '@storybook/react-native';
|
||||||
|
|
||||||
|
import { ThemeContext } from '../../theme';
|
||||||
|
import { longText } from '../../../storybook/utils';
|
||||||
|
import BackgroundContainer from '.';
|
||||||
|
|
||||||
|
const stories = storiesOf('BackgroundContainer', module);
|
||||||
|
|
||||||
|
stories.add('basic', () => <BackgroundContainer />);
|
||||||
|
|
||||||
|
stories.add('loading', () => <BackgroundContainer loading />);
|
||||||
|
|
||||||
|
stories.add('text', () => <BackgroundContainer text='Text here' />);
|
||||||
|
|
||||||
|
stories.add('long text', () => <BackgroundContainer text={longText} />);
|
||||||
|
|
||||||
|
const ThemeStory = ({ theme, ...props }) => (
|
||||||
|
<ThemeContext.Provider value={{ theme }}>
|
||||||
|
<BackgroundContainer {...props} />
|
||||||
|
</ThemeContext.Provider>
|
||||||
|
);
|
||||||
|
|
||||||
|
stories.add('dark theme - loading', () => <ThemeStory theme='dark' loading />);
|
||||||
|
|
||||||
|
stories.add('dark theme - text', () => <ThemeStory theme='dark' text={longText} />);
|
||||||
|
|
||||||
|
stories.add('black theme - loading', () => <ThemeStory theme='black' loading />);
|
||||||
|
|
||||||
|
stories.add('black theme - text', () => <ThemeStory theme='black' text={longText} />);
|
|
@ -1,36 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
import { ThemeContext, TSupportedThemes } from '../../theme';
|
|
||||||
import { longText } from '../../../.storybook/utils';
|
|
||||||
import BackgroundContainer, { IBackgroundContainer } from '.';
|
|
||||||
import { themes } from '../../lib/constants';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
title: 'BackgroundContainer'
|
|
||||||
};
|
|
||||||
|
|
||||||
export const Basic = () => <BackgroundContainer />;
|
|
||||||
|
|
||||||
export const Loading = () => <BackgroundContainer loading />;
|
|
||||||
|
|
||||||
export const Text = () => <BackgroundContainer text='Text here' />;
|
|
||||||
|
|
||||||
export const LongText = () => <BackgroundContainer text={longText} />;
|
|
||||||
|
|
||||||
interface ThemeStoryProps extends IBackgroundContainer {
|
|
||||||
theme: TSupportedThemes;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ThemeStory = ({ theme, ...props }: ThemeStoryProps) => (
|
|
||||||
<ThemeContext.Provider value={{ theme, colors: themes[theme] }}>
|
|
||||||
<BackgroundContainer {...props} />
|
|
||||||
</ThemeContext.Provider>
|
|
||||||
);
|
|
||||||
|
|
||||||
export const DarkThemeLoading = () => <ThemeStory theme='dark' loading />;
|
|
||||||
|
|
||||||
export const DarkThemeText = () => <ThemeStory theme='dark' text={longText} />;
|
|
||||||
|
|
||||||
export const BlackThemeLoading = () => <ThemeStory theme='black' loading />;
|
|
||||||
|
|
||||||
export const BlackThemeText = () => <ThemeStory theme='black' text={longText} />;
|
|
|
@ -5,7 +5,7 @@ import { useTheme } from '../../theme';
|
||||||
import sharedStyles from '../../views/Styles';
|
import sharedStyles from '../../views/Styles';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
|
|
||||||
export interface IBackgroundContainer {
|
interface IBackgroundContainer {
|
||||||
text?: string;
|
text?: string;
|
||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
import React from 'react';
|
||||||
|
import { storiesOf } from '@storybook/react-native';
|
||||||
|
|
||||||
|
import Button from '.';
|
||||||
|
|
||||||
|
const buttonProps = {
|
||||||
|
title: 'Press me!',
|
||||||
|
type: 'primary',
|
||||||
|
onPress: () => {},
|
||||||
|
testID: 'testButton',
|
||||||
|
fontSize: 16,
|
||||||
|
style: {
|
||||||
|
padding: 10,
|
||||||
|
justifyContent: 'center'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const stories = storiesOf('Button', module);
|
||||||
|
|
||||||
|
stories.add('primary button', () => <Button {...buttonProps} />);
|
||||||
|
|
||||||
|
stories.add('secondary button', () => <Button {...buttonProps} type='secondary' />);
|
||||||
|
|
||||||
|
stories.add('loading button', () => <Button loading {...buttonProps} />);
|
||||||
|
|
||||||
|
stories.add('disabled button', () => <Button disabled {...buttonProps} />);
|
||||||
|
|
||||||
|
stories.add('disabled loading button', () => <Button disabled loading {...buttonProps} />);
|
|
@ -1,41 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
import Button from '.';
|
|
||||||
|
|
||||||
const buttonProps = {
|
|
||||||
title: 'Press me!',
|
|
||||||
type: 'primary',
|
|
||||||
onPress: () => {},
|
|
||||||
testID: 'testButton'
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
|
||||||
title: 'Button'
|
|
||||||
};
|
|
||||||
|
|
||||||
export const PrimaryButton = () => <Button {...buttonProps} />;
|
|
||||||
|
|
||||||
export const SecondaryButton = () => <Button {...buttonProps} type='secondary' />;
|
|
||||||
|
|
||||||
export const LoadingButton = () => <Button loading {...buttonProps} />;
|
|
||||||
|
|
||||||
export const DisabledButton = () => <Button disabled {...buttonProps} />;
|
|
||||||
|
|
||||||
export const DisabledLoadingButton = () => <Button disabled loading {...buttonProps} />;
|
|
||||||
|
|
||||||
export const CustomButton = () => (
|
|
||||||
<Button
|
|
||||||
{...buttonProps}
|
|
||||||
fontSize={18}
|
|
||||||
backgroundColor='purple'
|
|
||||||
color='yellow'
|
|
||||||
style={{
|
|
||||||
padding: 10
|
|
||||||
}}
|
|
||||||
styleText={[
|
|
||||||
{
|
|
||||||
textAlign: 'left'
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
);
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`Storyshots Button disabled button 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"Press me!\\",\\"accessibilityState\\":{\\"disabled\\":true},\\"testID\\":\\"testButton\\",\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"paddingHorizontal\\":14,\\"justifyContent\\":\\"center\\",\\"height\\":48,\\"borderRadius\\":2,\\"marginBottom\\":12,\\"backgroundColor\\":\\"#1d74f5\\",\\"opacity\\":0.3,\\"padding\\":10}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"System\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"#ffffff\\",\\"fontSize\\":16},null],\\"accessibilityLabel\\":\\"Press me!\\"},\\"children\\":[\\"Press me!\\"]}]}"`;
|
||||||
|
|
||||||
|
exports[`Storyshots Button disabled loading button 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"Press me!\\",\\"accessibilityState\\":{\\"disabled\\":true},\\"testID\\":\\"testButton\\",\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"paddingHorizontal\\":14,\\"justifyContent\\":\\"center\\",\\"height\\":48,\\"borderRadius\\":2,\\"marginBottom\\":12,\\"backgroundColor\\":\\"#1d74f5\\",\\"opacity\\":0.3,\\"padding\\":10}},\\"children\\":[{\\"type\\":\\"ActivityIndicator\\",\\"props\\":{\\"style\\":[{\\"padding\\":16,\\"flex\\":1},null],\\"color\\":\\"#ffffff\\"},\\"children\\":null}]}"`;
|
||||||
|
|
||||||
|
exports[`Storyshots Button loading button 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"Press me!\\",\\"accessibilityState\\":{\\"disabled\\":true},\\"testID\\":\\"testButton\\",\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"paddingHorizontal\\":14,\\"justifyContent\\":\\"center\\",\\"height\\":48,\\"borderRadius\\":2,\\"marginBottom\\":12,\\"backgroundColor\\":\\"#1d74f5\\",\\"padding\\":10,\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"ActivityIndicator\\",\\"props\\":{\\"style\\":[{\\"padding\\":16,\\"flex\\":1},null],\\"color\\":\\"#ffffff\\"},\\"children\\":null}]}"`;
|
||||||
|
|
||||||
|
exports[`Storyshots Button primary button 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"Press me!\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"testButton\\",\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"paddingHorizontal\\":14,\\"justifyContent\\":\\"center\\",\\"height\\":48,\\"borderRadius\\":2,\\"marginBottom\\":12,\\"backgroundColor\\":\\"#1d74f5\\",\\"padding\\":10,\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"System\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"#ffffff\\",\\"fontSize\\":16},null],\\"accessibilityLabel\\":\\"Press me!\\"},\\"children\\":[\\"Press me!\\"]}]}"`;
|
||||||
|
|
||||||
|
exports[`Storyshots Button secondary button 1`] = `"{\\"type\\":\\"View\\",\\"props\\":{\\"accessible\\":true,\\"accessibilityLabel\\":\\"Press me!\\",\\"accessibilityState\\":{\\"disabled\\":false},\\"testID\\":\\"testButton\\",\\"focusable\\":true,\\"collapsable\\":false,\\"style\\":{\\"paddingHorizontal\\":14,\\"justifyContent\\":\\"center\\",\\"height\\":48,\\"borderRadius\\":2,\\"marginBottom\\":12,\\"backgroundColor\\":\\"#ffffff\\",\\"padding\\":10,\\"opacity\\":1}},\\"children\\":[{\\"type\\":\\"Text\\",\\"props\\":{\\"style\\":[{\\"textAlign\\":\\"center\\",\\"backgroundColor\\":\\"transparent\\",\\"fontFamily\\":\\"System\\",\\"fontWeight\\":\\"500\\"},{\\"color\\":\\"#2f343d\\",\\"fontSize\\":16},null],\\"accessibilityLabel\\":\\"Press me!\\"},\\"children\\":[\\"Press me!\\"]}]}"`;
|
|
@ -22,7 +22,7 @@ const styles = StyleSheet.create({
|
||||||
paddingHorizontal: 14,
|
paddingHorizontal: 14,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
height: 48,
|
height: 48,
|
||||||
borderRadius: 4,
|
borderRadius: 2,
|
||||||
marginBottom: 12
|
marginBottom: 12
|
||||||
},
|
},
|
||||||
text: {
|
text: {
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import { StyleSheet, View } from 'react-native';
|
|
||||||
|
|
||||||
import Chip, { IChip } from './index';
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
container: {
|
|
||||||
flex: 1,
|
|
||||||
alignItems: 'flex-start',
|
|
||||||
padding: 16
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default {
|
|
||||||
title: 'Chip'
|
|
||||||
};
|
|
||||||
|
|
||||||
const ChipWrapped = ({ avatar, text, onPress, testID, style }: IChip) => (
|
|
||||||
<View style={styles.container}>
|
|
||||||
<Chip avatar={avatar} text={text} onPress={onPress} testID={testID} style={style} />
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
|
|
||||||
export const ChipText = () => <ChipWrapped avatar='rocket.cat' text={'Rocket.Cat'} onPress={() => {}} />;
|
|
||||||
|
|
||||||
export const ChipWithShortText = () => <ChipWrapped avatar='rocket.cat' text={'Short'} onPress={() => {}} />;
|
|
||||||
|
|
||||||
export const ChipWithoutAvatar = () => <ChipWrapped text={'Without Avatar'} onPress={() => {}} />;
|
|
||||||
|
|
||||||
export const ChipWithoutIcon = () => <ChipWrapped avatar='rocket.cat' text='Without Icon' />;
|
|
||||||
|
|
||||||
export const ChipWithoutAvatarAndIcon = () => <ChipWrapped text='Without Avatar and Icon' />;
|
|
|
@ -1,58 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import { fireEvent, render } from '@testing-library/react-native';
|
|
||||||
import { Provider } from 'react-redux';
|
|
||||||
|
|
||||||
import Chip, { IChip } from '.';
|
|
||||||
import { ISelectedUser } from '../../reducers/selectedUsers';
|
|
||||||
import { mockedStore as store } from '../../reducers/mockedStore';
|
|
||||||
|
|
||||||
const onPressMock = jest.fn((item: any) => item);
|
|
||||||
|
|
||||||
const testChip = {
|
|
||||||
testID: 'test-chip-id',
|
|
||||||
item: { fname: 'rocket.chat', name: 'rocket.chat' } as ISelectedUser,
|
|
||||||
onPress: onPressMock
|
|
||||||
};
|
|
||||||
|
|
||||||
const Render = ({ testID, text, avatar, onPress }: IChip) => (
|
|
||||||
<Provider store={store}>
|
|
||||||
<Chip testID={testID} text={text} onPress={onPress} avatar={avatar} />
|
|
||||||
</Provider>
|
|
||||||
);
|
|
||||||
|
|
||||||
describe('Chips', () => {
|
|
||||||
it('should render the Chip component', () => {
|
|
||||||
const { findByTestId } = render(
|
|
||||||
<Render
|
|
||||||
text={testChip.item.fname}
|
|
||||||
avatar={testChip.item.name}
|
|
||||||
testID={testChip.testID}
|
|
||||||
onPress={() => testChip.onPress(testChip.item)}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(findByTestId(testChip.testID)).toBeTruthy();
|
|
||||||
});
|
|
||||||
it("should not call onPress if it's not passed", async () => {
|
|
||||||
const { findByTestId } = render(<Render text={testChip.item.fname} avatar={testChip.item.name} testID={testChip.testID} />);
|
|
||||||
|
|
||||||
const component = await findByTestId(testChip.testID);
|
|
||||||
fireEvent.press(component);
|
|
||||||
expect(onPressMock).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
it('should tap Chip and return item', async () => {
|
|
||||||
const { findByTestId } = render(
|
|
||||||
<Render
|
|
||||||
text={testChip.item.fname}
|
|
||||||
avatar={testChip.item.name}
|
|
||||||
testID={testChip.testID}
|
|
||||||
onPress={() => testChip.onPress(testChip.item)}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
|
|
||||||
const component = await findByTestId(testChip.testID);
|
|
||||||
fireEvent.press(component);
|
|
||||||
expect(onPressMock).toHaveBeenCalled();
|
|
||||||
expect(onPressMock).toHaveReturnedWith(testChip.item);
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,75 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import { Pressable, StyleSheet, View, Text, StyleProp, ViewStyle } from 'react-native';
|
|
||||||
|
|
||||||
import { useTheme } from '../../theme';
|
|
||||||
import { CustomIcon } from '../CustomIcon';
|
|
||||||
import sharedStyles from '../../views/Styles';
|
|
||||||
import Avatar from '../Avatar';
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
pressable: {
|
|
||||||
paddingHorizontal: 8,
|
|
||||||
marginRight: 8,
|
|
||||||
borderRadius: 4,
|
|
||||||
justifyContent: 'center',
|
|
||||||
maxWidth: 192
|
|
||||||
},
|
|
||||||
container: {
|
|
||||||
flexDirection: 'row',
|
|
||||||
alignItems: 'center'
|
|
||||||
},
|
|
||||||
avatar: {
|
|
||||||
marginRight: 8,
|
|
||||||
marginVertical: 8
|
|
||||||
},
|
|
||||||
textContainer: {
|
|
||||||
marginRight: 8,
|
|
||||||
maxWidth: 120
|
|
||||||
},
|
|
||||||
name: {
|
|
||||||
fontSize: 16,
|
|
||||||
...sharedStyles.textMedium
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export interface IChip {
|
|
||||||
avatar?: string;
|
|
||||||
text: string;
|
|
||||||
onPress?: Function;
|
|
||||||
testID?: string;
|
|
||||||
style?: StyleProp<ViewStyle>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Chip = ({ avatar, text, onPress, testID, style }: IChip) => {
|
|
||||||
const { colors } = useTheme();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Pressable
|
|
||||||
testID={testID}
|
|
||||||
style={({ pressed }) => [
|
|
||||||
styles.pressable,
|
|
||||||
{
|
|
||||||
backgroundColor: pressed ? colors.bannerBackground : colors.auxiliaryBackground
|
|
||||||
},
|
|
||||||
style
|
|
||||||
]}
|
|
||||||
disabled={!onPress}
|
|
||||||
onPress={() => onPress?.()}
|
|
||||||
android_ripple={{
|
|
||||||
color: colors.bannerBackground
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<View style={styles.container}>
|
|
||||||
{avatar ? <Avatar text={avatar} size={28} style={styles.avatar} /> : null}
|
|
||||||
<View style={styles.textContainer}>
|
|
||||||
<Text style={[styles.name, { color: colors.bodyText }]} numberOfLines={1}>
|
|
||||||
{text}
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
{onPress ? <CustomIcon name='close' size={16} color={colors.auxiliaryTintColor} /> : null}
|
|
||||||
</View>
|
|
||||||
</Pressable>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Chip;
|
|
|
@ -1,10 +1,7 @@
|
||||||
export const mappedIcons = {
|
export const mappedIcons = {
|
||||||
'status-disabled': 59837,
|
'lamp-bulb': 59812,
|
||||||
'lamp-bulb': 59836,
|
|
||||||
'phone-in': 59835,
|
|
||||||
'basketball': 59776,
|
'basketball': 59776,
|
||||||
'percentage': 59777,
|
'percentage': 59777,
|
||||||
'glasses': 59812,
|
|
||||||
'burger': 59813,
|
'burger': 59813,
|
||||||
'leaf': 59814,
|
'leaf': 59814,
|
||||||
'airplane': 59815,
|
'airplane': 59815,
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Text, View, ViewStyle } from 'react-native';
|
import { Text, View, ViewStyle } from 'react-native';
|
||||||
|
|
||||||
import Touch from '../Touch';
|
import Touch from '../../lib/methods/helpers/touch';
|
||||||
import Avatar from '../Avatar';
|
import Avatar from '../Avatar';
|
||||||
import RoomTypeIcon from '../RoomTypeIcon';
|
import RoomTypeIcon from '../RoomTypeIcon';
|
||||||
import styles, { ROW_HEIGHT } from './styles';
|
import styles, { ROW_HEIGHT } from './styles';
|
||||||
|
@ -49,7 +49,7 @@ const DirectoryItem = ({
|
||||||
}: IDirectoryItem): React.ReactElement => {
|
}: IDirectoryItem): React.ReactElement => {
|
||||||
const { theme } = useTheme();
|
const { theme } = useTheme();
|
||||||
return (
|
return (
|
||||||
<Touch onPress={onPress} style={{ backgroundColor: themes[theme].backgroundColor }} testID={testID}>
|
<Touch onPress={onPress} style={{ backgroundColor: themes[theme].backgroundColor }} testID={testID} theme={theme}>
|
||||||
<View style={[styles.directoryItemContainer, styles.directoryItemButton, style]}>
|
<View style={[styles.directoryItemContainer, styles.directoryItemButton, style]}>
|
||||||
<Avatar text={avatar} size={30} type={type} rid={rid} style={styles.directoryItemAvatar} />
|
<Avatar text={avatar} size={30} type={type} rid={rid} style={styles.directoryItemAvatar} />
|
||||||
<View style={styles.directoryItemTextContainer}>
|
<View style={styles.directoryItemTextContainer}>
|
||||||
|
|
|
@ -1,30 +1,24 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { StyleProp } from 'react-native';
|
import FastImage from 'react-native-fast-image';
|
||||||
import FastImage, { ImageStyle } from 'react-native-fast-image';
|
|
||||||
|
|
||||||
import { useAppSelector } from '../../lib/hooks';
|
import { ICustomEmoji } from '../../definitions/IEmoji';
|
||||||
import { ICustomEmoji } from '../../definitions';
|
|
||||||
|
|
||||||
interface ICustomEmojiProps {
|
|
||||||
emoji: ICustomEmoji;
|
|
||||||
style: StyleProp<ImageStyle>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const CustomEmoji = React.memo(
|
const CustomEmoji = React.memo(
|
||||||
({ emoji, style }: ICustomEmojiProps) => {
|
({ baseUrl, emoji, style }: ICustomEmoji) => (
|
||||||
const baseUrl = useAppSelector(state => state.share.server.server || state.server.server);
|
<FastImage
|
||||||
return (
|
style={style}
|
||||||
<FastImage
|
source={{
|
||||||
style={style}
|
uri: `${baseUrl}/emoji-custom/${encodeURIComponent(emoji.content || emoji.name)}.${emoji.extension}`,
|
||||||
source={{
|
priority: FastImage.priority.high
|
||||||
uri: `${baseUrl}/emoji-custom/${encodeURIComponent(emoji.name)}.${emoji.extension}`,
|
}}
|
||||||
priority: FastImage.priority.high
|
resizeMode={FastImage.resizeMode.contain}
|
||||||
}}
|
/>
|
||||||
resizeMode={FastImage.resizeMode.contain}
|
),
|
||||||
/>
|
(prevProps, nextProps) => {
|
||||||
);
|
const prevEmoji = prevProps.emoji.content || prevProps.emoji.name;
|
||||||
},
|
const nextEmoji = nextProps.emoji.content || nextProps.emoji.name;
|
||||||
() => true
|
return prevEmoji === nextEmoji;
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
export default CustomEmoji;
|
export default CustomEmoji;
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import { Text } from 'react-native';
|
|
||||||
|
|
||||||
import shortnameToUnicode from '../../lib/methods/helpers/shortnameToUnicode';
|
|
||||||
import styles from './styles';
|
|
||||||
import CustomEmoji from './CustomEmoji';
|
|
||||||
import { IEmoji } from '../../definitions/IEmoji';
|
|
||||||
|
|
||||||
interface IEmojiProps {
|
|
||||||
emoji: IEmoji;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const Emoji = ({ emoji }: IEmojiProps): React.ReactElement => {
|
|
||||||
if (typeof emoji === 'string') {
|
|
||||||
return <Text style={styles.categoryEmoji}>{shortnameToUnicode(`:${emoji}:`)}</Text>;
|
|
||||||
}
|
|
||||||
return <CustomEmoji style={styles.customCategoryEmoji} emoji={emoji} />;
|
|
||||||
};
|
|
|
@ -1,42 +1,75 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FlatList } from 'react-native-gesture-handler';
|
import { FlatList, Text, TouchableOpacity } from 'react-native';
|
||||||
|
|
||||||
import { IEmoji } from '../../definitions/IEmoji';
|
import shortnameToUnicode from '../../lib/methods/helpers/shortnameToUnicode';
|
||||||
|
import styles from './styles';
|
||||||
|
import CustomEmoji from './CustomEmoji';
|
||||||
import scrollPersistTaps from '../../lib/methods/helpers/scrollPersistTaps';
|
import scrollPersistTaps from '../../lib/methods/helpers/scrollPersistTaps';
|
||||||
import { PressableEmoji } from './PressableEmoji';
|
import { IEmoji, IEmojiCategory } from '../../definitions/IEmoji';
|
||||||
import { EMOJI_BUTTON_SIZE } from './styles';
|
|
||||||
|
|
||||||
interface IEmojiCategoryProps {
|
const EMOJI_SIZE = 50;
|
||||||
emojis: IEmoji[];
|
|
||||||
onEmojiSelected: (emoji: IEmoji) => void;
|
|
||||||
tabLabel?: string; // needed for react-native-scrollable-tab-view only
|
|
||||||
parentWidth: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
const EmojiCategory = ({ onEmojiSelected, emojis, parentWidth }: IEmojiCategoryProps): React.ReactElement | null => {
|
const renderEmoji = (emoji: IEmoji, size: number, baseUrl: string) => {
|
||||||
if (!parentWidth) {
|
if (emoji && emoji.isCustom) {
|
||||||
return null;
|
return (
|
||||||
|
<CustomEmoji
|
||||||
|
style={[styles.customCategoryEmoji, { height: size - 16, width: size - 16 }]}
|
||||||
|
emoji={emoji}
|
||||||
|
baseUrl={baseUrl}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const numColumns = Math.trunc(parentWidth / EMOJI_BUTTON_SIZE);
|
|
||||||
const marginHorizontal = (parentWidth % EMOJI_BUTTON_SIZE) / 2;
|
|
||||||
|
|
||||||
const renderItem = ({ item }: { item: IEmoji }) => <PressableEmoji emoji={item} onPress={onEmojiSelected} />;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FlatList
|
<Text style={[styles.categoryEmoji, { height: size, width: size, fontSize: size - 14 }]}>
|
||||||
key={`emoji-category-${parentWidth}`}
|
{shortnameToUnicode(`:${emoji}:`)}
|
||||||
keyExtractor={item => (typeof item === 'string' ? item : item.name)}
|
</Text>
|
||||||
data={emojis}
|
|
||||||
renderItem={renderItem}
|
|
||||||
numColumns={numColumns}
|
|
||||||
initialNumToRender={45}
|
|
||||||
removeClippedSubviews
|
|
||||||
contentContainerStyle={{ marginHorizontal }}
|
|
||||||
{...scrollPersistTaps}
|
|
||||||
keyboardDismissMode={'none'}
|
|
||||||
/>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class EmojiCategory extends React.Component<IEmojiCategory> {
|
||||||
|
renderItem(emoji: IEmoji) {
|
||||||
|
const { baseUrl, onEmojiSelected } = this.props;
|
||||||
|
return (
|
||||||
|
<TouchableOpacity
|
||||||
|
activeOpacity={0.7}
|
||||||
|
// @ts-ignore
|
||||||
|
key={emoji && emoji.isCustom ? emoji.content : emoji}
|
||||||
|
onPress={() => onEmojiSelected(emoji)}
|
||||||
|
testID={`reaction-picker-${emoji && emoji.isCustom ? emoji.content : emoji}`}
|
||||||
|
>
|
||||||
|
{renderEmoji(emoji, EMOJI_SIZE, baseUrl)}
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { emojis, width } = this.props;
|
||||||
|
|
||||||
|
if (!width) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const numColumns = Math.trunc(width / EMOJI_SIZE);
|
||||||
|
const marginHorizontal = (width - numColumns * EMOJI_SIZE) / 2;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<FlatList
|
||||||
|
contentContainerStyle={{ marginHorizontal }}
|
||||||
|
// rerender FlatList in case of width changes
|
||||||
|
key={`emoji-category-${width}`}
|
||||||
|
// @ts-ignore
|
||||||
|
keyExtractor={item => (item && item.isCustom && item.content) || item}
|
||||||
|
data={emojis}
|
||||||
|
extraData={this.props}
|
||||||
|
renderItem={({ item }) => this.renderItem(item)}
|
||||||
|
numColumns={numColumns}
|
||||||
|
initialNumToRender={45}
|
||||||
|
removeClippedSubviews
|
||||||
|
{...scrollPersistTaps}
|
||||||
|
keyboardDismissMode={'none'}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default EmojiCategory;
|
export default EmojiCategory;
|
||||||
|
|
|
@ -1,61 +0,0 @@
|
||||||
import React, { useState } from 'react';
|
|
||||||
import { StyleSheet, TextInputProps } from 'react-native';
|
|
||||||
|
|
||||||
import { FormTextInput } from '../TextInput/FormTextInput';
|
|
||||||
import { useTheme } from '../../theme';
|
|
||||||
import I18n from '../../i18n';
|
|
||||||
import { isIOS } from '../../lib/methods/helpers';
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
input: {
|
|
||||||
height: 32,
|
|
||||||
borderWidth: 0,
|
|
||||||
paddingVertical: 0,
|
|
||||||
borderRadius: 4
|
|
||||||
},
|
|
||||||
textInputContainer: {
|
|
||||||
marginBottom: 0
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
interface IEmojiSearchBarProps {
|
|
||||||
onBlur?: TextInputProps['onBlur'];
|
|
||||||
onChangeText: TextInputProps['onChangeText'];
|
|
||||||
bottomSheet?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const EmojiSearch = ({ onBlur, onChangeText, bottomSheet }: IEmojiSearchBarProps): React.ReactElement => {
|
|
||||||
const { colors } = useTheme();
|
|
||||||
const [searchText, setSearchText] = useState<string>('');
|
|
||||||
|
|
||||||
const handleTextChange = (text: string) => {
|
|
||||||
setSearchText(text);
|
|
||||||
if (onChangeText) {
|
|
||||||
onChangeText(text);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<FormTextInput
|
|
||||||
autoCapitalize='none'
|
|
||||||
autoCorrect={false}
|
|
||||||
autoComplete='off'
|
|
||||||
returnKeyType='search'
|
|
||||||
textContentType='none'
|
|
||||||
blurOnSubmit
|
|
||||||
placeholder={I18n.t('Search_emoji')}
|
|
||||||
placeholderTextColor={colors.auxiliaryText}
|
|
||||||
underlineColorAndroid='transparent'
|
|
||||||
onChangeText={handleTextChange}
|
|
||||||
inputStyle={[styles.input, { backgroundColor: colors.textInputSecondaryBackground }]}
|
|
||||||
containerStyle={styles.textInputContainer}
|
|
||||||
value={searchText}
|
|
||||||
onClearInput={() => handleTextChange('')}
|
|
||||||
onBlur={onBlur}
|
|
||||||
iconRight={'search'}
|
|
||||||
testID='emoji-searchbar-input'
|
|
||||||
bottomSheet={bottomSheet && isIOS}
|
|
||||||
autoFocus={!bottomSheet} // focus on input when not in reaction picker
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
|
@ -1,36 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import { View, Pressable } from 'react-native';
|
|
||||||
|
|
||||||
import { useTheme } from '../../theme';
|
|
||||||
import { CustomIcon } from '../CustomIcon';
|
|
||||||
import styles from './styles';
|
|
||||||
import { IFooterProps } from './interfaces';
|
|
||||||
|
|
||||||
const BUTTON_HIT_SLOP = { top: 15, right: 15, bottom: 15, left: 15 };
|
|
||||||
|
|
||||||
const Footer = ({ onSearchPressed, onBackspacePressed }: IFooterProps): React.ReactElement => {
|
|
||||||
const { colors } = useTheme();
|
|
||||||
return (
|
|
||||||
<View style={[styles.footerContainer, { borderTopColor: colors.borderColor }]}>
|
|
||||||
<Pressable
|
|
||||||
onPress={onSearchPressed}
|
|
||||||
hitSlop={BUTTON_HIT_SLOP}
|
|
||||||
style={({ pressed }) => [styles.footerButtonsContainer, { opacity: pressed ? 0.7 : 1 }]}
|
|
||||||
testID='emoji-picker-search'
|
|
||||||
>
|
|
||||||
<CustomIcon color={colors.auxiliaryTintColor} size={24} name='search' />
|
|
||||||
</Pressable>
|
|
||||||
|
|
||||||
<Pressable
|
|
||||||
onPress={onBackspacePressed}
|
|
||||||
hitSlop={BUTTON_HIT_SLOP}
|
|
||||||
style={({ pressed }) => [styles.footerButtonsContainer, { opacity: pressed ? 0.7 : 1 }]}
|
|
||||||
testID='emoji-picker-backspace'
|
|
||||||
>
|
|
||||||
<CustomIcon color={colors.auxiliaryTintColor} size={24} name='backspace' />
|
|
||||||
</Pressable>
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Footer;
|
|
|
@ -1,28 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import { Pressable } from 'react-native';
|
|
||||||
|
|
||||||
import styles, { EMOJI_BUTTON_SIZE } from './styles';
|
|
||||||
import { IEmoji } from '../../definitions/IEmoji';
|
|
||||||
import { useTheme } from '../../theme';
|
|
||||||
import { isIOS } from '../../lib/methods/helpers';
|
|
||||||
import { Emoji } from './Emoji';
|
|
||||||
|
|
||||||
export const PressableEmoji = ({ emoji, onPress }: { emoji: IEmoji; onPress: (emoji: IEmoji) => void }): React.ReactElement => {
|
|
||||||
const { colors } = useTheme();
|
|
||||||
return (
|
|
||||||
<Pressable
|
|
||||||
key={typeof emoji === 'string' ? emoji : emoji.name}
|
|
||||||
onPress={() => onPress(emoji)}
|
|
||||||
testID={`emoji-${typeof emoji === 'string' ? emoji : emoji.name}`}
|
|
||||||
android_ripple={{ color: colors.bannerBackground, borderless: true, radius: EMOJI_BUTTON_SIZE / 2 }}
|
|
||||||
style={({ pressed }: { pressed: boolean }) => [
|
|
||||||
styles.emojiButton,
|
|
||||||
{
|
|
||||||
backgroundColor: isIOS && pressed ? colors.bannerBackground : 'transparent'
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<Emoji emoji={emoji} />
|
|
||||||
</Pressable>
|
|
||||||
);
|
|
||||||
};
|
|
|
@ -1,42 +1,56 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Pressable, View } from 'react-native';
|
import { StyleProp, Text, TextStyle, TouchableOpacity, View } from 'react-native';
|
||||||
|
|
||||||
import styles from './styles';
|
import styles from './styles';
|
||||||
import { useTheme } from '../../theme';
|
import { themes } from '../../lib/constants';
|
||||||
import { ITabBarProps } from './interfaces';
|
import { TSupportedThemes } from '../../theme';
|
||||||
import { isIOS } from '../../lib/methods/helpers';
|
|
||||||
import { CustomIcon } from '../CustomIcon';
|
|
||||||
|
|
||||||
const TabBar = ({ activeTab, tabs, goToPage }: ITabBarProps): React.ReactElement => {
|
interface ITabBarProps {
|
||||||
const { colors } = useTheme();
|
goToPage?: (page: number) => void;
|
||||||
|
activeTab?: number;
|
||||||
|
tabs?: string[];
|
||||||
|
tabEmojiStyle: StyleProp<TextStyle>;
|
||||||
|
theme: TSupportedThemes;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
export default class TabBar extends React.Component<ITabBarProps> {
|
||||||
<View style={styles.tabsContainer}>
|
shouldComponentUpdate(nextProps: ITabBarProps) {
|
||||||
{tabs?.map((tab, i) => (
|
const { activeTab, theme } = this.props;
|
||||||
<Pressable
|
if (nextProps.activeTab !== activeTab) {
|
||||||
key={tab}
|
return true;
|
||||||
onPress={() => goToPage?.(i)}
|
}
|
||||||
testID={`emoji-picker-tab-${tab}`}
|
if (nextProps.theme !== theme) {
|
||||||
android_ripple={{ color: colors.bannerBackground }}
|
return true;
|
||||||
style={({ pressed }: { pressed: boolean }) => [
|
}
|
||||||
styles.tab,
|
return false;
|
||||||
{
|
}
|
||||||
backgroundColor: isIOS && pressed ? colors.bannerBackground : 'transparent'
|
|
||||||
}
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<CustomIcon name={tab} size={24} color={activeTab === i ? colors.tintColor : colors.auxiliaryTintColor} />
|
|
||||||
<View
|
|
||||||
style={
|
|
||||||
activeTab === i
|
|
||||||
? [styles.activeTabLine, { backgroundColor: colors.tintColor }]
|
|
||||||
: [styles.tabLine, { backgroundColor: colors.borderColor }]
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Pressable>
|
|
||||||
))}
|
|
||||||
</View>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default TabBar;
|
render() {
|
||||||
|
const { tabs, goToPage, tabEmojiStyle, activeTab, theme } = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={styles.tabsContainer}>
|
||||||
|
{tabs?.map((tab, i) => (
|
||||||
|
<TouchableOpacity
|
||||||
|
activeOpacity={0.7}
|
||||||
|
key={tab}
|
||||||
|
onPress={() => {
|
||||||
|
if (goToPage) {
|
||||||
|
goToPage(i);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
style={styles.tab}
|
||||||
|
testID={`reaction-picker-${tab}`}
|
||||||
|
>
|
||||||
|
<Text style={[styles.tabEmoji, tabEmojiStyle]}>{tab}</Text>
|
||||||
|
{activeTab === i ? (
|
||||||
|
<View style={[styles.activeTabLine, { backgroundColor: themes[theme].tintColor }]} />
|
||||||
|
) : (
|
||||||
|
<View style={styles.tabLine} />
|
||||||
|
)}
|
||||||
|
</TouchableOpacity>
|
||||||
|
))}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,44 +1,44 @@
|
||||||
const list = ['frequentlyUsed', 'custom', 'people', 'nature', 'food', 'activity', 'travel', 'objects', 'symbols', 'flags'];
|
const list = ['frequentlyUsed', 'custom', 'people', 'nature', 'food', 'activity', 'travel', 'objects', 'symbols', 'flags'];
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{
|
{
|
||||||
tabLabel: 'clock',
|
tabLabel: '🕒',
|
||||||
category: list[0]
|
category: list[0]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tabLabel: 'rocket',
|
tabLabel: '🚀',
|
||||||
category: list[1]
|
category: list[1]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tabLabel: 'emoji',
|
tabLabel: '😃',
|
||||||
category: list[2]
|
category: list[2]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tabLabel: 'leaf',
|
tabLabel: '🐶',
|
||||||
category: list[3]
|
category: list[3]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tabLabel: 'burger',
|
tabLabel: '🍔',
|
||||||
category: list[4]
|
category: list[4]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tabLabel: 'basketball',
|
tabLabel: '⚽',
|
||||||
category: list[5]
|
category: list[5]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tabLabel: 'airplane',
|
tabLabel: '🚌',
|
||||||
category: list[6]
|
category: list[6]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tabLabel: 'lamp-bulb',
|
tabLabel: '💡',
|
||||||
category: list[7]
|
category: list[7]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tabLabel: 'percentage',
|
tabLabel: '💛',
|
||||||
category: list[8]
|
category: list[8]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
tabLabel: 'flag',
|
tabLabel: '🏁',
|
||||||
category: list[9]
|
category: list[9]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
export const categories = { list, tabs };
|
export default { list, tabs };
|
|
@ -2813,5 +2813,3 @@ export const emojis = [
|
||||||
'flag_tc',
|
'flag_tc',
|
||||||
'flag_mf'
|
'flag_mf'
|
||||||
];
|
];
|
||||||
|
|
||||||
export const DEFAULT_EMOJIS = ['clap', 'thumbsup', 'heart_eyes', 'grinning', 'thinking', 'smiley'];
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue