Skip to content

Commit de40ea3

Browse files
authored
updates (#4244)
* updates * wip * design changes etc * wip * cleanup * wip consistency theme * clean up a whole bunch * listitemwrapper * recent activity * format date * cleanup * cleanup * wip broken stuffs * re-adds old token row * move balance summary widget over * optimize icons * cleanup * undo * undo * undo * fix * fix size->fontSize in secure-client
1 parent eed1348 commit de40ea3

39 files changed

+1465
-1255
lines changed

packages/app-mobile/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"postinstall": "npx patch-package"
2323
},
2424
"dependencies": {
25-
"@apollo/client": "3.8.0-beta.3",
25+
"@apollo/client": "3.8.0-beta.5",
2626
"@cardinal/payment-manager": "^1.7.9",
2727
"@cardinal/token-manager": "^1.7.9",
2828
"@coral-xyz/chat-xplat": "*",
Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const QUERY_USER_BALANCE_SUMMARY = gql(`
9797
}
9898
`);
9999

100-
function Container() {
100+
function Container({ hideChange }: { hideChange }) {
101101
const activeWallet = useActiveWallet();
102102
const { data } = useSuspenseQuery(QUERY_USER_BALANCE_SUMMARY, {
103103
variables: {
@@ -113,17 +113,19 @@ function Container() {
113113

114114
return (
115115
<Stack ai="center">
116-
<StyledText fontWeight="700" fontSize="$4xl" color="$fontColor">
116+
<StyledText fontWeight="600" fontSize="$4xl" color="$fontColor">
117117
{formatUsd(totalBalance)}
118118
</StyledText>
119-
<XStack alignItems="center">
120-
<TextTotalChange totalChange={totalChange} />
121-
<TextPercentChange
122-
isLoading={false}
123-
totalChange={totalChange}
124-
percentChange={percentChange as number}
125-
/>
126-
</XStack>
119+
{hideChange ? null : (
120+
<XStack alignItems="center">
121+
<TextTotalChange totalChange={totalChange} />
122+
<TextPercentChange
123+
isLoading={false}
124+
totalChange={totalChange}
125+
percentChange={percentChange as number}
126+
/>
127+
</XStack>
128+
)}
127129
</Stack>
128130
);
129131
}
@@ -139,11 +141,11 @@ function ErrorFallback({ error }: { error: Error }) {
139141
);
140142
}
141143

142-
export function BalanceSummaryWidget() {
144+
export function BalanceSummaryWidget({ hideChange }: { hideChange?: boolean }) {
143145
return (
144146
<ErrorBoundary FallbackComponent={ErrorFallback}>
145147
<Suspense fallback={<BalanceSummaryWidgetLoading />}>
146-
<Container />
148+
<Container hideChange={hideChange} />
147149
</Suspense>
148150
</ErrorBoundary>
149151
);

packages/app-mobile/src/components/CollectionListItem.tsx

Lines changed: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,77 @@
1-
import { View, Pressable } from "react-native";
1+
import { Pressable, StyleSheet } from "react-native";
22

33
import { UNKNOWN_NFT_ICON_SRC } from "@coral-xyz/common";
44
import { ProxyImage, XStack, StyledText } from "@coral-xyz/tamagui";
55

6+
import { WINDOW_WIDTH } from "~src/lib";
7+
8+
const ITEM_WIDTH = Math.floor((WINDOW_WIDTH - 32 - 16) / 2);
9+
const IMAGE_WIDTH = Math.floor((ITEM_WIDTH - 8) / 2);
10+
export const ITEM_HEIGHT = ITEM_WIDTH + 25;
11+
612
export function BaseListItem({ onPress, item }: any): JSX.Element {
713
return (
8-
<Pressable style={{ flex: 1 }} onPress={() => onPress(item)}>
14+
<Pressable
15+
onPress={() => onPress(item)}
16+
style={baseListItemStyle.container}
17+
>
918
<CollectionImage images={item.images} />
10-
<XStack mt={8}>
19+
<XStack mt={8} space={4}>
1120
<StyledText
12-
fontSize="$base"
21+
fontSize="$sm"
1322
numberOfLines={1}
1423
ellipsizeMode="tail"
24+
color="$baseTextHighEmphasis"
1525
maxWidth="90%"
1626
>
1727
{item.name}
1828
</StyledText>
29+
<StyledText
30+
fontSize="$sm"
31+
numberOfLines={1}
32+
ellipsizeMode="tail"
33+
color="$baseTextMedEmphasis"
34+
>
35+
{item.images.length}
36+
</StyledText>
1937
</XStack>
2038
</Pressable>
2139
);
2240
}
2341

42+
const baseListItemStyle = StyleSheet.create({
43+
container: {
44+
flex: 1,
45+
width: ITEM_WIDTH,
46+
height: ITEM_HEIGHT,
47+
},
48+
});
49+
2450
function ImageBox({ images }: { images: string[] }): JSX.Element {
2551
return (
26-
<View
27-
style={{
28-
height: 164,
29-
borderRadius: 12,
30-
backgroundColor: "white",
31-
flexDirection: "row",
32-
flexWrap: "wrap",
33-
gap: 12,
34-
padding: 12,
35-
justifyContent: "space-evenly",
36-
alignItems: "center",
37-
}}
38-
>
52+
<XStack flexWrap="wrap" gap={8} alignItems="center">
3953
{images.map((uri: string, index: number) => {
4054
return (
4155
<ProxyNFTImage
4256
key={`${index}${uri}`} // eslint-disable-line
4357
src={uri}
44-
size={64}
58+
size={IMAGE_WIDTH}
4559
style={{ borderRadius: 8 }}
4660
/>
4761
);
4862
})}
49-
</View>
63+
</XStack>
5064
);
5165
}
5266

5367
function CollectionImage({ images }: { images: string[] }): JSX.Element {
5468
if (images.length === 1) {
5569
return (
56-
<ProxyNFTImage size={164} src={images[0]} style={{ borderRadius: 12 }} />
70+
<ProxyNFTImage
71+
size={ITEM_WIDTH}
72+
src={images[0]}
73+
style={{ borderRadius: 12 }}
74+
/>
5775
);
5876
}
5977

packages/app-mobile/src/components/Icon.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import type { SvgProps } from "react-native-svg";
33
import { Pressable } from "react-native";
44

55
import { useTheme as useTamaguiTheme } from "@coral-xyz/tamagui";
6-
import { MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons";
6+
import MaterialCommunityIcons from "@expo/vector-icons/MaterialCommunityIcons";
7+
import MaterialIcons from "@expo/vector-icons/MaterialIcons";
78
import { themed as withThemedIcon } from "@tamagui/lucide-icons/src/themed";
89
import Svg, { Path, Rect } from "react-native-svg";
910

@@ -14,6 +15,14 @@ type TamaguiIconProp = {
1415
size?: number;
1516
};
1617

18+
export const ThemedMaterialIcon = withThemedIcon(
19+
({ name, color, size, style }) => {
20+
return (
21+
<MaterialIcons name={name} color={color} size={size} style={style} />
22+
);
23+
}
24+
);
25+
1726
export const IconButton = withThemedIcon(
1827
({ onPress, name, color, size, iconStyle }) => {
1928
return (

0 commit comments

Comments
 (0)