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

feat: TicketCard component #2198

Closed
wants to merge 13 commits into from
Prev Previous commit
fix passport-client and some server build errors
rrrliu committed Feb 1, 2025
commit f9f0be1eb130b2e7faceaee49b17c201b477bea5
Original file line number Diff line number Diff line change
@@ -267,7 +267,7 @@ const TextureSearchButton = forwardRef(
...props
}: React.ComponentPropsWithRef<"button"> & {
pending?: boolean;
backgroundImage: string;
backgroundImage?: string;
buttonStyle?: CSSProperties;
},
buttonRef: React.Ref<HTMLButtonElement>
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ export function FrogsModal({
const focusedPCD = pcds[focused ?? 0];

const onSwipeLeft = useCallback(() => {
setFocused((prev) => Math.min(pcds?.length - 1 ?? 0, (prev ?? 0) + 1));
setFocused((prev) => Math.min(pcds.length - 1, (prev ?? 0) + 1));
}, [pcds]);
const onSwipeRight = useCallback(() => {
setFocused((prev) => Math.max(0, (prev ?? 0) - 1));
Original file line number Diff line number Diff line change
@@ -431,7 +431,7 @@ export function useWrithingVoidParticles(
}

const absorberBaseSize =
Math.min(window.innerWidth, window.innerHeight) / 5 ?? 50;
Math.min(window.innerWidth, window.innerHeight) / 5;
const particles: RecursivePartial<ParticlesOptions> = {
shape: {
type: "image",
2 changes: 1 addition & 1 deletion apps/passport-server/src/database/queries/frogcrypto.ts
Original file line number Diff line number Diff line change
@@ -194,7 +194,7 @@ export async function sampleFrogData(
): Promise<FrogCryptoFrogData | undefined> {
const [biomeKeys, scalingFactors] = _.chain(biomes)
.toPairs()
.map(([biome, config]) => [biome, config?.dropWeightScaler])
.map(([biome, config]) => [biome, (config as any)?.dropWeightScaler])
.filter(([, scalingFactor]) => !!scalingFactor)
.unzip()
.value();
11 changes: 3 additions & 8 deletions packages/lib/passport-interface/src/daterange.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
export interface DateRange {
date_from: string;
date_to?: string | null;
}

export interface MaybeDateRange {
date_from?: string | null;
date_to?: string | null;
}
@@ -13,7 +8,7 @@ export interface FullDateRange {
date_to: string;
}

export function serializeDateRange(range: MaybeDateRange): string {
export function serializeDateRange(range: DateRange): string {
// Produces something like "2023-01-01T09:00:00.000Z/2023-01-01T17:00:00.000Z"
const { date_from, date_to } = range;
if (date_from && date_to) {
@@ -28,7 +23,7 @@ export function serializeDateRange(range: MaybeDateRange): string {
return "";
}

export function parseDateRange(serialized: string | undefined): MaybeDateRange {
export function parseDateRange(serialized: string | undefined): DateRange {
if (!serialized) {
return {};
}
@@ -64,7 +59,7 @@ const formatShort = (dateString: string): string => {
// 3) If only date_from is present, format as "Oct 10, 2025"
// 4) If only date_to is present, format as "Nov 10, 2025"
// 5) If neither date_from nor date_to are present, return an empty string
export function prettyPrintDateRange(range: MaybeDateRange): string {
export function prettyPrintDateRange(range: DateRange): string {
const { date_from, date_to } = range;

if (!date_from && !date_to) {