-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add user blocking functionality to web3 (#1322)
- Loading branch information
Showing
19 changed files
with
316 additions
and
72 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
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,14 @@ | ||
export function getTagValue (user, tagName, defaultValue) { | ||
return ( | ||
user.tags?.find((tag) => tag.tag === tagName && !tag.deleted_at)?.value || | ||
defaultValue | ||
) | ||
} | ||
|
||
export function hasTag (user, tagName, value) { | ||
return Boolean( | ||
user.tags?.find( | ||
(tag) => tag.tag === tagName && tag.value === value && !tag.deleted_at | ||
) | ||
) | ||
} |
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
46 changes: 46 additions & 0 deletions
46
packages/website/components/account/accountBlockedModal/accountBlockedModal.js
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,46 @@ | ||
import { useState, useEffect } from 'react'; | ||
import Link from 'next/link'; | ||
|
||
import Modal from 'modules/zero/components/modal/modal'; | ||
import CloseIcon from 'assets/icons/close'; | ||
import Button from 'components/button/button.js'; | ||
import GradientBackground from '../../gradientbackground/gradientbackground.js'; | ||
|
||
const AccountBlockedModal = ({ hasAccountRestriction }) => { | ||
const modalState = useState(false); | ||
|
||
useEffect(() => { | ||
if (hasAccountRestriction && !sessionStorage.hasSeenAccountBlockedModal) { | ||
modalState[1](true); | ||
sessionStorage.hasSeenAccountBlockedModal = true; | ||
} | ||
}, [hasAccountRestriction, modalState]); | ||
|
||
return ( | ||
<div className="account-blocked-modal"> | ||
<Modal | ||
className="" | ||
closeIcon={<CloseIcon className="file-uploader-close" />} | ||
modalState={modalState} | ||
showCloseButton | ||
> | ||
<div className="background-view-wrapper"> | ||
<GradientBackground variant="upload-cta-gradient" /> | ||
</div> | ||
<div className="account-blocked-container"> | ||
<p className="content"> | ||
You may have been temporarily blocked from uploading new files. You may, however, continue to view and take | ||
actions on existing uploads. If you feel this was a mistake please contact{' '} | ||
<Link href="mailto:[email protected]">[email protected]</Link> | ||
</p> | ||
|
||
<Button onClick={() => modalState[1](false)} className="confirm"> | ||
Confirm | ||
</Button> | ||
</div> | ||
</Modal> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AccountBlockedModal; |
54 changes: 54 additions & 0 deletions
54
packages/website/components/account/accountBlockedModal/accountBlockedModal.scss
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,54 @@ | ||
.account-blocked-container { | ||
position: relative; | ||
color: $ebony; | ||
padding: 3.125rem 8.5rem 3.125rem 8.125rem; | ||
|
||
@include medium { | ||
padding: 2.375rem 1.3125rem; | ||
width: 100%; | ||
} | ||
|
||
> * { | ||
position: relative; | ||
} | ||
|
||
.saturated-variant { | ||
@include mini { | ||
transform: translate(-5rem, 0) scaleY(2) rotate(-40deg) !important; | ||
} | ||
@include tiny { | ||
width: 1000px !important; | ||
} | ||
} | ||
|
||
.content { | ||
margin-bottom: 20px; | ||
} | ||
} | ||
|
||
.account-blocked-modal { | ||
.modalContainer { | ||
max-width: calc($containerWidth - 10%); | ||
@include borderRadius_Large; | ||
@include medium { | ||
width: 90%; | ||
} | ||
} | ||
.modalClose { | ||
color: $ebony; | ||
font-size: 2rem; | ||
} | ||
|
||
svg { | ||
color: $ebony; | ||
} | ||
} | ||
|
||
.background-view-wrapper { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
overflow: hidden; | ||
} |
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
Oops, something went wrong.