Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(Design): Modal Cancel Button #2344

Merged
merged 4 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions apps/console/app/components/DeleteAppModal/DeleteAppModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ export const DeleteAppModal = ({
return (
<Modal
isOpen={isOpen}
fixed
closable={!isSubmitting}
handleClose={() => deleteAppCallback(false)}
>
<div
className={`w-[62vw] transform rounded-lg bg-white px-4 pt-5 pb-4
text-left shadow-xl transition-all sm:p-6 overflow-y-auto flex items-start space-x-4`}
className={`w-[62vw] rounded-lg bg-white px-4 pb-4
text-left transition-all sm:px-6 sm:pb-6 overflow-y-auto flex items-start space-x-4`}
>
<img src={dangerVector} />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ export const RotateCredsModal = ({
rotateCallback,
}: RotateCredsModalProps) => {
return (
<Modal isOpen={isOpen} fixed handleClose={() => closeCallback()}>
<Modal isOpen={isOpen} handleClose={() => closeCallback()}>
<div
className={`w-[62vw] transform rounded-lg bg-white px-4 pt-5 pb-4
text-left shadow-xl transition-all sm:p-6 overflow-y-auto flex items-start space-x-4`}
className={`w-[62vw] rounded-lg bg-white px-4 pb-4
text-left transition-all sm:px-6 sm:pb-6 overflow-y-auto flex items-start space-x-4`}
>
<img src={dangerVector} />

Expand Down
3 changes: 2 additions & 1 deletion apps/console/app/routes/apps/$clientId/designer.beta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ const ProviderModal = ({

return (
<Modal isOpen={isOpen} fixed handleClose={() => onClose(false)}>
<div className="bg-white px-6 py-8 max-w-full lg:w-[543px] lg:mx-auto border shadow rounded-lg">
<div className="bg-white rounded-lg px-6 pb-6 min-w-full lg:w-[543px]
lg:m-auto overflow-y-auto">
<Text weight="semibold" className="text-left text-gray-800 mb-4">
Login Provider Configuration
</Text>
Expand Down
4 changes: 2 additions & 2 deletions apps/console/app/routes/apps/$clientId/domain-wip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ const DeleteModal = ({
return (
<Modal isOpen={isOpen} closable={!isSubmitting} handleClose={onClose}>
<div
className={`flex w-[512px] items-start space-x-4 px-4 pt-5 pb-4 text-left overflow-y-auto rounded-lg bg-white
shadow-xl transform transition-all`}
className={`flex w-[512px] rounded-lg items-start space-x-4 px-4 pb-4 text-left overflow-y-auto bg-white
transition-all`}
>
<img src={dangerVector} alt="Danger" />

Expand Down
4 changes: 2 additions & 2 deletions apps/passport/app/components/applications/claims.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export const ConfirmRevocationModal = ({
<Modal isOpen={isOpen} handleClose={() => setIsOpen(false)}>
<div
className={`min-w-[260px] sm:min-w-[400px] md:max-w-[512px] lg:max-w-[512px]
relative transform rounded-lg bg-white px-4 pt-5 pb-4 text-left
shadow-xl transition-all sm:p-6 overflow-y-auto`}
relative rounded-lg bg-white px-4 pb-4 text-left
transition-all sm:px-6 sm:pb-6 overflow-y-auto`}
>
<div className="flex flex-row space-x-6 items-center justify-start">
<img
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ export default ({
) : (
<Modal isOpen={isOpen} handleClose={() => setIsOpen(false)}>
<div
className={`max-w-full w-[512px] relative transform rounded-lg bg-white text-left shadow-xl transition-all overflow-y-auto`}
className={`max-w-full w-[512px] relative bg-white text-left
transition-all rounded-lg overflow-y-auto`}
>
<div className="flex flex-row space-x-4 p-6">
<div className="flex flex-row space-x-4 pb-6 px-6">
<img src={warn} alt="Not Found" />

<div className="flex-1">
Expand Down
4 changes: 2 additions & 2 deletions apps/passport/app/routes/settings/accounts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ const RenameModal = ({
}) => (
<Modal isOpen={isOpen} handleClose={() => setIsOpen(false)}>
<div
className={`min-w-[300px] sm:min-w-[437px] relative transform rounded-lg
bg-white px-4 pt-5 pb-4 text-left shadow-xl transition-all sm:p-6 overflow-y-auto`}
className={`min-w-[300px] sm:min-w-[437px] relative
bg-white px-4 pb-4 text-left rounded-lg transition-all sm:px-6 sm:pb-6 overflow-y-auto`}
>
<Text size="lg" weight="semibold" className="text-gray-900 mb-4">
Name Your Account
Expand Down
4 changes: 2 additions & 2 deletions apps/passport/app/routes/settings/advanced.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ const DeleteRollupIdentityModal = ({
<Modal isOpen={isOpen} handleClose={() => setIsOpen(false)}>
<div
className={`min-w-[260px] sm:min-w-[400px] md:max-w-[512px] lg:max-w-[512px]
relative transform rounded-lg bg-white px-4 pt-5 pb-4 text-left
shadow-xl transition-all sm:p-6 overflow-y-auto`}
relative bg-white px-4 pb-4 text-left
transition-all sm:px-6 rounded-lg sm:pb-6 overflow-y-auto`}
>
<div className="flex flex-row space-x-6 items-center justify-start">
<img
Expand Down
6 changes: 3 additions & 3 deletions apps/profile/app/components/accounts/PfpNftModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ const PfpNftModal = ({
return (
<Modal isOpen={isOpen} fixed handleClose={handleClose}>
<div
className="flex-1 relative transform rounded-lg bg-white
overflow-x-visible max-h-[900px] w-screen min-[480px]:w-full px-2 pt-5
pb-4 text-left shadow-xl transition-all overflow-y-auto"
className="flex-1 relative bg-white
overflow-x-visible max-h-[900px] w-screen min-[480px]:w-full px-2
pb-4 text-left transition-all rounded-lg overflow-y-auto"
>
{text?.length && (
<Text
Expand Down
4 changes: 2 additions & 2 deletions apps/profile/app/components/accounts/UnsavedChangesModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import warn from '../../assets/warning.svg'
const UnsavedChangesModal = ({ isOpen, handleClose }) => {
return (
<Modal isOpen={isOpen} handleClose={handleClose}>
<div className="relative bg-white lg:w-[32rem] rounded-xl pb-3 pr-6">
<div className="relative bg-white rounded-xl pl-6 pt-6">
<div className="relative rounded-lg bg-white lg:w-[32rem] pb-3 pr-6">
<div className="relative bg-white pl-6">
<div className="mb-[53px] flex flex-row items-start">
<img src={warn} alt="warning" className="mr-4" />
<div className="flex flex-col items-start">
Expand Down
29 changes: 14 additions & 15 deletions apps/profile/app/components/nfts/modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ const NftModal = ({
scrollbarColor: '#D1D5DB white',
}}
className={`flex-1 relative h-max w-full sm:min-w-[37rem] sm:max-h-[35rem] sm:max-w-[58rem] h-[86vh] sm:w-[62vw]
transform rounded-lg bg-white px-4 pt-5 pb-4
text-left shadow-xl transition-all sm:p-6 overflow-y-auto`}
bg-white rounded-lg px-4 pb-4
text-left transition-all sm:px-6 sm:pb-6 overflow-y-auto`}
>
<div className="flex flex-col justify-between lg:flex-row max-w-full ">
<div>
Expand All @@ -52,11 +52,10 @@ const NftModal = ({
)}

<img
className={`object-fill rounded-lg shrink-0 ${
imgLoaded
? 'visible w-screen'
: 'invisible absolute w-2.5 h-2.5'
}`}
className={`object-fill rounded-lg shrink-0 ${imgLoaded
? 'visible w-screen'
: 'invisible absolute w-2.5 h-2.5'
}`}
src={gatewayFromIpfs(nft?.url)}
onLoad={() => setImgLoaded(true)}
alt=""
Expand Down Expand Up @@ -176,15 +175,15 @@ const NftModal = ({
</button>
</div>
)) || (
<Text
size="xs"
weight="semibold"
className="text-gray-700 pb-2 max-w-[12rem] md:max-w-[16rem] lg:max-w-[18rem]
<Text
size="xs"
weight="semibold"
className="text-gray-700 pb-2 max-w-[12rem] md:max-w-[16rem] lg:max-w-[18rem]
truncate"
>
{d.value}
</Text>
)}
>
{d.value}
</Text>
)}
</div>
)
}
Expand Down
13 changes: 10 additions & 3 deletions apps/profile/app/helpers/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,16 @@ export const getAccountCryptoAddresses = async ({
// TODO: need to type qc and rc
const cryptoAddresses =
addresses
.filter((e) => [NodeType.Crypto, NodeType.Vault].includes(e.rc.node_type))
.map((address) => address.qc.alias.toLowerCase() as string) ||
([] as string[])
.filter((e) => {
return [NodeType.Crypto, NodeType.Vault].includes(e.rc.node_type) &&
e.rc.addr_type === CryptoAddressType.ETH
})
.map((address) => {
return address.qc.alias.toLowerCase() as string
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alias for SC wallet is not an Ethereum address, but a Nickname
Because of it, it throws errors from nft gallery that

owner should be a valid address or ENS name

})
|| ([] as string[])



return cryptoAddresses
}
Expand Down
2 changes: 1 addition & 1 deletion apps/profile/app/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const NFTDetailSchema = z.object({
export const NFTPropertySchema = z.object({
display: z.string(),
name: z.string(),
value: z.string(),
value: z.string().or(z.number()),
})

export const NFTSchema = z.object({
Expand Down
36 changes: 20 additions & 16 deletions packages/design-system/src/molecules/modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,28 @@ export const Modal = ({
leaveFrom="opacity-100 translate-y-0 sm:scale-100"
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
>
<Dialog.Panel>
<Dialog.Panel className={`${fixed ? "pb-10" : ""}`}>
<div
className={`flex flex-col ${
fixed
? `w-full min-[480px]:w-[96vw] lg:w-[62vw] h-[96vh] lg:h-[76vh]`
: `max-w-[96vw] lg:w-full max-h-[89vh] lg:h-full pb-10`
}`}
className={`flex flex-col
border bg-white rounded-lg shadow-xl overflow-auto thin-scrollbar
${fixed
? `h-max w-max min-[480px]:w-[96vw] lg:w-[62vw] h-[96vh] lg:h-[76vh]`
: `h-max w-max min-h-max max-w-[96vw] lg:w-full max-h-[89vh] lg:h-full
`
}`}
>
<div className="flex flex-row justify-end p-3">
<div
className={`bg-white rounded-full p-2 text-3xl cursor-pointer
${!closable ? 'bg-[#f3f4f6] text-[#d1d5db]' : ''}`}
onClick={() => {
if (handleClose && closable) handleClose(false)
}}
>
<HiOutlineX />
</div>
<div className="flex flex-row justify-end px-3">
{
closable && <div
className={`bg-white p-2 rounded-lg m-2 text-xl cursor-pointer
hover:bg-[#F3F4F6]`}
onClick={() => {
if (handleClose) handleClose(false)
}}
>
<HiOutlineX />
</div>
}
</div>
{children}
</div>
Expand Down