Files
actual/packages/desktop-client/src/components/mobile/MobileBackButton.tsx
Joel Jeremy Marquez 2acf996430 Fix mobile page header buttons (#3491)
* Fix button2 styles

* Create 3491.md

* VRT

* Revert VRT

* Put pressed css on Page component

* Remove data-pressed

* Fix lint errors

* [chore] Update README

* Remove Icon
2024-09-24 13:02:49 -07:00

43 lines
969 B
TypeScript

import React, { type ComponentPropsWithoutRef } from 'react';
import { useNavigate } from '../../hooks/useNavigate';
import { SvgCheveronLeft } from '../../icons/v1';
import { styles } from '../../style';
import { Button } from '../common/Button2';
import { Text } from '../common/Text';
type MobileBackButtonProps = ComponentPropsWithoutRef<typeof Button>;
export function MobileBackButton({
onPress,
style,
...props
}: MobileBackButtonProps) {
const navigate = useNavigate();
return (
<Button
variant="bare"
style={{
margin: 10,
...style,
}}
onPress={onPress || (() => navigate(-1))}
{...props}
>
<SvgCheveronLeft
style={{ width: 30, height: 30, margin: -10, marginLeft: -5 }}
/>
<Text
style={{
...styles.text,
fontWeight: 500,
marginLeft: 5,
marginRight: 5,
}}
>
Back
</Text>
</Button>
);
}