Skip to content

Commit

Permalink
Fix: Display added credential as card
Browse files Browse the repository at this point in the history
Signed-off-by: George J Padayatti <[email protected]>
  • Loading branch information
georgepadayatti committed Apr 8, 2024
1 parent c3d6d12 commit a330351
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/component/Drawer/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
height: 100%;

.businessInfo {
padding: 10px 0;
padding: 10px;
}

.walletContainer {
Expand Down
4 changes: 2 additions & 2 deletions src/component/OrganisationDetails/OrgDetailsContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ const OrganisationDetailsContainer = (props: Props) => {
(state) => state?.gettingStart?.data
);

const isVerify = verifyConnectionObj?.verification?.presentationState == 'verified';
const isVerify = verifyConnectionObj?.verification?.presentationState === 'verified';

const callRightSideDrawer = () => {
isVerify && setOpenRightSideDrawer(!openRightSideDrawer)
setOpenRightSideDrawer(!openRightSideDrawer)
}

const handleChange = (e) => {
Expand Down
7 changes: 5 additions & 2 deletions src/container/AddCredential/Confirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React from 'react';
import { useTranslation } from 'react-i18next';
import { useAppSelector } from '../../customHooks';
import { defaultCoverImage, defaultLogoImg } from '../../utils/defalultImages';
import { DataAttributeCardForDDA } from './dataAttributeCardCredentials';


const ConfirmComponent = ({ callRightSideDrawer }) => {
Expand Down Expand Up @@ -78,13 +79,15 @@ const ConfirmComponent = ({ callRightSideDrawer }) => {
{t('common.certificateOfRegistration')}
</Typography>

<DataAttributeCardForDDA selectedData={tableData}/>

<Box className='confirmTable'>
<BasicTable
{/* <BasicTable
isColumnWise={true}
tableData={tableData}
customTableHeadClass={"mui-table-bordered"}
customTableBodyClass={"mui-table-bordered"}
/>
/> */}
</Box>
</Box>
</Box>
Expand Down
64 changes: 64 additions & 0 deletions src/container/AddCredential/dataAttributeCardCredentials.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import React from "react";
import { Box, Typography } from "@mui/material";

const titleAttrRestrictionStyle = (isLastAttribute: boolean) => ({
fontWeight: "normal",
margin: "10px 10px 5px 10px",
borderBottom: isLastAttribute ? "none" : "solid 1px #dee2e6",
lineHeight: "1.5rem",
});

const tableAttrAdditionalInfoStyle = {
border: 0,
width: "100%",
maxWidth: "100%",
marginBottom: "0rem",
backgroundColor: "#FFFF",
};

interface Props {
selectedData: any;
}

export const DataAttributeCardForDDA = (props: Props) => {
const { selectedData } = props;

return (
<Box
style={{
marginTop: "10px",
border: "1px solid #DFE0E1",
borderRadius: 5,
paddingTop: 10,
paddingBottom: 10,
}}
>
{selectedData?.map((attribute: any, index: number) => {
const isLastAttribute = index === (selectedData?.length || 0) - 1;

return (
<Box key={index} style={titleAttrRestrictionStyle(isLastAttribute)}>
<table style={tableAttrAdditionalInfoStyle}>
<tbody>
<tr
style={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
}}
>
<Typography variant="subtitle2">
{attribute.attribute}
</Typography>
<Typography variant="subtitle2">
{attribute.value}
</Typography>
</tr>
</tbody>
</table>
</Box>
);
})}
</Box>
);
};
3 changes: 2 additions & 1 deletion src/container/AddCredential/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.drawerContent {
position: relative;
overflow: auto;
.MuiFormLabel-root, .MuiTypography-root {
font-size: 14px;
}
Expand Down Expand Up @@ -117,6 +118,6 @@
}

.modal-footer {
width: 480px;
// width: 480px;
}
}

0 comments on commit a330351

Please sign in to comment.