Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions mobileapp/__tests__/transfer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ jest.mock("expo-router", () => ({
},
}));

jest.mock("@stellar/stellar-sdk", () => ({
FederationServer: undefined,
}));

jest.mock("../src/services/stellarWallet", () => ({
getLocalKeypair: jest.fn(() => null),
checkFreighter: jest.fn(),
Expand Down Expand Up @@ -775,4 +779,41 @@ describe("TransferScreen – Registry Warning Banners", () => {
});
expect(renderResult.getByTestId("summary-privacy-value").props.children).toBe("FRIENDS");
});

it("uses the Naira keypad and prevents malformed decimal amounts", async () => {
mockFetch.mockResolvedValue({
ok: true,
status: 200,
json: async () => [],
});

const renderResult = render(<TransferScreenWithBoundary />);
await advanceToStep1(renderResult);

expect(
renderResult.getByTestId("transfer-amount-currency").props.children
).toBe("₦");
expect(
renderResult.getByTestId("transfer-amount-value").props.children
).toBe("0");

await act(async () => {
fireEvent.press(renderResult.getByTestId("keypad-decimal"));
fireEvent.press(renderResult.getByTestId("keypad-key-1"));
fireEvent.press(renderResult.getByTestId("keypad-key-2"));
fireEvent.press(renderResult.getByTestId("keypad-decimal"));
fireEvent.press(renderResult.getByTestId("keypad-key-3"));
});

expect(
renderResult.getByTestId("transfer-amount-value").props.children
).toBe("0.123");

await act(async () => {
fireEvent.press(renderResult.getByTestId("keypad-backspace"));
});
expect(
renderResult.getByTestId("transfer-amount-value").props.children
).toBe("0.12");
});
});
40 changes: 31 additions & 9 deletions mobileapp/app/(personal)/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ export default function HomeScreen() {
{
opacity: earningOuterGlowAnim.interpolate({
inputRange: [0, 1],
outputRange: [0, 0.28],
outputRange: [0, 0.08],
}),
transform: [
{
Expand All @@ -1071,7 +1071,7 @@ export default function HomeScreen() {
{
opacity: earningGlowAnim.interpolate({
inputRange: [0, 1],
outputRange: [0.12, 0.65],
outputRange: [0.04, 0.2],
}),
transform: [
{
Expand Down Expand Up @@ -2196,8 +2196,8 @@ const styles = StyleSheet.create({
right: -8,
bottom: -8,
borderRadius: 30,
backgroundColor: "#34D399",
shadowColor: "#34D399",
backgroundColor: "#2F7655",
shadowColor: "#2F7655",
shadowOffset: { width: 0, height: 0 },
shadowOpacity: 0.7,
shadowRadius: 22,
Expand All @@ -2213,14 +2213,14 @@ const styles = StyleSheet.create({
elevation: 4,
},
earningBalanceCard: {
backgroundColor: "#0F3D2E",
backgroundColor: "#0E3328",
borderRadius: 22,
paddingVertical: 18,
paddingHorizontal: 18,
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center",
shadowColor: "#0F3D2E",
shadowColor: "#0E3328",
shadowOffset: { width: 0, height: 8 },
shadowOpacity: 0.18,
shadowRadius: 16,
Expand Down Expand Up @@ -2418,7 +2418,7 @@ const styles = StyleSheet.create({
earningLabel: {
fontSize: 13,
fontFamily: "Outfit_500Medium",
color: "#9FD9B5",
color: "#B5D9C5",
marginBottom: 6,
},
earningAmount: {
Expand All @@ -2435,6 +2435,17 @@ const styles = StyleSheet.create({
earningStatusRow: {
flexDirection: "row",
alignItems: "center",
alignSelf: "flex-start",
borderRadius: 12,
paddingHorizontal: 10,
paddingVertical: 6,
marginBottom: 8,
},
earningStatusActive: {
backgroundColor: "rgba(167, 243, 192, 0.13)",
},
earningStatusInactive: {
backgroundColor: "rgba(255, 255, 255, 0.08)",
},
earningStatusDot: {
width: 7,
Expand All @@ -2446,7 +2457,18 @@ const styles = StyleSheet.create({
earningStatusText: {
fontSize: 12,
fontFamily: "Outfit_500Medium",
color: "#BFE9CF",
color: "#D7F0DF",
},
earningStatusDotInactive: {
backgroundColor: "#A5B4AC",
},
earningStatusTextInactive: {
color: "#C3CEC8",
},
earningHint: {
fontSize: 12,
fontFamily: "Outfit_400Regular",
color: "#9EB9AA",
},
earningErrorText: {
fontSize: 14,
Expand Down Expand Up @@ -2475,7 +2497,7 @@ const styles = StyleSheet.create({
width: 40,
height: 40,
borderRadius: 20,
backgroundColor: "rgba(167, 243, 192, 0.14)",
backgroundColor: "rgba(167, 243, 192, 0.1)",
justifyContent: "center",
alignItems: "center",
},
Expand Down
Loading