@momo-kits/foundation 0.102.1-beta.3 → 0.102.1-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,4 @@
1
- import {
2
- StackHeaderTitleProps,
3
- StackNavigationOptions,
4
- } from '@react-navigation/stack';
1
+ import {StackNavigationOptions} from '@react-navigation/stack';
5
2
  import {EventArg} from '@react-navigation/core';
6
3
  import React from 'react';
7
4
  import {Animated, ViewProps} from 'react-native';
@@ -240,21 +237,8 @@ export type FloatingButtonProps = {
240
237
  onPress: () => void;
241
238
  };
242
239
 
243
- export type AnimatedDefaultType = {
240
+ export type AnimatedHeader = {
244
241
  type: 'default' | 'surface';
245
- component?: (props?: {animatedValue: Animated.Value}) => React.ReactElement;
246
- headerTitle?: (
247
- props?: StackHeaderTitleProps & {animatedValue: Animated.Value}
248
- ) => React.ReactElement;
242
+ component?: (props?: any) => React.ReactElement;
243
+ headerTitle?: (props?: any) => React.ReactElement;
249
244
  };
250
-
251
- export type AnimatedNormalType = {
252
- type: 'default';
253
- } & AnimatedDefaultType;
254
-
255
- export type AnimatedSurfaceType = {
256
- type: 'surface';
257
- alwaysShowTitle?: boolean;
258
- } & AnimatedDefaultType;
259
-
260
- export type AnimatedHeader = AnimatedNormalType | AnimatedSurfaceType;
package/Input/styles.ts CHANGED
@@ -29,6 +29,7 @@ export default StyleSheet.create({
29
29
  left: Spacing.S,
30
30
  paddingHorizontal: Spacing.S,
31
31
  flexDirection: 'row',
32
+ alignItems: 'center',
32
33
  },
33
34
  floatingIcon: {marginLeft: Spacing.XS},
34
35
  errorIcon: {marginRight: Spacing.XS},
package/Layout/Screen.tsx CHANGED
@@ -270,9 +270,6 @@ const Screen = forwardRef(
270
270
  if (animatedHeader.type === 'surface') {
271
271
  options = {
272
272
  ...options,
273
- headerTintColor: animatedHeader.alwaysShowTitle
274
- ? theme.colors.text.default
275
- : undefined,
276
273
  headerBackground: (props: any) => (
277
274
  <HeaderBackground
278
275
  {...props}
@@ -281,16 +278,6 @@ const Screen = forwardRef(
281
278
  animatedValue={animatedValue.current}
282
279
  />
283
280
  ),
284
- headerTitle: (props: any) => (
285
- <HeaderTitle
286
- {...props}
287
- animatedValue={
288
- animatedHeader.alwaysShowTitle
289
- ? undefined
290
- : animatedValue.current
291
- }
292
- />
293
- ),
294
281
  };
295
282
  }
296
283
  if (animatedHeader.headerTitle) {
@@ -327,10 +314,7 @@ const Screen = forwardRef(
327
314
  useNativeDriver: true,
328
315
  listener: (e: NativeSyntheticEvent<NativeScrollEvent>) => {
329
316
  scrollViewProps?.onScroll?.(e);
330
- if (
331
- animatedHeader?.type === 'surface' &&
332
- !animatedHeader?.alwaysShowTitle
333
- ) {
317
+ if (animatedHeader?.type === 'surface') {
334
318
  const offsetY = e.nativeEvent.contentOffset.y;
335
319
  let color = Colors.black_01;
336
320
  if (offsetY > 50) {
@@ -370,12 +354,6 @@ const Screen = forwardRef(
370
354
  * render top navigation banner
371
355
  */
372
356
  const renderAnimatedHeader = () => {
373
- if (
374
- animatedHeader?.type === 'surface' &&
375
- animatedHeader?.alwaysShowTitle
376
- ) {
377
- return <View style={{height: heightHeader}} />;
378
- }
379
357
  if (typeof animatedHeader?.component === 'function') {
380
358
  return (
381
359
  <View style={[styles.screenBanner, {maxHeight: 210 + layoutOffset}]}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.102.1-beta.3",
3
+ "version": "0.102.1-beta.5",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},