Skip to content

Commit 4f751a4

Browse files
gambinishabretonc7sclaudeMatt561metamaskbot
authored
feat: Perps list display (#17078)
## **Description** Based of of initial draft here: #17070 and rebased to final feature branch for perps. This adds a view to explore Perps Markets in a list form, including a search bar to filter results by. ## **Changelog** CHANGELOG entry: Add Perpetual Markets List ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** https://github.com/user-attachments/assets/20f4ca69-6116-49a4-930c-cd05a1e1d214 ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: Arthur Breton <arthur.breton@consensys.net> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Matthew Grainger <matthew.grainger@consensys.net> Co-authored-by: Matthew Grainger <46547583+Matt561@users.noreply.github.com> Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com>
1 parent 91bd5b2 commit 4f751a4

24 files changed

+3199
-16
lines changed

app/components/UI/Perps/Views/PerpsDepositAmountView/PerpsDepositAmountView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ const PerpsDepositAmountView: React.FC<PerpsDepositAmountViewProps> = () => {
442442
const depositResult = await deposit(depositParams);
443443

444444
if (depositResult.success && depositResult.txHash) {
445-
navigation.navigate('PerpsDepositProcessing', {
445+
navigation.navigate(Routes.PERPS.DEPOSIT_PROCESSING, {
446446
amount: sourceAmount,
447447
fromToken: sourceToken.symbol,
448448
transactionHash: depositResult.txHash,
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
import { StyleSheet } from 'react-native';
2+
import { Theme } from '../../../../../util/theme/models';
3+
4+
const styleSheet = (params: { theme: Theme }) => {
5+
const { theme } = params;
6+
const { colors } = theme;
7+
8+
return StyleSheet.create({
9+
container: {
10+
flex: 1,
11+
backgroundColor: colors.background.default,
12+
},
13+
header: {
14+
flexDirection: 'row',
15+
justifyContent: 'space-between',
16+
alignItems: 'center',
17+
paddingHorizontal: 16,
18+
paddingVertical: 8,
19+
marginVertical: 16,
20+
},
21+
headerSpacer: {
22+
width: 24,
23+
},
24+
headerTitle: {
25+
flex: 1,
26+
textAlign: 'center',
27+
},
28+
closeButton: {
29+
padding: 4,
30+
},
31+
listContainer: {
32+
flex: 1,
33+
},
34+
listHeader: {
35+
flexDirection: 'row',
36+
justifyContent: 'space-between',
37+
alignItems: 'center',
38+
paddingHorizontal: 16,
39+
marginBottom: 8,
40+
marginTop: 30,
41+
},
42+
listHeaderLeft: {
43+
flex: 1,
44+
},
45+
listHeaderRight: {
46+
flex: 1,
47+
alignItems: 'flex-end',
48+
},
49+
errorContainer: {
50+
flex: 1,
51+
justifyContent: 'center',
52+
alignItems: 'center',
53+
paddingHorizontal: 24,
54+
},
55+
errorText: {
56+
textAlign: 'center',
57+
marginBottom: 16,
58+
},
59+
flashListContent: {
60+
paddingBottom: 16,
61+
},
62+
skeletonContainer: {
63+
flexDirection: 'row',
64+
justifyContent: 'space-between',
65+
alignItems: 'center',
66+
paddingHorizontal: 16,
67+
paddingVertical: 16,
68+
minHeight: 88,
69+
},
70+
skeletonLeftSection: {
71+
flexDirection: 'row',
72+
alignItems: 'center',
73+
flex: 1,
74+
},
75+
skeletonAvatar: {
76+
width: 40,
77+
height: 40,
78+
borderRadius: 20,
79+
marginRight: 16,
80+
},
81+
skeletonTokenInfo: {
82+
flex: 1,
83+
},
84+
skeletonTokenHeader: {
85+
flexDirection: 'row',
86+
alignItems: 'center',
87+
marginBottom: 6,
88+
},
89+
skeletonTokenSymbol: {
90+
width: 60,
91+
height: 16,
92+
borderRadius: 4,
93+
marginRight: 8,
94+
},
95+
skeletonLeverage: {
96+
width: 30,
97+
height: 14,
98+
borderRadius: 4,
99+
},
100+
skeletonVolume: {
101+
width: 80,
102+
height: 12,
103+
borderRadius: 4,
104+
},
105+
skeletonRightSection: {
106+
alignItems: 'flex-end',
107+
flex: 1,
108+
},
109+
skeletonPrice: {
110+
width: 90,
111+
height: 16,
112+
borderRadius: 4,
113+
marginBottom: 6,
114+
},
115+
skeletonChange: {
116+
width: 70,
117+
height: 14,
118+
borderRadius: 4,
119+
},
120+
animatedListContainer: {
121+
flex: 1,
122+
paddingHorizontal: 16,
123+
},
124+
searchContainer: {
125+
paddingHorizontal: 16,
126+
},
127+
searchInputContainer: {
128+
flexDirection: 'row',
129+
alignItems: 'center',
130+
backgroundColor: colors.background.muted,
131+
borderRadius: 12,
132+
paddingHorizontal: 16,
133+
paddingVertical: 12,
134+
},
135+
searchIcon: {
136+
marginRight: 10,
137+
color: colors.icon.muted,
138+
},
139+
searchInput: {
140+
flex: 1,
141+
fontSize: 16,
142+
color: colors.text.default,
143+
},
144+
clearButton: {
145+
padding: 4,
146+
marginLeft: 8,
147+
},
148+
});
149+
};
150+
151+
export default styleSheet;

0 commit comments

Comments
 (0)