Skip to content

Commit

Permalink
added delete DS node functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhupesh-mfsi committed Aug 28, 2024
1 parent d7c9734 commit 58aac72
Show file tree
Hide file tree
Showing 8 changed files with 257 additions and 421 deletions.
9 changes: 0 additions & 9 deletions packages/messenger-widget/src/assets/images/active-node.svg

This file was deleted.

9 changes: 0 additions & 9 deletions packages/messenger-widget/src/assets/images/inactive-node.svg

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ export function MobileView() {
const { dm3Configuration } = useContext(DM3ConfigurationContext);

const {
nodes,
updateProfileWithTransaction,
isDm3NameConfigured,
isEnsNameConfigured,
isProfileUpdatedForDm3Name,
isProfileUpdatedForEnsName,
} = useContext(DM3UserProfileContext);

const ensDomainName =
Expand All @@ -58,26 +57,6 @@ export function MobileView() {
: 'ENS')) ??
null;

const isProfileNotUpdatedForDm3Name = (): boolean => {
return nodes.filter(
(n) =>
isDm3NameConfigured &&
(!n.dm3Name?.isActive || !n.opName?.isActive),
).length
? true
: false;
};

const isProfileNotUpdatedForEnsName = (): boolean => {
return nodes.filter(
(n) =>
isEnsNameConfigured &&
(!n.ensName?.isActive || !n.gnosisName?.isActive),
).length
? true
: false;
};

// handles ENS name and address
useEffect(() => {
getEnsName(
Expand Down Expand Up @@ -145,7 +124,7 @@ export function MobileView() {
<p
className={'m-0 font-size-14 font-weight-500 line-height-24 title-content'.concat(
' ',
isProfileNotUpdatedForDm3Name() ? 'error-text' : '',
!isProfileUpdatedForDm3Name() ? 'error-text' : '',
)}
>
DM3 Name
Expand All @@ -167,7 +146,7 @@ export function MobileView() {
<p
className={'dm3-address m-0 ms-0 font-size-14 font-weight-500 line-height-24 grey-text'.concat(
' ',
isProfileNotUpdatedForDm3Name()
!isProfileUpdatedForDm3Name()
? 'error-text'
: 'grey-text',
)}
Expand All @@ -183,7 +162,7 @@ export function MobileView() {
/>
</p>

{isProfileNotUpdatedForDm3Name() && (
{!isProfileUpdatedForDm3Name() && (
<button
className="add-prof-btn-active update-btn"
onClick={() =>
Expand All @@ -208,7 +187,7 @@ export function MobileView() {
<p
className={'m-0 font-size-14 font-weight-500 line-height-24 title-content'.concat(
' ',
isProfileNotUpdatedForEnsName() ? 'error-text' : '',
!isProfileUpdatedForEnsName() ? 'error-text' : '',
)}
>
{ensDomainName} Name
Expand All @@ -232,15 +211,15 @@ export function MobileView() {
<p
className={'dm3-address m-0 ms-0 font-size-14 font-weight-500 line-height-24 grey-text'.concat(
' ',
isProfileNotUpdatedForEnsName()
!isProfileUpdatedForEnsName()
? 'error-text'
: 'grey-text',
)}
>
{existingEnsName}
</p>

{isProfileNotUpdatedForEnsName() && (
{!isProfileUpdatedForEnsName() && (
<button
className="add-prof-btn-active update-btn"
onClick={() =>
Expand Down
Loading

0 comments on commit 58aac72

Please sign in to comment.