mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-23 00:06:42 +02:00
style: auto-format codebase with Prettier
Applied formatting to 1487+ files using pnpm format:write - TypeScript/JavaScript files - Svelte components - Astro pages - JSON configs - Markdown docs 13 files still need manual review (Astro JSX comments)
This commit is contained in:
parent
0241f5554c
commit
d36b321d9d
3952 changed files with 661498 additions and 739751 deletions
|
|
@ -3,45 +3,45 @@ import { Pressable, ViewStyle, PressableProps } from 'react-native';
|
|||
import { Icon } from '../../ui/Icon';
|
||||
|
||||
export type HeaderButtonProps = {
|
||||
/** Icon name */
|
||||
icon: string;
|
||||
/** Press handler */
|
||||
onPress: () => void;
|
||||
/** Icon size */
|
||||
size?: number;
|
||||
/** Icon color */
|
||||
iconColor?: string;
|
||||
/** Button is disabled */
|
||||
disabled?: boolean;
|
||||
/** Additional styles */
|
||||
style?: ViewStyle;
|
||||
/** Hit slop for better touch target */
|
||||
hitSlop?: PressableProps['hitSlop'];
|
||||
/** Icon name */
|
||||
icon: string;
|
||||
/** Press handler */
|
||||
onPress: () => void;
|
||||
/** Icon size */
|
||||
size?: number;
|
||||
/** Icon color */
|
||||
iconColor?: string;
|
||||
/** Button is disabled */
|
||||
disabled?: boolean;
|
||||
/** Additional styles */
|
||||
style?: ViewStyle;
|
||||
/** Hit slop for better touch target */
|
||||
hitSlop?: PressableProps['hitSlop'];
|
||||
};
|
||||
|
||||
export function HeaderButton({
|
||||
icon,
|
||||
onPress,
|
||||
size = 24,
|
||||
iconColor = '#6B7280',
|
||||
disabled = false,
|
||||
style,
|
||||
hitSlop = { top: 10, bottom: 10, left: 10, right: 10 },
|
||||
icon,
|
||||
onPress,
|
||||
size = 24,
|
||||
iconColor = '#6B7280',
|
||||
disabled = false,
|
||||
style,
|
||||
hitSlop = { top: 10, bottom: 10, left: 10, right: 10 },
|
||||
}: HeaderButtonProps) {
|
||||
return (
|
||||
<Pressable
|
||||
onPress={onPress}
|
||||
disabled={disabled}
|
||||
hitSlop={hitSlop}
|
||||
style={({ pressed }) => [
|
||||
{
|
||||
padding: 8,
|
||||
opacity: disabled ? 0.4 : pressed ? 0.7 : 1,
|
||||
},
|
||||
style,
|
||||
]}
|
||||
>
|
||||
<Icon name={icon} size={size} color={iconColor} />
|
||||
</Pressable>
|
||||
);
|
||||
return (
|
||||
<Pressable
|
||||
onPress={onPress}
|
||||
disabled={disabled}
|
||||
hitSlop={hitSlop}
|
||||
style={({ pressed }) => [
|
||||
{
|
||||
padding: 8,
|
||||
opacity: disabled ? 0.4 : pressed ? 0.7 : 1,
|
||||
},
|
||||
style,
|
||||
]}
|
||||
>
|
||||
<Icon name={icon} size={size} color={iconColor} />
|
||||
</Pressable>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue