From aace3c5e773041a422c4e6d2e7900b643df9cb07 Mon Sep 17 00:00:00 2001 From: karan Date: Sun, 24 Sep 2023 19:15:47 +0530 Subject: [PATCH 1/2] fix: explore org button position and bug fixes Signed-off-by: karan --- src/components/Profile/EditUserProfile.tsx | 46 +++++++++---------- .../Resources/Schema/SchemasList.tsx | 4 +- .../organization/EditOrgdetailsModal.tsx | 2 +- src/pages/index.astro | 13 ++++-- 4 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/components/Profile/EditUserProfile.tsx b/src/components/Profile/EditUserProfile.tsx index 216e829bc..16503a359 100644 --- a/src/components/Profile/EditUserProfile.tsx +++ b/src/components/Profile/EditUserProfile.tsx @@ -1,13 +1,12 @@ import { useEffect, useState } from "react"; import type { UserProfile } from "./interfaces"; -import { getFromLocalStorage, getUserProfile, updateUserProfile } from "../../api/Auth"; -import { IMG_MAX_HEIGHT, IMG_MAX_WIDTH, apiStatusCodes, imageSizeAccepted, storageKeys } from "../../config/CommonConstant"; +import { setToLocalStorage, updateUserProfile } from "../../api/Auth"; +import { IMG_MAX_HEIGHT, IMG_MAX_WIDTH, imageSizeAccepted, storageKeys } from "../../config/CommonConstant"; import type { AxiosResponse } from "axios"; import CustomAvatar from '../Avatar' import { calculateSize, dataURItoBlob } from "../../utils/CompressImage"; -import { Avatar, Button, Label } from "flowbite-react"; +import { Button, Label } from "flowbite-react"; import { Field, Form, Formik, FormikHelpers } from "formik"; -import { asset } from "../../lib/data"; import * as yup from "yup" interface Values { @@ -145,10 +144,6 @@ const UpdateUserProfile = ({ toggleEditProfile, userProfileInfo, updateProfile } const updateUserDetails = async (values: Values) => { - - console.log(`Image::`, logoImage?.imagePreviewUrl); - - setLoading(true) const userData = { @@ -162,9 +157,10 @@ const UpdateUserProfile = ({ toggleEditProfile, userProfileInfo, updateProfile } const resUpdateUserDetails = await updateUserProfile(userData) const { data } = resUpdateUserDetails as AxiosResponse + setToLocalStorage(storageKeys.USER_PROFILE, userData) updateProfile(userData); - + window.location.reload() setLoading(false) } @@ -251,22 +247,24 @@ const UpdateUserProfile = ({ toggleEditProfile, userProfileInfo, updateProfile } diff --git a/src/components/Resources/Schema/SchemasList.tsx b/src/components/Resources/Schema/SchemasList.tsx index cfc4d63f5..44d9d47df 100644 --- a/src/components/Resources/Schema/SchemasList.tsx +++ b/src/components/Resources/Schema/SchemasList.tsx @@ -197,7 +197,7 @@ const SchemaList = (props: { schemaSelectionCallback: (schemaId: string, schemaD schemaList.map((element, key) => (
+ onClickCallback={schemaSelectionCallback} className='' />
))} @@ -217,7 +217,7 @@ const SchemaList = (props: { schemaSelectionCallback: (schemaId: string, schemaD ) : ( } diff --git a/src/components/organization/EditOrgdetailsModal.tsx b/src/components/organization/EditOrgdetailsModal.tsx index 90bb8225e..f37487ef2 100644 --- a/src/components/organization/EditOrgdetailsModal.tsx +++ b/src/components/organization/EditOrgdetailsModal.tsx @@ -224,7 +224,7 @@ const EditOrgdetailsModal = (props: EditOrgdetailsModalProps) => { description: yup .string() .min(2, 'Organization description must be at least 2 characters') - .max(600, 'Organization description must be at most 600 characters') + .max(255, 'Organization description must be at most 255 characters') .required('Description is required') })} validateOnBlur diff --git a/src/pages/index.astro b/src/pages/index.astro index 97f555c83..b858243e4 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -11,6 +11,7 @@ import { pathRoutes } from '../config/pathRoutes';
+
- Explore + Date: Mon, 25 Sep 2023 11:09:13 +0530 Subject: [PATCH 2/2] fix: review changes Signed-off-by: karan --- src/commonComponents/SchemaCard.tsx | 4 ++-- src/components/Resources/Schema/SchemasList.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commonComponents/SchemaCard.tsx b/src/commonComponents/SchemaCard.tsx index e141741de..78ddcfec7 100644 --- a/src/commonComponents/SchemaCard.tsx +++ b/src/commonComponents/SchemaCard.tsx @@ -2,7 +2,7 @@ import { Card } from 'flowbite-react'; import { dateConversion } from '../utils/DateConversion'; import DateTooltip from '../components/Tooltip'; -const SchemaCard = (props: {className:string, schemaName: string, version: string, schemaId: string, issuerDid: string, attributes: [], created: string, onClickCallback: (schemaId: string, attributes: string[], issuerDid:string, created:string) => void; }) => { +const SchemaCard = (props: {className?:string, schemaName: string, version: string, schemaId: string, issuerDid: string, attributes: [], created: string, onClickCallback: (schemaId: string, attributes: string[], issuerDid:string, created:string) => void; }) => { return ( { props.onClickCallback(props.schemaId, props.attributes, props.issuerDid, props.created) @@ -66,4 +66,4 @@ const SchemaCard = (props: {className:string, schemaName: string, version: strin } -export default SchemaCard \ No newline at end of file +export default SchemaCard diff --git a/src/components/Resources/Schema/SchemasList.tsx b/src/components/Resources/Schema/SchemasList.tsx index 44d9d47df..66c031bb1 100644 --- a/src/components/Resources/Schema/SchemasList.tsx +++ b/src/components/Resources/Schema/SchemasList.tsx @@ -197,7 +197,7 @@ const SchemaList = (props: { schemaSelectionCallback: (schemaId: string, schemaD schemaList.map((element, key) => (
+ onClickCallback={schemaSelectionCallback} />
))}