Skip to content

Commit

Permalink
suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
UdaySagar-Git committed Jul 12, 2024
1 parent f6c39b3 commit 913f898
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/Common/hooks/useAuthUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type SignInReturnType = RequestResult<JwtTokenObtainPair>;

type AuthContextType = {
user: UserModel | undefined;
refetchUser: () => Promise<void>;
signIn: (creds: LoginCredentials) => Promise<SignInReturnType>;
signOut: () => Promise<void>;
};
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Facility/ConsultationDoctorNotes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const ConsultationDoctorNotes = (props: ConsultationDoctorNotesProps) => {
isTab2Active={mode === "default-view"}
/>
</div>
<div className="relative mx-3 flex grow flex-col rounded-lg border border-gray-300 bg-white px-2 sm:mx-10 sm:px-5 sm:pt-8">
<div className="relative flex grow flex-col rounded-lg border border-gray-300 bg-white px-2 sm:mx-10 sm:px-5 sm:pt-8 md:mx-3">
<div className="absolute inset-x-0 top-0 z-10 flex bg-gray-200 text-sm shadow-md">
{Object.values(PATIENT_NOTES_THREADS).map((current) => (
<button
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Facility/DoctorNote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const DoctorNote = (props: DoctorNoteProps) => {

return (
<div
className="ml-2 mt-4 flex h-[400px] grow flex-col-reverse overflow-y-scroll bg-white"
className="mt-4 flex h-[400px] grow flex-col-reverse overflow-y-scroll bg-white sm:ml-2"
id="patient-notes-list"
>
{state.notes.length ? (
Expand Down
8 changes: 4 additions & 4 deletions src/Components/Facility/PatientNoteCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const PatientNoteCard = ({
setFileState({
...file_state,
open: true,
name: data.name as string,
name: data.name?.split(".")[0] ?? "file",
extension,
isImage: ExtImage.includes(extension),
});
Expand Down Expand Up @@ -150,7 +150,7 @@ const PatientNoteCard = ({
{" "}
<div
className={classNames(
"flex flex-col rounded-lg border border-gray-300 bg-white px-3 py-1 text-gray-800",
"group flex flex-col rounded-lg border border-gray-300 bg-white px-3 py-1 text-gray-800",
note.user_type === "RemoteSpecialist" && "border-primary-400",
)}
>
Expand All @@ -164,7 +164,7 @@ const PatientNoteCard = ({
fixedWidth={false}
className="h-[80vh] w-full md:h-screen"
/>
<div className="group relative flex items-center gap-2">
<div className="relative flex items-center gap-2">
<div className="flex h-9 w-9 items-center justify-center rounded-full bg-primary text-lg font-semibold text-white">
{note.created_by_object?.first_name[0]}
</div>
Expand Down Expand Up @@ -219,7 +219,7 @@ const PatientNoteCard = ({
)
}
</div>
<div className="gap-2-top-4 absolute right-0 top-0 z-10 flex gap-2 opacity-0 transition-opacity duration-100 group-hover:opacity-100 ">
<div className="right-0 top-0 z-10 flex gap-2 transition-opacity duration-100 group-hover:opacity-100 max-sm:flex-col sm:absolute sm:opacity-0 ">
{!disableEdit &&
// note.created_by_object.id === authUser.id &&
!isEditing && (
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Users/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const editFormReducer = (state: State, action: Action) => {
};

export default function UserProfile() {
const { signOut } = useAuthContext();
const { signOut, refetchUser } = useAuthContext();
const [states, dispatch] = useReducer(editFormReducer, initialState);
const [editProfilePic, setEditProfilePic] = useState(false);
const [updateStatus, setUpdateStatus] = useState({
Expand Down Expand Up @@ -456,7 +456,7 @@ export default function UserProfile() {
<div>
<ProfilePicUploadModal
open={editProfilePic}
onSave={() => window.location.reload()}
onSave={() => refetchUser()}
onClose={() => setEditProfilePic(false)}
onDelete={() => refetchUserData()}
onRefetch={() => refetchUserData()}
Expand Down
9 changes: 8 additions & 1 deletion src/Providers/AuthUserProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,14 @@ export default function AuthUserProvider({ children, unauthorized }: Props) {
}

return (
<AuthUserContext.Provider value={{ signIn, signOut, user }}>
<AuthUserContext.Provider
value={{
signIn,
signOut,
user,
refetchUser: refetch as unknown as () => Promise<void>,
}}
>
{!res.ok || !user ? unauthorized : children}
</AuthUserContext.Provider>
);
Expand Down
2 changes: 1 addition & 1 deletion src/Routers/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export default function AppRouter() {
id="pages"
className="flex-1 overflow-y-scroll pb-4 focus:outline-none md:py-0"
>
<div className="max-w-8xl mx-auto p-3">{pages}</div>
<div className="max-w-8xl mx-auto p-1 sm:p-2 md:p-3">{pages}</div>
</main>
</div>
</div>
Expand Down

0 comments on commit 913f898

Please sign in to comment.