Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Consolas font for the cards #92

Merged
merged 5 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ web-build/
build-*.ipa

ios/
android/
android/

.env
3 changes: 2 additions & 1 deletion App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import "expo-dev-client";

import { LinkingOptions, NavigationContainer } from "@react-navigation/native";
import { useFonts } from 'expo-font';
import * as Linking from "expo-linking";
import * as SecureStorage from "expo-secure-store";
import { useState, useEffect, useCallback } from "react";
import { StatusBar, useColorScheme } from "react-native";
import { SafeAreaProvider } from "react-native-safe-area-context";
import { SWRConfig } from "swr";
import { useFonts } from 'expo-font';

import AuthContext from "./src/auth";
import { getStateFromPath } from "./src/getStateFromPath";
Expand Down Expand Up @@ -52,6 +52,7 @@ export default function App() {
const [fontsLoaded] = useFonts({
'JetBrainsMono-Regular': require('./assets/fonts/JetBrainsMono-Regular.ttf'),
'JetBrainsMono-Bold': require('./assets/fonts/JetBrainsMono-Bold.ttf'),
'Consolas-Bold': require('./assets/fonts/CONSOLAB.ttf'),
});

const [isLoading, setIsLoading] = useState(true);
Expand Down
Binary file added assets/fonts/CONSOLAB.ttf
Binary file not shown.
30 changes: 15 additions & 15 deletions src/components/PaymentCard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { useTheme } from "@react-navigation/native";
import capitalize from "lodash/capitalize";
import { Dimensions, Text, View, ViewProps, StyleSheet, type AppStateStatus, AppState} from "react-native";
import * as Geopattern from "geopattern";
import { useEffect, useRef, useState } from "react";
import { Dimensions, Text, View, ViewProps, type AppStateStatus, AppState } from "react-native";
import { SvgXml } from 'react-native-svg';

// import Animated, {
// SharedTransition,
// withSpring,
Expand All @@ -13,11 +15,8 @@ import { palette } from "../theme";
import { redactedCardNumber, renderCardNumber } from "../util";

import CardChip from "./cards/CardChip";
import CardHCB from "./cards/CardHCB";

import * as Geopattern from "geopattern";
import { SvgXml } from 'react-native-svg';
import CardFrozen from "./cards/CardFrozen";
import CardHCB from "./cards/CardHCB";

// const transition = SharedTransition.custom((values) => {
// "worklet";
Expand All @@ -36,7 +35,7 @@ export default function PaymentCard({
}: ViewProps & { card: Card; details?: CardDetails }) {
const { colors: themeColors, dark } = useTheme();

const pattern = Geopattern.generate(card.id, {scalePattern: 1.1, grayscale: card.status == 'frozen' || card.status == 'inactive' || card.status == 'canceled' ? true : false}).toString();
const pattern = Geopattern.generate(card.id, { scalePattern: 1.1, grayscale: card.status == 'frozen' || card.status == 'inactive' || card.status == 'canceled' ? true : false }).toString();
const appState = useRef(AppState.currentState);
const [isAppInBackground, setisAppInBackground] = useState(appState.current);

Expand All @@ -58,7 +57,7 @@ export default function PaymentCard({
return (
<View
style={{
backgroundColor: card.type == "physical" ? 'black' : themeColors.card,
backgroundColor: card.type == "physical" ? 'black' : themeColors.card,
padding: 30,
width: width * 0.86,
height: width * 0.86 / 1.588,
Expand Down Expand Up @@ -86,19 +85,19 @@ export default function PaymentCard({
<SvgXml
key={index}
xml={pattern}
height={width * 0.86 / 1.588}
height={width * 0.86 / 1.588}
/>
))}
</View>
)}

{card.type == "physical" && <View style={{top: 5, right: 5, position: "absolute"}}><CardHCB /></View>}
{card.status == "frozen" && <View style={{top: 25, left: 25, position: "absolute"}}><CardFrozen /></View>}
{card.type == "physical" && <View style={{ top: 5, right: 5, position: "absolute" }}><CardHCB /></View>}
{card.status == "frozen" && <View style={{ top: 25, left: 25, position: "absolute" }}><CardFrozen /></View>}

{card.type == "physical" && <CardChip />}
<Text
style={{
color:'white',
color: 'white',
fontSize: 18,
marginBottom: 4,
fontFamily: "JetBrains Mono",
Expand All @@ -113,7 +112,7 @@ export default function PaymentCard({
<Text
style={{
color: 'white',
fontFamily: "JetBrains Mono Bold",
fontFamily: "Consolas-Bold",
fontSize: 18,
width: 180,
textTransform: 'uppercase',
Expand All @@ -124,12 +123,13 @@ export default function PaymentCard({
{card.user ? card.user.name : card.organization.name}
</Text>
</View>
<View style={{marginLeft: 'auto'}}>
<View style={{ marginLeft: 'auto' }}>
<Text
style={{
color: 'white',
fontSize: 14,
fontFamily: "JetBrains Mono",
fontFamily: "Consolas-Bold",
fontWeight: 700,
textTransform: 'uppercase',
backgroundColor: card.type == 'virtual' ? "rgba(255, 255, 255, 0.05)" : "rgba(255, 255, 255, 0.08)",
borderRadius: 15,
Expand Down