native-pytech 1.0.174 → 1.0.175
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,3 +1,3 @@
|
|
|
1
1
|
import type Props from './types';
|
|
2
|
-
declare const _default: import("react").MemoExoticComponent<({ children, onPress, icon, label, systemImage, listRowInsets, trailingText, trailingTextProps, trailingComponent }: Props) => import("react").JSX.Element>;
|
|
2
|
+
declare const _default: import("react").MemoExoticComponent<({ children, onPress, icon, label, systemImage, listRowInsets, trailingText, trailingTextProps, trailingComponent, modifiers }: Props) => import("react").JSX.Element>;
|
|
3
3
|
export default _default;
|
|
@@ -2,9 +2,12 @@ import { Button, HStack, Label } from '@expo/ui/swift-ui';
|
|
|
2
2
|
import { listRowInsets as listRowInsetsModifier, foregroundStyle } from '@expo/ui/swift-ui/modifiers';
|
|
3
3
|
import { memo, useMemo } from 'react';
|
|
4
4
|
import Trailing from './Trailing';
|
|
5
|
-
export default memo(({ children, onPress, icon, label, systemImage, listRowInsets = false, trailingText, trailingTextProps, trailingComponent }) => {
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
export default memo(({ children, onPress, icon, label, systemImage, listRowInsets = false, trailingText, trailingTextProps, trailingComponent, modifiers }) => {
|
|
6
|
+
const _modifiers = useMemo(() => [
|
|
7
|
+
...(modifiers ?? []),
|
|
8
|
+
...(listRowInsets ? [listRowInsetsModifier({ top: 20, bottom: 20, leading: 25, trailing: 20 })] : []),
|
|
9
|
+
], [modifiers, listRowInsets]);
|
|
10
|
+
return (<HStack modifiers={_modifiers}>
|
|
8
11
|
<Button onPress={onPress} modifiers={[foregroundStyle({ type: 'hierarchical', style: 'primary' })]}>
|
|
9
12
|
{children ?? (!systemImage ? <Label title={label} icon={icon}/> : undefined)}
|
|
10
13
|
</Button>
|
|
@@ -13,7 +13,7 @@ export type TrailingProps = {
|
|
|
13
13
|
*/
|
|
14
14
|
component?: React.ReactNode;
|
|
15
15
|
};
|
|
16
|
-
type Props = Pick<ButtonProps, 'children' | 'onPress' | 'systemImage' | 'label'> & {
|
|
16
|
+
type Props = Pick<ButtonProps, 'children' | 'onPress' | 'systemImage' | 'label' | 'modifiers'> & {
|
|
17
17
|
/**
|
|
18
18
|
Whether to apply the listRowInsets modifier to the HStack.
|
|
19
19
|
@default false
|