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

added DeniedPage component to warn ambassadors 'Account under review' #160

Merged
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
20 changes: 20 additions & 0 deletions src/components/Profile/ContactInfoPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const SubmissionContainer = styled.div`
`;

export const ContactInfoPage = ({ ambassador, setAmbassador, err }) => {

return (
<PageLayout title="Please Enter Your Details">
<ResponsiveContainer>
Expand Down Expand Up @@ -149,6 +150,15 @@ export const ContactInfoPage = ({ ambassador, setAmbassador, err }) => {
);
};


export const DeniedPage = () => {
return (
<PageLayout title="Your account is under review.">
<p>Please contact support@blockpower.vote with any questions</p>
</PageLayout>
)
}

export const ProfilePageEdit = () => {
const [err, setErr] = useState(false);
const history = useHistory();
Expand All @@ -161,6 +171,10 @@ export const ProfilePageEdit = () => {
const { userError } = await fetchUser();
if (userError) return setErr(userError.msg);
}

if(user.msg==="Your account is locked."){
return <DeniedPage/>
}
return (
<ContactInfoPage
ambassador={user}
Expand All @@ -180,6 +194,7 @@ export const ProfilePageSignup = () => {
const { ambassador, setAmbassador, api, fetchUser, user } = React.useContext(
AppContext
);

user &&
user.signup_completed &&
user.onboarding_completed &&
Expand All @@ -196,6 +211,11 @@ export const ProfilePageSignup = () => {
signup();
}
}, [ambassador]);


if(user.msg==="Your account is locked."){
return <DeniedPage/>
}
return (
<ContactInfoPage
ambassador={ambassador}
Expand Down