-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #557 from cocrafts/dev
sync dev to staging
- Loading branch information
Showing
82 changed files
with
3,285 additions
and
777 deletions.
There are no files selected for viewing
86 changes: 86 additions & 0 deletions
86
apps/landing/components/layouts/Home/Navigation/LauchingOption.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,86 @@ | ||
import type { FC, ReactNode } from 'react'; | ||
import { useState } from 'react'; | ||
import { StyleSheet, TouchableOpacity } from 'react-native'; | ||
import { Anchor, Text } from '@walless/gui'; | ||
|
||
interface LauchingOptionProps { | ||
icon: ReactNode; | ||
title: string; | ||
activeIcon: ReactNode; | ||
onPress?: () => void; | ||
url?: string; | ||
isDisabled?: boolean; | ||
} | ||
|
||
const LaunchingOption: FC<LauchingOptionProps> = ({ | ||
icon, | ||
activeIcon, | ||
title, | ||
onPress, | ||
url, | ||
isDisabled = false, | ||
}) => { | ||
const [isHovered, setIsHovered] = useState(false); | ||
|
||
const handleHoverIn = () => { | ||
setIsHovered(true); | ||
}; | ||
|
||
const handleHoverOut = () => { | ||
setIsHovered(false); | ||
}; | ||
|
||
return ( | ||
<Anchor | ||
onHoverIn={handleHoverIn} | ||
onHoverOut={handleHoverOut} | ||
href={url as string} | ||
hoverOpacity={1} | ||
disabled={isDisabled} | ||
> | ||
<TouchableOpacity | ||
style={[ | ||
styles.container, | ||
isHovered && !isDisabled && styles.hoveredContainerStyle, | ||
]} | ||
onPress={onPress} | ||
disabled={isDisabled} | ||
> | ||
{isHovered && !isDisabled ? activeIcon : icon} | ||
<Text | ||
style={[ | ||
styles.title, | ||
isHovered && !isDisabled && styles.hoveredTextStyle, | ||
]} | ||
> | ||
{title} | ||
</Text> | ||
</TouchableOpacity> | ||
</Anchor> | ||
); | ||
}; | ||
|
||
export default LaunchingOption; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
padding: 8, | ||
borderRadius: 8, | ||
gap: 8, | ||
width: 186, | ||
paddingVertical: 8, | ||
paddingHorizontal: 8, | ||
borderWidth: 1, | ||
borderColor: 'transparent', | ||
}, | ||
title: { | ||
color: '#ffffff', | ||
}, | ||
hoveredContainerStyle: { | ||
backgroundColor: '#202D38', | ||
borderColor: '#000000', | ||
}, | ||
hoveredTextStyle: { fontWeight: '500' }, | ||
}); |
56 changes: 56 additions & 0 deletions
56
apps/landing/components/layouts/Home/Navigation/LaunchingModal.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,56 @@ | ||
import { View } from 'react-native'; | ||
import { StyleSheet } from 'react-native'; | ||
import { Button } from '@walless/gui'; | ||
import { Phone, PlainWalless, Puzzle, Walless } from '@walless/icons'; | ||
|
||
import LaunchingOption from './LauchingOption'; | ||
|
||
const LaunchingModal = () => { | ||
return ( | ||
<View> | ||
<Button title="Access Walless" style={styles.button} /> | ||
<View style={styles.container}> | ||
<LaunchingOption | ||
icon={<PlainWalless color="#A4B3C1" />} | ||
title="Launch web app" | ||
activeIcon={<Walless />} | ||
url="https://app.walless.io/auth/invitation" | ||
/> | ||
<View style={styles.line} /> | ||
<LaunchingOption | ||
icon={<Puzzle color="#A4B3C1" />} | ||
title="Add extension" | ||
activeIcon={<Puzzle color="#19A3E1" />} | ||
url="https://chromewebstore.google.com/detail/walless/jfmajkmgjpjognffefopllhaijknhnmm" | ||
/> | ||
<LaunchingOption | ||
icon={<Phone color="#A4B3C1" />} | ||
title="Mobile (coming soon)" | ||
isDisabled={true} | ||
activeIcon={<Phone color="#19A3E1" />} | ||
/> | ||
</View> | ||
</View> | ||
); | ||
}; | ||
|
||
export default LaunchingModal; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
backgroundColor: '#19232C', | ||
borderRadius: 16, | ||
paddingVertical: 12, | ||
paddingHorizontal: 16, | ||
gap: 8, | ||
}, | ||
button: { | ||
marginHorizontal: 8, | ||
alignSelf: 'flex-start', | ||
}, | ||
line: { | ||
backgroundColor: '#ffffff', | ||
height: 1, | ||
opacity: 0.1, | ||
}, | ||
}); |
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,100 @@ | ||
import { StyleSheet, Text } from 'react-native'; | ||
import { Hoverable, View } from '@walless/gui'; | ||
import { Eye, EyeOff, Settings } from '@walless/icons'; | ||
import { appState } from 'state/app'; | ||
import { setPrivacy } from 'state/runtime/config'; | ||
import { getValuationDisplay } from 'utils/helper'; | ||
import { useTokens } from 'utils/hooks'; | ||
import { navigate } from 'utils/navigation'; | ||
import { useSnapshot } from 'valtio'; | ||
|
||
const Header = () => { | ||
const { config } = useSnapshot(appState); | ||
const { valuation } = useTokens(); | ||
|
||
const handleNavigateToSettings = () => { | ||
navigate('Dashboard', { | ||
screen: 'Explore', | ||
params: { | ||
screen: 'Widget', | ||
params: { | ||
screen: 'Setting', | ||
}, | ||
}, | ||
}); | ||
}; | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<View style={styles.balanceContainer}> | ||
<Text style={styles.helloText}>Hi👋, your balance today:</Text> | ||
<View style={styles.tokenValuationContainer}> | ||
<Hoverable | ||
onPress={() => { | ||
setPrivacy(!config.hideBalance); | ||
}} | ||
> | ||
{config.hideBalance ? ( | ||
<Eye color="#19A3E1" size={16} /> | ||
) : ( | ||
<EyeOff color="#19A3E1" size={16} /> | ||
)} | ||
</Hoverable> | ||
<Text style={styles.tokenValuation}> | ||
{getValuationDisplay(valuation, config.hideBalance)} | ||
</Text> | ||
</View> | ||
</View> | ||
|
||
<View style={styles.buttonContainer}> | ||
<Hoverable onPress={handleNavigateToSettings} style={styles.button}> | ||
<Settings size={20} color="#566674" /> | ||
</Hoverable> | ||
|
||
{/* This button will be implemented in the next task, so I keep it here | ||
for now in the comment */} | ||
{/* <Hoverable style={styles.button}> | ||
<Search size={20} color="#566674" /> | ||
</Hoverable> */} | ||
</View> | ||
</View> | ||
); | ||
}; | ||
|
||
export default Header; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flexDirection: 'row', | ||
justifyContent: 'space-between', | ||
paddingVertical: 10, | ||
paddingHorizontal: 16, | ||
}, | ||
helloText: { | ||
color: '#ffffff', | ||
}, | ||
balanceContainer: { | ||
gap: 4, | ||
}, | ||
tokenValuationContainer: { | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
gap: 4, | ||
}, | ||
tokenValuation: { | ||
fontSize: 18, | ||
color: '#ffffff', | ||
}, | ||
buttonContainer: { | ||
flexDirection: 'row', | ||
alignSelf: 'flex-end', | ||
gap: 8, | ||
}, | ||
button: { | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
backgroundColor: '#23303C', | ||
borderRadius: 6, | ||
padding: 8, | ||
}, | ||
}); |
45 changes: 45 additions & 0 deletions
45
apps/wallet/src/features/Explorer/Highlights/HighlightIndicator.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,45 @@ | ||
import type { FC } from 'react'; | ||
import { StyleSheet } from 'react-native'; | ||
import type { SharedValue } from 'react-native-reanimated'; | ||
import { View } from '@walless/gui'; | ||
|
||
import IndicatorDot from './IndicatorDot'; | ||
|
||
interface HighlightIndicatorProps { | ||
dataLength: number; | ||
onSelectItem: (index: number) => void; | ||
currentIndex: SharedValue<number>; | ||
animatedValue: SharedValue<number>; | ||
} | ||
|
||
const HighlightIndicator: FC<HighlightIndicatorProps> = ({ | ||
dataLength, | ||
onSelectItem, | ||
animatedValue, | ||
}) => { | ||
const data = Array.from({ length: dataLength }, (_, i) => i); | ||
|
||
return ( | ||
<View style={styles.container}> | ||
{data.map((item) => { | ||
return ( | ||
<IndicatorDot | ||
key={item} | ||
index={item} | ||
data={data} | ||
onPress={onSelectItem} | ||
animatedValue={animatedValue} | ||
/> | ||
); | ||
})} | ||
</View> | ||
); | ||
}; | ||
|
||
export default HighlightIndicator; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
alignSelf: 'center', | ||
}, | ||
}); |
Oops, something went wrong.