Skip to content

Commit

Permalink
feat(wallet): done changes in user wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalEsMagico committed Dec 12, 2023
1 parent 4dfceba commit 2dfa1b4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
14 changes: 6 additions & 8 deletions src/app/user-management/user-wallet/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,20 @@ const AddToWallet = ({ params }: { params: { id: string } }) => {
</CommonModal>
<div className='mr-[30px] w-[38vw]'>
<div className='flex flex-wrap items-center gap-2'>
<div>
<div className='h-[100px] w-[100px] overflow-hidden rounded-full'>
<Image
src={profile}
src={data?.profilePicture ?? profile}
width={100}
height={100}
alt='img'
className='rounded-full'
alt='profile-img'
className='h-[100%] w-[100%] rounded-full object-cover'
/>
</div>
<div>
<p className='text-xl font-medium text-[#272728] '>
{data?.userName ?? 'DUMMY NAME'}
</p>
<p className='text-base text-[#65758C]'>
{data?.role ?? 'DUMMY ROLE'}
{data?.name ?? '--'}
</p>
<p className='text-base text-[#65758C]'>{data?.role ?? '--'}</p>
</div>
</div>
<div className='mt-[50px] flex flex-wrap justify-between gap-3'>
Expand Down
3 changes: 2 additions & 1 deletion src/app/user-management/user-wallet/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import { useUserWalletContext } from '@/app/context/UserWalletContext';

export type UserWalletDataType = {
consumerId: string;
userName: string;
name: string;
role: string;
numCoursesPurchased: number;
credits: string;
profilePicture: string;
};

const Wallet = () => {
Expand Down
10 changes: 4 additions & 6 deletions src/components/userManagement/UserWalletTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ const UserWalletTable = ({

const handleSearch = (value: string) => {
const newData = userData?.filter((item) => {
const nameMatch = item?.userName
?.toLowerCase()
.includes(value.toLowerCase());
const nameMatch = item?.name?.toLowerCase().includes(value.toLowerCase());
return nameMatch;
});
setSearchInput(value);
Expand Down Expand Up @@ -105,13 +103,13 @@ const UserWalletTable = ({
className={`border-b bg-white hover:bg-gray-50 ${outfit.className}`}
>
<td className='px-6 py-[7px] text-sm font-normal text-[#272728]'>
{user?.consumerId}
{user?.consumerId ?? '--'}
</td>
<td className='px-6 py-[7px] text-sm font-normal text-[#272728]'>
{user?.userName ?? 'DUMMY NAME'}
{user?.name ?? '--'}
</td>
<td className='px-6 py-[7px] text-sm font-normal text-[#272728]'>
{user?.role ?? 'DUMMY ROLE'}
{user?.role ?? '--'}
</td>

<td className='px-6 py-[7px] text-center text-sm font-normal text-[#272728]'>
Expand Down

0 comments on commit 2dfa1b4

Please sign in to comment.