-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into qa/new-1211
- Loading branch information
Showing
77 changed files
with
1,958 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/core-mobile/android/app/src/main/java/com/avaxwallet/CustomGlideModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} |
106 changes: 106 additions & 0 deletions
106
packages/core-mobile/app/new/components/SlideToConfirm.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.