Skip to content

Commit dd5ad85

Browse files
authored
Merge pull request #55 from trevorpfiz/elektrikspark/ttp-91-refactor-backend-to-be-more-reusable
refactored backend with a reusable utility function. fixed frontend bugs for small screens.
2 parents ae64fb6 + c978c6c commit dd5ad85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+549
-1627
lines changed

apps/expo/app.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const defineConfig = (): ExpoConfig => ({
44
name: "PatientX Starter",
55
slug: "canvas-fhir",
66
scheme: "expo",
7-
version: "0.1.0",
7+
version: "0.1.1",
88
orientation: "portrait",
99
icon: "./assets/icon.png",
1010
userInterfaceStyle: "light",
@@ -20,7 +20,7 @@ const defineConfig = (): ExpoConfig => ({
2020
ios: {
2121
bundleIdentifier: "com.trusttheprocess.patientx",
2222
supportsTablet: true,
23-
buildNumber: "3",
23+
buildNumber: "2",
2424
},
2525
android: {
2626
package: "com.trusttheprocess.patientx",

apps/expo/src/app/(main)/portal/(tabs)/index.tsx

+25-23
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Text, View } from "react-native";
1+
import { ScrollView, Text, View } from "react-native";
22
import { useAtom } from "jotai";
33

44
import { patientIdAtom, patientNameAtom } from "~/app/(main)";
@@ -33,29 +33,31 @@ export default function Home() {
3333
}
3434

3535
return (
36-
<View className="flex-1 flex-col gap-4 bg-gray-100">
37-
{/* Welcome message */}
38-
<View className="bg-white px-6 py-6">
39-
<Text className="text-3xl font-semibold text-black">
40-
Good to see you, {patientName.firstName || "User"}
41-
</Text>
42-
</View>
36+
<ScrollView className="flex-1 bg-gray-100">
37+
<View className="flex-1 flex-col gap-4 bg-gray-100">
38+
{/* Welcome message */}
39+
<View className="bg-white px-6 py-6">
40+
<Text className="text-3xl font-semibold text-black">
41+
Good to see you, {patientName.firstName || "User"}
42+
</Text>
43+
</View>
4344

44-
{/* Next appointment */}
45-
<View className="flex-col gap-2 px-6">
46-
<Text className="text-xl font-semibold text-black">
47-
Your next appointment
48-
</Text>
49-
<NextAppointment />
50-
</View>
51-
{/* Submenu buttons */}
52-
<View>
53-
<SubmenuButtons />
54-
</View>
55-
{/* Tasks */}
56-
<View className="flex-1 pb-6">
57-
<Tasks />
45+
{/* Next appointment */}
46+
<View className="flex-col gap-2 px-6">
47+
<Text className="text-xl font-semibold text-black">
48+
Your next appointment
49+
</Text>
50+
<NextAppointment />
51+
</View>
52+
{/* Submenu buttons */}
53+
<View>
54+
<SubmenuButtons />
55+
</View>
56+
{/* Tasks */}
57+
<View className="flex-1 pb-6">
58+
<Tasks />
59+
</View>
5860
</View>
59-
</View>
61+
</ScrollView>
6062
);
6163
}

apps/expo/src/components/next-appointment.tsx

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
import React, { useMemo } from "react";
22
import { Text, TouchableOpacity, View } from "react-native";
3+
import { Calendar } from "react-native-calendars";
34
import { useRouter } from "expo-router";
45
import { useAtom } from "jotai";
56

67
import { patientIdAtom } from "~/app/(main)";
78
import { AppointmentCard } from "~/components/ui/cards/appointment-card";
89
import { LoaderComponent } from "~/components/ui/loader";
10+
import {
11+
Card,
12+
CardContent,
13+
CardDescription,
14+
CardFooter,
15+
CardHeader,
16+
CardTitle,
17+
} from "~/components/ui/rn-ui/components/ui/card";
918
import { api } from "~/utils/api";
1019
import { mapPractitionerIdsToNames } from "~/utils/scheduling";
1120

@@ -45,7 +54,7 @@ export default function NextAppointment() {
4554
}, [appointmentQuery.data?.entry]);
4655

4756
if (isLoading) {
48-
return <LoaderComponent className="mt-12" />;
57+
return <LoaderComponent className="mb-14 mt-16" />;
4958
}
5059

5160
if (isError) {
@@ -72,7 +81,13 @@ export default function NextAppointment() {
7281
practitionerInfo={practitionerInfo}
7382
/>
7483
) : (
75-
<Text className="p-8">{`No appointments found.`}</Text>
84+
<Card className="shadow-none">
85+
<CardContent className="px-12 py-12">
86+
<Text className="text-lg">
87+
You do not have any appointments scheduled at this time
88+
</Text>
89+
</CardContent>
90+
</Card>
7691
)}
7792
</TouchableOpacity>
7893
);

apps/expo/src/components/tasks.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default function Tasks() {
6767
<TouchableOpacity activeOpacity={0.8} className="flex-1">
6868
<View
6969
className={cn(
70-
"ml-4 w-52 flex-1 flex-col justify-between gap-4 rounded-xl p-2",
70+
"ml-4 w-52 flex-1 flex-col justify-between gap-16 rounded-xl p-2",
7171
{
7272
"border-blue-400 bg-blue-500":
7373
item.resource.status === "requested",
@@ -78,7 +78,7 @@ export default function Tasks() {
7878
},
7979
)}
8080
>
81-
<Text className="text-sm font-medium text-white">
81+
<Text className="line-clamp-4 text-sm font-medium text-white">
8282
{item.resource.description}
8383
</Text>
8484
{item.resource.status !== "completed" && (
+58-46
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,65 @@
11
import * as React from "react";
2+
import { Dimensions, View } from "react-native";
23
import type { SvgProps } from "react-native-svg";
34
import Svg, { Path } from "react-native-svg";
45

6+
const originalWidth = 692.68;
7+
const originalHeight = 520.455;
8+
const aspectRatio = originalWidth / originalHeight;
9+
510
const SvgComponent = (props: SvgProps) => (
6-
<Svg width={692.68} height={520.455} {...props}>
7-
<Path
8-
fill="#3f3d56"
9-
d="M0 518.718c0 .872.7 1.571 1.571 1.571H691.11c.872 0 1.571-.7 1.571-1.57 0-.872-.7-1.572-1.57-1.572H1.57c-.871 0-1.571.7-1.571 1.571Z"
10-
/>
11-
<Path
12-
fill="#2f2e41"
13-
d="M304.293 474.426h30.425l3.575 16s23 27-3 27-70 8-70-2 32-16 32-16l7-25ZM495.518 398.068l-.573-30.42 15.93-3.876s26.562-23.504 27.051 2.491 9.317 69.837-.681 70.026-16.6-31.693-16.6-31.693l-25.127-6.528Z"
14-
/>
15-
<Path
16-
fill="#ffb6b6"
17-
d="m405.212 58.98 6.207 22.965-27.93 14.275-10.55-30.412 32.273-6.827z"
18-
/>
19-
<Path
20-
fill="#ffb6b6"
21-
d="M386.956 5.875c18.057 0 32.696 14.638 32.696 32.696s-14.639 32.696-32.696 32.696-32.697-14.639-32.697-32.696S368.9 5.875 386.956 5.875ZM424.403 205.065a23.095 23.095 0 0 1 7.587-7.84l17.846-34.176 16.014 8.967-19.827 33.702a23.094 23.094 0 0 1-3.427 10.354c-4.78 7.898-12.725 11.832-17.75 8.792s-5.223-11.905-.443-19.8Z"
22-
/>
23-
<Path
24-
fill="#2f2e41"
25-
d="m365.293 204.426 47.865-.315s21.768 40-2.232 81l-4 84 100-5V400.4s-130 17.712-135 7.712-15-72.428-15-72.428l-10.098 17.77-9.902 128.658h-30.917l-6.803-139 59.72-111 6.367-27.685Z"
26-
/>
27-
<Path
28-
fill="#3b82f6"
29-
d="m376.684 77.762 36.633-2.442 13.432 41.517-13.432 87.92-50.065 8.547-10.99-91.582 24.422-43.96z"
30-
/>
31-
<Path
32-
fill="#3b82f6"
33-
d="m414.39 81.426-3.515 40.296 32.97 19.537-12.552 45.167 24.762 13.446s25.643-47.623 20.759-63.497-62.425-54.95-62.425-54.95Z"
34-
/>
35-
<Path
36-
d="M405.327 117.213s.392 71.433-15.821 73.323-27.49-2.646-27.49-2.646"
37-
opacity={0.1}
38-
/>
39-
<Path
40-
fill="#ffb6b6"
41-
d="M299.11 150.778a23.095 23.095 0 0 1 10.37 3.393l38.539 1.094-1.057 18.323-38.98-3.084a23.094 23.094 0 0 1-10.81 1.45c-9.193-.843-16.207-6.266-15.67-12.115s8.42-9.905 17.608-9.061Z"
42-
/>
43-
<Path
44-
fill="#3b82f6"
45-
d="m319.111 173.474-.407-.159 5.195-21.387 34.026-.177 6.36-52.698c1.246-10.334 10.036-18.127 20.445-18.127a20.63 20.63 0 0 1 15.34 6.847 20.602 20.602 0 0 1 5.135 15.973c-3.888 35.565-11.122 78.652-23.508 81.956-2.355.628-5.113.902-8.136.902-20.417 0-52.88-12.52-54.45-13.13Z"
46-
/>
47-
<Path
48-
fill="#2f2e41"
49-
d="M367.962 21.603c-2.345 4.055-4.784 8.218-8.494 11.08-3.71 2.86-9.05 4.132-13.135 1.839-4.015-2.254-5.743-7.487-4.754-11.984s4.242-8.233 8.07-10.79 8.233-4.092 12.583-5.6c6.649-2.304 13.347-4.62 20.311-5.62 18.999-2.73 39.18 5.294 51.118 20.323 5.637 7.095 9.433 15.444 13.172 23.7 3.057 6.747 6.181 13.854 5.64 21.242-.396 5.417-2.648 11.35.268 15.932 1.469 2.308 3.975 3.707 6.008 5.538s3.702 4.67 2.698 7.215c-1.027 2.605-4.265 3.544-5.992 5.748-2.961 3.777-.438 9.303 2.546 13.062s6.647 7.974 5.703 12.68c-.68 3.394-3.764 5.922-7.098 6.855s-6.89.538-10.294-.09c-16.64-3.074-32.195-11.74-43.566-24.272s-18.488-28.854-19.935-45.713c-.636-7.423-.212-14.962-1.675-22.267-1.462-7.306-5.25-14.66-11.914-17.993"
50-
/>
51-
</Svg>
11+
<View style={{ width: Dimensions.get("window").width * 1.5, aspectRatio }}>
12+
<Svg
13+
width="100%"
14+
height="100%"
15+
viewBox={`0 0 ${originalWidth} ${originalHeight}`}
16+
{...props}
17+
>
18+
<Path
19+
fill="#3f3d56"
20+
d="M0 518.718c0 .872.7 1.571 1.571 1.571H691.11c.872 0 1.571-.7 1.571-1.57 0-.872-.7-1.572-1.57-1.572H1.57c-.871 0-1.571.7-1.571 1.571Z"
21+
/>
22+
<Path
23+
fill="#2f2e41"
24+
d="M304.293 474.426h30.425l3.575 16s23 27-3 27-70 8-70-2 32-16 32-16l7-25ZM495.518 398.068l-.573-30.42 15.93-3.876s26.562-23.504 27.051 2.491 9.317 69.837-.681 70.026-16.6-31.693-16.6-31.693l-25.127-6.528Z"
25+
/>
26+
<Path
27+
fill="#ffb6b6"
28+
d="m405.212 58.98 6.207 22.965-27.93 14.275-10.55-30.412 32.273-6.827z"
29+
/>
30+
<Path
31+
fill="#ffb6b6"
32+
d="M386.956 5.875c18.057 0 32.696 14.638 32.696 32.696s-14.639 32.696-32.696 32.696-32.697-14.639-32.697-32.696S368.9 5.875 386.956 5.875ZM424.403 205.065a23.095 23.095 0 0 1 7.587-7.84l17.846-34.176 16.014 8.967-19.827 33.702a23.094 23.094 0 0 1-3.427 10.354c-4.78 7.898-12.725 11.832-17.75 8.792s-5.223-11.905-.443-19.8Z"
33+
/>
34+
<Path
35+
fill="#2f2e41"
36+
d="m365.293 204.426 47.865-.315s21.768 40-2.232 81l-4 84 100-5V400.4s-130 17.712-135 7.712-15-72.428-15-72.428l-10.098 17.77-9.902 128.658h-30.917l-6.803-139 59.72-111 6.367-27.685Z"
37+
/>
38+
<Path
39+
fill="#3b82f6"
40+
d="m376.684 77.762 36.633-2.442 13.432 41.517-13.432 87.92-50.065 8.547-10.99-91.582 24.422-43.96z"
41+
/>
42+
<Path
43+
fill="#3b82f6"
44+
d="m414.39 81.426-3.515 40.296 32.97 19.537-12.552 45.167 24.762 13.446s25.643-47.623 20.759-63.497-62.425-54.95-62.425-54.95Z"
45+
/>
46+
<Path
47+
d="M405.327 117.213s.392 71.433-15.821 73.323-27.49-2.646-27.49-2.646"
48+
opacity={0.1}
49+
/>
50+
<Path
51+
fill="#ffb6b6"
52+
d="M299.11 150.778a23.095 23.095 0 0 1 10.37 3.393l38.539 1.094-1.057 18.323-38.98-3.084a23.094 23.094 0 0 1-10.81 1.45c-9.193-.843-16.207-6.266-15.67-12.115s8.42-9.905 17.608-9.061Z"
53+
/>
54+
<Path
55+
fill="#3b82f6"
56+
d="m319.111 173.474-.407-.159 5.195-21.387 34.026-.177 6.36-52.698c1.246-10.334 10.036-18.127 20.445-18.127a20.63 20.63 0 0 1 15.34 6.847 20.602 20.602 0 0 1 5.135 15.973c-3.888 35.565-11.122 78.652-23.508 81.956-2.355.628-5.113.902-8.136.902-20.417 0-52.88-12.52-54.45-13.13Z"
57+
/>
58+
<Path
59+
fill="#2f2e41"
60+
d="M367.962 21.603c-2.345 4.055-4.784 8.218-8.494 11.08-3.71 2.86-9.05 4.132-13.135 1.839-4.015-2.254-5.743-7.487-4.754-11.984s4.242-8.233 8.07-10.79 8.233-4.092 12.583-5.6c6.649-2.304 13.347-4.62 20.311-5.62 18.999-2.73 39.18 5.294 51.118 20.323 5.637 7.095 9.433 15.444 13.172 23.7 3.057 6.747 6.181 13.854 5.64 21.242-.396 5.417-2.648 11.35.268 15.932 1.469 2.308 3.975 3.707 6.008 5.538s3.702 4.67 2.698 7.215c-1.027 2.605-4.265 3.544-5.992 5.748-2.961 3.777-.438 9.303 2.546 13.062s6.647 7.974 5.703 12.68c-.68 3.394-3.764 5.922-7.098 6.855s-6.89.538-10.294-.09c-16.64-3.074-32.195-11.74-43.566-24.272s-18.488-28.854-19.935-45.713c-.636-7.423-.212-14.962-1.675-22.267-1.462-7.306-5.25-14.66-11.914-17.993"
61+
/>
62+
</Svg>
63+
</View>
5264
);
5365
export default SvgComponent;

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "create-t3-turbo",
2+
"name": "patientx-fhir-starter",
33
"private": true,
44
"engines": {
55
"node": ">=18.18.2"

0 commit comments

Comments
 (0)