Skip to content

Commit

Permalink
refactor: sent invitation button and back button responsive
Browse files Browse the repository at this point in the history
Signed-off-by: karan <[email protected]>
  • Loading branch information
16-karan committed Oct 16, 2023
2 parents 48dbf8d + 1df3f07 commit 35237b6
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/api/invitations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export const getEcosystemInvitations = async (pageNumber: number, pageSize: numb
const ecosystemId = await getFromLocalStorage(storageKeys.ECOSYSTEM_ID);

const orgId = await getFromLocalStorage(storageKeys.ORG_ID);
const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}${apiRoutes.Ecosystem.invitations}`
const url = `${apiRoutes.Ecosystem.root}/${ecosystemId}/${orgId}${apiRoutes.Ecosystem.invitations}?pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}`

const token = await getFromLocalStorage(storageKeys.TOKEN)

Expand Down
8 changes: 4 additions & 4 deletions src/components/Ecosystem/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,12 @@ const Dashboard = () => {
>
<div>Edit Ecosystem</div>
</Dropdown.Item>
<Dropdown.Item>
{/* <Dropdown.Item>
<div>Enable/Disable Ecosystem</div>
</Dropdown.Item>
<Dropdown.Item>
</Dropdown.Item> */}
{/* <Dropdown.Item>
<div>Manual Registration</div>
</Dropdown.Item>
</Dropdown.Item> */}
</Dropdown>
) : (
<svg
Expand Down
10 changes: 6 additions & 4 deletions src/components/Ecosystem/Endorsement/EndorsementPopup.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button, Modal, Spinner } from 'flowbite-react';
import { EndorsementStatus } from '../../../common/enums';
import { EndorsementStatus, EndorsementType } from '../../../common/enums';
import {
ICheckEcosystem,
checkEcosystem,
Expand Down Expand Up @@ -114,15 +114,17 @@ const EndorsementPopup = (props: {
};

return (
<Modal show={props.openModal} onClose={() => {
<Modal
className='h-full'
show={props.openModal} onClose={() => {
props.closeModal()
setErrMsg(null)
}} size="xl">
<Modal.Header>
{isEcosystemData?.isEcosystemLead ? (
<div>Requested {props.endorsementData?.type}</div>
<div>Requested {props.endorsementData?.type === EndorsementType.credDef ? "Credential Definition" : "Schema" }</div>
) : (
<div>View {props.endorsementData?.type}</div>
<div>View {props.endorsementData?.type === EndorsementType.credDef ? "Credential Definition" : "Schema"}</div>
)}
</Modal.Header>
<div className="mt-3 mx-3 -mb-3">
Expand Down
2 changes: 1 addition & 1 deletion src/components/Ecosystem/MemberList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ const MemberList = () => {
loading={loading}
></DataTable>

{currentPage.pageNumber > 1 && (
{currentPage.total > 1 && (
<div className="flex items-center justify-end mb-4">
<Pagination
currentPage={currentPage.pageNumber}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ const ReceivedInvitations = () => {
)
)}

{currentPage.pageNumber > 1 && <div className="flex items-center justify-end mb-4">
{currentPage.total > 1 && <div className="flex items-center justify-end mb-4">
<Pagination
currentPage={currentPage.pageNumber}
onPageChange={onPageChange}
Expand Down
2 changes: 1 addition & 1 deletion src/components/EcosystemInvite/SentInvitations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ const SentInvitations = () => {
</div>
)}

{currentPage.pageNumber >1 && (
{currentPage.total > 1 && (
<div className="flex items-center justify-end mb-4">
<Pagination
currentPage={currentPage.pageNumber}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Resources/Schema/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ const CreateSchema = () => {
)}

{index === attribute.length - 1 && (
<div key={element.id} className="sm:w-2.5/3 text-red-600 sm:ml-0 md:ml-0 lg:ml-0">
<div key={element.id} className="justify-end sm:w-2.5/3 text-red-600 sm:ml-0 md:ml-0 lg:ml-0">

<Button
id="addSchemaButton"
Expand Down
17 changes: 1 addition & 16 deletions src/components/Resources/Schema/SchemasList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,7 @@ const SchemaList = (props: { schemaSelectionCallback: (schemaId: string, schemaD
</div>)
:
(
<div>
{walletStatus ?
<EmptyListMessage
<EmptyListMessage
message={emptyListTitle}
description={emptyListDesc}
buttonContent={emptyListBtn}
Expand All @@ -284,19 +282,6 @@ const SchemaList = (props: { schemaSelectionCallback: (schemaId: string, schemaD
window.location.href = `${pathRoutes.organizations.createSchema}?OrgId=${orgId}`
}}
/>
:
<EmptyListMessage
message={'No Wallet'}
description={'Get started by creating a Wallet'}
buttonContent={'Create Wallet'}
svgComponent={<svg className='pr-2 mr-1' xmlns="http://www.w3.org/2000/svg" width="24" height="15" fill="none" viewBox="0 0 24 24">
<path fill="#fff" d="M21.89 9.89h-7.78V2.11a2.11 2.11 0 1 0-4.22 0v7.78H2.11a2.11 2.11 0 1 0 0 4.22h7.78v7.78a2.11 2.11 0 1 0 4.22 0v-7.78h7.78a2.11 2.11 0 1 0 0-4.22Z" />
</svg>}
onClick={() => {
window.location.href = `${pathRoutes.organizations.dashboard}?OrgId=${orgId}`
}}
/>}
</div>
)
}
</div>
Expand Down
14 changes: 2 additions & 12 deletions src/components/organization/EditOrgdetailsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ const EditOrgdetailsModal = (props: EditOrgdetailsModalProps) => {
setIsImageEmpty(true)
return true
}


const handleImageChange = (event: any): void => {
const handleImageChange = (event: any): void => {
setImgError('')
const reader = new FileReader()
const file = event?.target?.files
Expand Down Expand Up @@ -268,8 +266,6 @@ const EditOrgdetailsModal = (props: EditOrgdetailsModalProps) => {
alt="Jese picture"
/>
}


<div>
<h3 className="mb-1 text-xl font-bold text-gray-900 dark:text-white">
Organization Logo
Expand Down Expand Up @@ -320,7 +316,6 @@ const EditOrgdetailsModal = (props: EditOrgdetailsModalProps) => {

</div>


<div>
<div
className="block mb-2 text-sm font-medium text-gray-900 dark:text-white"
Expand Down Expand Up @@ -380,10 +375,7 @@ const EditOrgdetailsModal = (props: EditOrgdetailsModalProps) => {
onChange={() => setIsPublic(false)}
id="private"
name="private"
/>
<span className="ml-2 text-gray-900 dark:text-white">Private
<span className="block pl-6 text-gray-500 text-sm">Only the connected organization can see you organization details</span>
</span>
/><span className="ml-2 text-gray-900 dark:text-white">Private<span className="block pl-6 text-gray-500 text-sm">Only the connected organization can see your organization details</span></span>
</div>
<div>
<div
Expand All @@ -402,12 +394,10 @@ const EditOrgdetailsModal = (props: EditOrgdetailsModalProps) => {
id="public"
name="public"
/>

<span className="ml-2 text-gray-900 dark:text-white">Public
<span className="block pl-6 text-gray-500 text-sm">Your profile and organization details can be seen by everyone</span></span>
</div>
</div>

<Button type="submit"
isProcessing={loading}
className='mb-2 float-right text-base font-medium text-center text-white bg-primary-700 rounded-lg hover:!bg-primary-800 focus:ring-4 focus:ring-primary-300 sm:w-auto dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const SendInvitationModal = (props: {
onSubmit={formikHandlers.handleSubmit}
>
<div className="flex items-center justify-between">
<div className="w-2/3">
<div className="w-full">
<div className="block mb-2 text-sm font-medium text-gray-900 dark:text-white">
<Label htmlFor="email2" value="Email" />
<span className="text-red-500 text-xs">*</span>
Expand All @@ -204,7 +204,7 @@ const SendInvitationModal = (props: {
)}
</div>

<div className="w-1/3">
<div className="">
<Button
type="submit"
className="mt-2 ml-4 text-base font-medium text-center text-white bg-primary-700 hover:!bg-primary-800 rounded-lg hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 sm:w-auto dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800"
Expand Down
3 changes: 3 additions & 0 deletions tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ module.exports = {
'100/18rem': 'calc(100vh - 18rem)',
'100/25rem': 'calc(100vh - 25rem)'
},
maxHeight: {
'\[90vh\]': 'fit-content !important'
},
scale: {
'103': '1.03',
}
Expand Down

0 comments on commit 35237b6

Please sign in to comment.