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 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
5 changes: 3 additions & 2 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ const linking: LinkingOptions<TabParamList> = {

export default function App() {
const [fontsLoaded] = useFonts({
"JetBrainsMono-Regular": require("./assets/fonts/JetBrainsMono-Regular.ttf"),
"JetBrainsMono-Bold": require("./assets/fonts/JetBrainsMono-Bold.ttf"),
'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.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@
"typescript": "~5.3.3"
},
"private": true
}
}
26 changes: 14 additions & 12 deletions src/components/PaymentCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useTheme } from "@react-navigation/native";
import Constants from "expo-constants";
import * as Geopattern from "geopattern";

Check failure on line 3 in src/components/PaymentCard.tsx

View workflow job for this annotation

GitHub Actions / Typecheck

Could not find a declaration file for module 'geopattern'. '/home/runner/work/hcb-mobile/hcb-mobile/node_modules/geopattern/lib/index.js' implicitly has an 'any' type.
import { useEffect, useRef, useState } from "react";
import {
Text,
Expand Down Expand Up @@ -35,13 +35,14 @@
details,
onCardLoad,
...props
}: ViewProps & {
card: Card;
details?: CardDetails;
}: ViewProps & {
card: Card;
details?: CardDetails;
onCardLoad?: (cardId: string, dimensions: { width: number; height: number }) => void;
}) {
const { colors: themeColors, dark } = useTheme();


const patternForMeasurements = Geopattern.generate(card.id, {
scalePattern: 1.1,
grayscale: card.status != "active",
Expand Down Expand Up @@ -71,13 +72,13 @@
if ((card as GrantCard).amount_cents) {
card.type = "virtual";
}


useEffect(() => {
if (onCardLoad) {
onCardLoad(card.id, { width: svgWidth, height: svgHeight });
}
}, []);

Check warning on line 81 in src/components/PaymentCard.tsx

View workflow job for this annotation

GitHub Actions / ESLint

React Hook useEffect has missing dependencies: 'card.id', 'onCardLoad', 'svgHeight', and 'svgWidth'. Either include them or remove the dependency array. If 'onCardLoad' changes too often, find the parent component that defines it and wrap that definition in useCallback

useEffect(() => {
const subscription = AppState.addEventListener(
Expand Down Expand Up @@ -119,7 +120,7 @@
height: (width * 0.86) / 1.5,
}}
>
{ Constants.platform?.android ? (
{Constants.platform?.android ? (
<SvgXml xml={patternForMeasurements} width={svgWidth} height={svgHeight} />
) : (
<SvgUri uri={pattern} width={svgWidth} height={svgHeight} />
Expand All @@ -145,7 +146,7 @@
color: "white",
fontSize: 18,
marginBottom: 4,
fontFamily: "JetBrainsMono-Regular",
fontFamily: "Consolas-Bold",
}}
>
{details && isAppInBackground === "active"
Expand All @@ -156,8 +157,8 @@
<View>
<Text
style={{
color: "white",
fontFamily: "JetBrainsMono-Bold",
color: 'white',
fontFamily: "Consolas-Bold",
fontSize: 18,
width: 180,
textTransform: "uppercase",
Expand All @@ -173,12 +174,13 @@
style={{
color: "white",
fontSize: 14,
fontFamily: "JetBrainsMono-Regular",
fontFamily: "Consolas-Bold",
fontWeight: 700,
textTransform: "uppercase",
backgroundColor:
card.type == "virtual"
? "rgba(255, 255, 255, 0.05)"
: "rgba(255, 255, 255, 0.08)",
card.type == "virtual"
? "rgba(255, 255, 255, 0.05)"
: "rgba(255, 255, 255, 0.08)",
borderRadius: 15,
paddingHorizontal: 10,
paddingVertical: 3,
Expand Down
Loading