-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
63 changed files
with
835 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@blockchain-lab-um/dapp': minor | ||
--- | ||
|
||
Add better popover for filtering VCs on dashboard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@blockchain-lab-um/masca': patch | ||
--- | ||
|
||
Replaced @metamask/snaps-types, snaps-utils and snaps-ui with @metamask/snaps-sdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v18.18.2 | ||
v20.10.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,13 +80,13 @@ | |
"ts-node": "^10.9.1", | ||
"typescript": "^5.2.2" | ||
}, | ||
"packageManager": "pnpm@8.9.2", | ||
"packageManager": "pnpm@8.11.0", | ||
"engines": { | ||
"node": ">=18.18.2" | ||
"node": ">=20.10.0" | ||
}, | ||
"volta": { | ||
"node": "18.18.2", | ||
"pnpm": "8.9.2" | ||
"node": "20.10.0", | ||
"pnpm": "8.11.0" | ||
}, | ||
"pnpm": { | ||
"patchedDependencies": { | ||
|
@@ -96,8 +96,7 @@ | |
"[email protected]": "patches/[email protected]", | ||
"@ceramicnetwork/[email protected]": "patches/@[email protected]", | ||
"@changesets/[email protected]": "patches/@[email protected]", | ||
"@metamask/[email protected]": "patches/@[email protected]", | ||
"@metamask/[email protected]": "patches/@[email protected]" | ||
"@metamask/[email protected]": "patches/@[email protected]" | ||
}, | ||
"allowNonAppliedPatches": true | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/dapp/src/components/VCTable/FilterPopover/CheckBox.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
|
||
interface CheckBoxProps { | ||
selected: boolean; | ||
setSelected: (selected: boolean) => void; | ||
children: React.ReactNode; | ||
} | ||
|
||
export const CheckBox = ({ | ||
selected, | ||
setSelected, | ||
children, | ||
}: CheckBoxProps) => ( | ||
<div className="dark:text-navy-blue-200 flex items-center font-medium text-gray-700"> | ||
<input | ||
className="dark:accent-orange-accent-dark h-4 w-4 accent-pink-500" | ||
type="checkbox" | ||
checked={selected} | ||
onChange={() => { | ||
setSelected(!selected); | ||
}} | ||
/> | ||
<span className="ml-2 max-w-[190px] truncate">{children}</span> | ||
</div> | ||
); |
111 changes: 111 additions & 0 deletions
111
packages/dapp/src/components/VCTable/FilterPopover/CredentialTypes.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
import React, { useState } from 'react'; | ||
import { ChevronRightIcon } from '@heroicons/react/24/solid'; | ||
import clsx from 'clsx'; | ||
import { useTranslations } from 'next-intl'; | ||
|
||
import { useTableStore } from '@/stores'; | ||
import { CheckBox } from './CheckBox'; | ||
|
||
export const CredentialTypes = () => { | ||
const t = useTranslations('FilterPopover'); | ||
|
||
const [open, setOpen] = useState(false); | ||
const { credentialTypes, setCredentialTypes } = useTableStore((state) => ({ | ||
credentialTypes: state.credentialTypes, | ||
setCredentialTypes: state.setCredentialTypes, | ||
})); | ||
const [filter, setFilter] = useState(''); | ||
|
||
return ( | ||
<div> | ||
<div className="flex items-center justify-between pr-2"> | ||
<button | ||
onClick={() => { | ||
setOpen(!open); | ||
}} | ||
> | ||
<div className="dark:text-navy-blue-100 my-1 ml-2 flex items-center gap-x-2 text-gray-700"> | ||
<ChevronRightIcon | ||
className={clsx( | ||
'animated-transition h-5 w-5 ', | ||
`${open ? 'rotate-90' : ''}` | ||
)} | ||
/> | ||
{t('type')} | ||
</div> | ||
</button> | ||
{open && | ||
(credentialTypes.filter((type) => type.selected).length > 0 ? ( | ||
<button | ||
className="text-sm text-red-500 hover:text-red-700 dark:text-red-300 hover:dark:text-red-500" | ||
onClick={() => { | ||
setCredentialTypes( | ||
credentialTypes.map((type) => ({ | ||
...type, | ||
selected: false, | ||
})) | ||
); | ||
}} | ||
> | ||
clear ({credentialTypes.filter((type) => type.selected).length}) | ||
</button> | ||
) : ( | ||
<button | ||
className="text-sm text-red-500 hover:text-red-700 dark:text-red-300 hover:dark:text-red-500" | ||
onClick={() => { | ||
setCredentialTypes( | ||
credentialTypes.map((type) => ({ | ||
...type, | ||
selected: true, | ||
})) | ||
); | ||
}} | ||
> | ||
select all | ||
</button> | ||
))} | ||
</div> | ||
{open && ( | ||
<div className="dark:bg-navy-blue-500/40 bg-[#FFF8F9] p-2"> | ||
<input | ||
className="dark:bg-navy-blue-700 dark:text-navy-blue-50 dark:border-navy-blue-400 w-full rounded-md border border-gray-300 bg-white px-2 py-1 focus:outline-none" | ||
placeholder="Search Types..." | ||
onChange={(e) => { | ||
setFilter(e.target.value); | ||
}} | ||
value={filter} | ||
/> | ||
<div className="scrollbar-thumb-rounded scrollbar-thumb-pink-500 dark:scrollbar-thumb-orange-accent-dark scrollbar-thin mt-2 max-h-[160px] overflow-scroll overflow-x-hidden"> | ||
{credentialTypes.map((type) => { | ||
if (!type.type.toLowerCase().includes(filter.toLowerCase())) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<div key={type.type} className="my-2"> | ||
<CheckBox | ||
selected={type.selected} | ||
setSelected={(selected) => { | ||
const newCredentialTypes = credentialTypes.map((tp) => { | ||
if (tp.type === type.type) { | ||
return { | ||
...type, | ||
selected, | ||
}; | ||
} | ||
return tp; | ||
}); | ||
setCredentialTypes(newCredentialTypes); | ||
}} | ||
> | ||
{type.type} | ||
</CheckBox> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.