-
Notifications
You must be signed in to change notification settings - Fork 4
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
CP-9398: Sign up and Sign back in Flow #2155
Changes from all commits
dbf8dbe
fa54844
fcee9b4
01c7f3a
6fc2b18
1a62ddc
b0af4e6
82b762e
558bf14
a7ad886
a871b3b
25aea3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.avaxwallet | ||
|
||
import com.bumptech.glide.annotation.GlideModule | ||
import com.bumptech.glide.module.AppGlideModule | ||
|
||
@GlideModule | ||
class CustomGlideModule : AppGlideModule() {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we don't create this module, expo-image fails to load images. (source) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ import BitcoinSVG from 'components/svg/BitcoinSVG' | |
import { TokenSymbol } from 'store/network' | ||
import { SvgUri } from 'react-native-svg' | ||
import { formatUriImageToPng, isContentfulImageUri } from 'utils/Contentful' | ||
import FastImage from 'react-native-fast-image' | ||
import { Image } from 'expo-image' | ||
import { Text, useTheme, View } from '@avalabs/k2-mobile' | ||
import { useGetInitials } from 'hooks/useGetInitials' | ||
import { SuggestedSiteName } from 'store/browser/const' | ||
|
@@ -104,11 +104,7 @@ const AvatarBase: FC<AvatarBaseProps> = ({ | |
testID="avatar__logo_avatar" | ||
/> | ||
) : ( | ||
<FastImage | ||
// TODO: remove this workaround when we have a proper solution | ||
// workaround for images not appearing | ||
// https://github.com/DylanVann/react-native-fast-image/issues/974 | ||
fallback={true} | ||
<Image | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add this change given that we haven't figured out a way to fix the expo slowness issue? 👀 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we can’t fix Expo’s Android performance issues, we’ll somehow need to roll back quite a few things besides |
||
style={{ | ||
borderRadius: size, | ||
width: size, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { | ||
K2AlpineThemeProvider, | ||
Logos, | ||
View, | ||
useTheme | ||
} from '@avalabs/k2-alpine' | ||
import React from 'react' | ||
import { hideModal, showModal } from 'utils/modal' | ||
|
||
export const LogoModal = (): JSX.Element => { | ||
const { theme } = useTheme() | ||
|
||
return ( | ||
<View | ||
style={{ | ||
width: '100%', | ||
height: '100%', | ||
backgroundColor: theme.colors.$surfacePrimary, | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
position: 'absolute' | ||
}}> | ||
<Logos.Core color={theme.colors.$textPrimary} /> | ||
</View> | ||
) | ||
} | ||
|
||
export const showLogoModal = (): void => { | ||
showModal( | ||
<K2AlpineThemeProvider> | ||
<LogoModal /> | ||
</K2AlpineThemeProvider> | ||
) | ||
} | ||
|
||
export const hideLogoModal = (): void => { | ||
hideModal() | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
import React, { useRef } from 'react' | ||
import { PanResponder, Animated, Dimensions } from 'react-native' | ||
import { useTheme, View, Icons } from '@avalabs/k2-alpine' | ||
|
||
const { width } = Dimensions.get('window') | ||
const _sliderWidth = 64 | ||
const _sliderHeight = 64 | ||
|
||
const SlideToConfirm = ({ | ||
text, | ||
onConfirm | ||
}: { | ||
text: string | ||
onConfirm: () => void | ||
}): JSX.Element => { | ||
const { theme } = useTheme() | ||
const slideWidth = width - 40 // Space for the slider to move | ||
const unlockThreshold = slideWidth - _sliderWidth // Set unlock point near the end | ||
const sliderWidth = useRef(new Animated.Value(_sliderWidth)).current | ||
|
||
const textColorAnim = sliderWidth.interpolate({ | ||
inputRange: [0, unlockThreshold], | ||
outputRange: [theme.colors.$textPrimary, theme.colors.$surfacePrimary], | ||
extrapolate: 'clamp' | ||
}) | ||
const iconOpacityAnim = sliderWidth.interpolate({ | ||
inputRange: [_sliderWidth, unlockThreshold / 2], | ||
outputRange: [1, 0], | ||
extrapolate: 'clamp' | ||
}) | ||
|
||
// PanResponder for gesture handling | ||
const panResponder = PanResponder.create({ | ||
onStartShouldSetPanResponder: () => true, | ||
onPanResponderMove: (_, gestureState) => { | ||
// Limit the slider to the width of the container | ||
if (gestureState.dx >= 0 && gestureState.dx <= unlockThreshold) { | ||
sliderWidth.setValue(_sliderWidth + gestureState.dx) | ||
} | ||
}, | ||
onPanResponderRelease: (_, gestureState) => { | ||
if (gestureState.dx > unlockThreshold) { | ||
onConfirm() | ||
Animated.spring(sliderWidth, { | ||
toValue: slideWidth, | ||
useNativeDriver: false | ||
}).start() | ||
} else { | ||
// Reset if not unlocked | ||
Animated.spring(sliderWidth, { | ||
toValue: _sliderWidth, | ||
useNativeDriver: false | ||
}).start() | ||
} | ||
} | ||
}) | ||
|
||
return ( | ||
<View | ||
sx={{ | ||
alignItems: 'center' | ||
}}> | ||
<View | ||
sx={{ | ||
width: width - 40, // Full width | ||
height: _sliderHeight, | ||
borderRadius: 32, | ||
backgroundColor: '#A1A1AA40', | ||
justifyContent: 'center', | ||
position: 'relative' | ||
}}> | ||
<Animated.View | ||
{...panResponder.panHandlers} | ||
style={{ | ||
height: _sliderHeight, | ||
borderRadius: 32, | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
position: 'absolute', | ||
left: 0, | ||
width: sliderWidth, | ||
backgroundColor: theme.colors.$textPrimary | ||
}}> | ||
<Animated.View testID="slide" style={{ opacity: iconOpacityAnim }}> | ||
<Icons.Navigation.ArrowForwardIOS | ||
color={theme.colors.$surfacePrimary} | ||
/> | ||
</Animated.View> | ||
</Animated.View> | ||
<Animated.Text | ||
style={[ | ||
{ | ||
fontSize: 15, | ||
fontWeight: '600', | ||
color: textColorAnim, | ||
alignSelf: 'center' | ||
} | ||
]}> | ||
{text} | ||
</Animated.Text> | ||
</View> | ||
</View> | ||
) | ||
} | ||
|
||
export default SlideToConfirm |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,8 @@ | ||
import React from 'react' | ||
import { useColorScheme } from 'react-native' | ||
import { GlassView } from '@avalabs/k2-alpine' | ||
|
||
const BlurredBackgroundView = (): JSX.Element => { | ||
const colorScheme = useColorScheme() | ||
|
||
return ( | ||
<GlassView | ||
style={{ flex: 1 }} | ||
glassType={colorScheme === 'dark' ? 'dark' : 'light'} | ||
/> | ||
) | ||
return <GlassView style={{ flex: 1 }} /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you set the glassType, it applies a background color to the blur, which causes a color difference with the backgroundView. Therefore, we don’t use glassType for the blurView used as the background for the header and tab bar. |
||
} | ||
|
||
export default BlurredBackgroundView |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is part of expo-image configuration.