Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to maven central repo #2

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ project.xcworkspace
.settings
local.properties
android.iml

gradle
gradlew
gradlew.bat
# Cocoapods
#
example/ios/Pods

# Ruby
example/vendor/

example/Gemfile.lock
# node.js
#
node_modules/
Expand Down
2 changes: 0 additions & 2 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,5 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"

yarnPath: .yarn/releases/yarn-3.6.1.cjs

npmPublishRegistry: https://registry.npmjs.org/
npmRegistryServer: https://registry.npmjs.org/
12 changes: 5 additions & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ buildscript {
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["CameraKitReactNative_kotlinVersion"]

ext {
cameraKitVersion = "1.28.0"
cameraKitVersion = "1.31.0"
exoPlayerVersion = "2.16.1"
}

repositories {
maven {
url "gcs://snapengine-maven-publish/releases"
}
google()
mavenCentral()
}

dependencies {
Expand Down Expand Up @@ -68,9 +67,8 @@ android {
}

repositories {
maven {
url "gcs://snapengine-maven-publish/releases"
}
google()
mavenCentral()
}

def kotlin_version = getExtOrDefault("kotlinVersion")
Expand Down
84 changes: 84 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# OSX
#
.DS_Store

# XDE
.expo/

# VSCode
.vscode/
jsconfig.json

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IJ
#
.classpath
.cxx
.gradle
.idea
.project
.settings
local.properties
android.iml
gradle
gradlew
gradlew.bat
# Cocoapods
#
example/ios/Pods

# Ruby
example/vendor/
example/Gemfile.lock
# node.js
#
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Expo
.expo/

# Turborepo
.turbo/

# generated by bob
lib/

#machamp

output/
5 changes: 2 additions & 3 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ buildscript {
ndkVersion = "23.1.7779620"
}
repositories {
maven {
url "gcs://snapengine-maven-publish/releases"
}
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle")
Expand Down
4 changes: 3 additions & 1 deletion example/src/CameraPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export const Preview: FC<PreviewProps> = ({ onStopRendering }) => {
* @param {LayoutChangeEvent} event - the event containing layout information
* @returns {void}
*/
const calculatePreviewSize = (event: LayoutChangeEvent) => {

const calculatePreviewSize = (event: LayoutChangeEvent): void => {
const {
nativeEvent: {
layout: { x, y, width, height },
Expand Down Expand Up @@ -87,6 +88,7 @@ export const Preview: FC<PreviewProps> = ({ onStopRendering }) => {
<View style={styles.box}>
{showCamera ? (
<CameraPreviewView
//@ts-expect-error
onLayout={calculatePreviewSize}
style={styles.box}
cameraPosition={position}
Expand Down
8 changes: 6 additions & 2 deletions example/src/CameraStateContext.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { createContext, useReducer, type FC, type Dispatch, useContext, type Reducer } from 'react';
import React, { createContext, useReducer, type FC, type Dispatch, useContext, type Reducer, type ReactNode } from 'react';
import type { CameraOptions } from '../../src/NativeView';
import type { VideoRecording } from '../../src/CameraKitContext';

Expand Down Expand Up @@ -86,14 +86,18 @@ const cameraStateReducer: Reducer<CameraState, CameraStateActions> = (
}
};

interface CameraContextProps {
children: ReactNode;
}

/**
* React functional component for managing camera context.
* It provides the camera state and dispatch functions to its child components through context providers.
*
* @param {FC} children - The child components
* @return {JSX.Element} The JSX element representing the camera context provider
*/
export const CameraContext: FC = ({ children }) => {
export const CameraContext: FC<CameraContextProps> = ({ children }) => {
const [state, dispatch] = useReducer(cameraStateReducer, initialState);

return (
Expand Down
2 changes: 1 addition & 1 deletion example/src/capture-preview/Hint.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { type FC } from 'react';
import { type FC } from 'react';
import { Text, StyleSheet } from 'react-native';

export const Hint: FC<{ text: string }> = ({ text }) => {
Expand Down
Loading