Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to nativewind v4 + core ui updates #272

Merged
merged 14 commits into from
Feb 21, 2024
9 changes: 8 additions & 1 deletion src/ui/core/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@

import type { BottomSheetModalProps } from '@gorhom/bottom-sheet';
import { BottomSheetModal } from '@gorhom/bottom-sheet';
import { useColorScheme } from 'nativewind';
import * as React from 'react';
import { Pressable, View } from 'react-native';
import { Path, Svg } from 'react-native-svg';

import { colors } from '@/ui/theme';

import { renderBackdrop } from './bottom-sheet';
import { Text } from './text';

Expand Down Expand Up @@ -148,6 +151,10 @@ const ModalHeader = React.memo(({ title, dismiss }: ModalHeaderProps) => {
});

const CloseButton = ({ close }: { close: () => void }) => {
const { colorScheme } = useColorScheme();
const isDark = colorScheme === 'dark';
const buttonColor = isDark ? colors.charcoal[100] : colors.white;

return (
<Pressable
onPress={close}
Expand All @@ -160,7 +167,7 @@ const CloseButton = ({ close }: { close: () => void }) => {
<Svg width={24} height={24} fill="none" viewBox="0 0 24 24">
<Path
d="M18.707 6.707a1 1 0 0 0-1.414-1.414L12 10.586 6.707 5.293a1 1 0 0 0-1.414 1.414L10.586 12l-5.293 5.293a1 1 0 1 0 1.414 1.414L12 13.414l5.293 5.293a1 1 0 0 0 1.414-1.414L13.414 12l5.293-5.293Z"
fill="dark:fille-charcoal-100 light:fill-white"
fill={buttonColor}
yjose marked this conversation as resolved.
Show resolved Hide resolved
/>
</Svg>
</Pressable>
Expand Down
Loading