Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/uiwjs/react-native-uiw into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
panbibi committed Apr 6, 2023
2 parents ca54fbc + 66e2cf3 commit c5a8d4c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_ios_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16

- run: yarn install
- run: npm run build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
node-version: 16

- run: yarn install
- run: npm run build
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@
"@babel/preset-typescript": "~7.18.6"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
"node": ">=16.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/core/src/Tabs/TabsItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface TabsItemProps {
}

function TabsItem(props: TabsItemProps) {
const { activeColor, icon, index, value, onChange, defaultColor, children } = props;
const { activeColor, icon, index, value, onChange, defaultColor } = props;
const opacity = useRef(new Animated.Value(0)).current;

useEffect(() => {
Expand Down
15 changes: 12 additions & 3 deletions packages/core/src/Tabs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useRef, useEffect, useState } from 'react';
import { StyleSheet, SafeAreaView, StatusBar, ScrollView, ViewProps, View, ViewStyle, Dimensions } from 'react-native';

import { StyleSheet, SafeAreaView, ScrollView, ViewProps, View, ViewStyle, Dimensions } from 'react-native';
import { useTheme } from '@shopify/restyle';
import { Theme } from '../theme';
import Item from './TabsItem';

export interface TabsProps extends ViewProps {
Expand All @@ -15,7 +16,15 @@ export interface TabsProps extends ViewProps {
}

function Tabs(props: TabsProps) {
const { style, children, onChange, activeColor, value, defaultColor = '#035bb6' } = props;
const theme = useTheme<Theme>();
const {
style,
children,
onChange,
activeColor,
value,
defaultColor = theme.colors.primary_background || '#3578e5',
} = props;
const scrollViewRef = useRef<ScrollView>(null);
const [scrollViewWidth, setScrollViewWidth] = useState<number>(Dimensions.get('window').width);

Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import theme from './theme';
import ThemeProvider from './theme-provider';
import type { Theme } from './theme';

export { default as Avatar } from './Avatar';
export * from './Avatar';
Expand Down Expand Up @@ -159,3 +160,4 @@ export * from './Typography/Em';
export * from './Typography/RnText';

export { theme, ThemeProvider };
export type { Theme };

0 comments on commit c5a8d4c

Please sign in to comment.