Skip to content

Commit

Permalink
Merge branch 'dev' into ZP01/Feat/Portfolio-bugs-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Phingaz authored Oct 22, 2023
2 parents 90b7cc5 + 107939e commit 4ff2556
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 15 deletions.
5 changes: 3 additions & 2 deletions components/Modals/ComplaintModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ interface ModalProps {
}
interface ComplaintModalProps extends ModalProps {
product: string;
user: string;
user?: string; //you did not passing the user in your mobile_customer_dashboard component
customerID?: string; //you have not added this and yet you were passing it in the component
}
// const token = getAuthTokenFromCookies('UTM_tracker');
const apiUrl = `https://team-mirage-super-amind2.onrender.com/api/v1/super-admin/feedback/register-complaints/`;

const ComplaintModal: React.FC<ComplaintModalProps> = ({ isOpen, onClose, product, user }) => {
const ComplaintModal: React.FC<ComplaintModalProps> = ({ isOpen, onClose, product, user, customerID }) => {
const [description, setDescription] = useState('');
const [error, setError] = useState<string | null>(null);

Expand Down
4 changes: 3 additions & 1 deletion http/checkout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { useAuth } from '../context/AuthContext';
import $http from './axios';
import axios from 'axios';

export const CART_ENDPOINT = 'https://zuri-cart-checkout.onrender.com/api/v1/checkout_cart';


export const CART_ENDPOINT = "https://zuri-cart-checkout.onrender.com/api/v1/checkout_cart"
export const STAGING_URL = process.env.NEXT_PUBLIC_APP_STAGING_URL || 'https://staging.zuri.team';
export const RECENTLY_VIEWED_ENDPOINT = 'https://staging.zuri.team/api/marketplace/v1/recently-viewed';

Expand Down
7 changes: 3 additions & 4 deletions modules/auth/changeEmailAddress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ import { checkEmail } from '../../http/auth';
function ChangeEmailAddress() {
const router = useRouter();

const onSignUpWithEmailSuccess = (data: { message: string }) => {
if (data.message !== 'Email is available for use') {
const errorMessage = 'This email is already registered. Please try logging in or use a different email address.';
notify({ message: errorMessage, type: 'error', theme: 'light' });
const onSignUpWithEmailSuccess = (data: any) => {
if (data.status === 200) {
router.push('/auth/guest-signup-form')
return;
}
};
Expand Down
4 changes: 1 addition & 3 deletions modules/auth/component/ForgotPassword/ForgotPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ const ForgotPassword = () => {
router.push(`/auth/forgot-password-link-sent?email=${email}`);
return;
}

notifyError(data.message);
};

// Form validation
Expand Down Expand Up @@ -107,7 +105,7 @@ const ForgotPassword = () => {
<Input
id="email"
{...form.getInputProps('email')}
type="email"
type="text"
placeholder="Enter email"
className={`w-full text-black h-[44px] md:h-[60px] border shadow-[0px_1px_2px_0px_rgba(16,24,40,0.05)] ${
form.errors.email ? 'border-[red]' : 'border-slate-50'
Expand Down
12 changes: 10 additions & 2 deletions modules/auth/component/guestsignupform.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Guestsignupform: React.FC = () => {
notify({
message: res.message,
type: 'error',
theme: 'light'
theme: 'light',
});
},
});
Expand Down Expand Up @@ -223,7 +223,15 @@ const Guestsignupform: React.FC = () => {
/>
</span>
<span className="text-gray-200 text-sm mt-1 font-manropeL">
I agree with Zuri <Link href="/">Terms of Service</Link> & <Link href="/">Privacy Policy</Link>.
I agree with Zuri{' '}
<Link href="/" className="text-brand-green-primary hover:text-brand-green-hover">
Terms of Service
</Link>{' '}
&{' '}
<Link href="/" className="text-brand-green-primary hover:text-brand-green-hover">
Privacy Policy
</Link>
.
</span>
</label>
<style jsx>{`
Expand Down
6 changes: 3 additions & 3 deletions modules/auth/resendVerification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function ResendVerification() {

const onresendEmailVerifySuccess = (data: any) => {
if (data.message) {
notify({ message: data.message, type: data.status === 200 ? 'success' : 'error', theme: 'light' });
notify({ message: data.message, type: 'success', theme: 'light' });
if (data.status === 200) {
router.push(`/auth/verification?email=${email}`);
}
Expand All @@ -29,11 +29,11 @@ function ResendVerification() {
if (error.response && error.response.message === 'AxiosError: timeout of 30000ms exceeded') {
const timeoutErrorMessage =
'Oops! The request timed out. Please try again later. If the problem persists, please contact support.';
notify({ message: timeoutErrorMessage });
notify({ message: timeoutErrorMessage, type: 'error', theme: 'light' });
return;
}

notify({ message: error.message, type: 'error' });
notify({ message: error.message, type: 'error', theme: 'light' });
};

const { mutate: resendVerify, isLoading: isUserSigningUp } = useAuthMutation(resendVerification, {
Expand Down
58 changes: 58 additions & 0 deletions pages/portfolio/[slug]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,64 @@ const View = () => {
}
}, [urlSlug]);

useEffect(() => {
if (urlSlug) {
const getUser = async () => {
try {
setIsLoading(true);
const response = await fetch(`https://hng6-r5y3.onrender.com/api/v1/portfolio/${urlSlug}`);
const data = await response.json();
if (!response.ok) throw new Error(data.error);
setUserData({
firstName: data?.data?.user?.firstName,
lastName: data?.data?.user?.lastName,
avatarImage: data?.data?.user?.profilePic,
city: data?.data?.portfolio?.city,
country: data?.data?.portfolio?.country,
tracks: data?.data?.tracks,
coverImage: data?.data?.user?.profileCoverPhoto,
});
const {
about,
projects,
workExperience,
education,
skills,
contact,
interestArray,
awards,
language,
reference,
certificates,
shop,
custom,
} = data.data;
setUserSections([
{ title: 'About', id: 'about', data: about },
{ title: 'Project', id: 'projects', data: projects },
{ title: 'Work Experience', id: 'workExperience', data: workExperience },
{ title: 'Education', id: 'education', data: education },
{ title: 'Skills', id: 'skills', data: skills },
{ title: 'Interests', id: 'interests', data: interestArray },
{ title: 'Awards', id: 'awards', data: awards },
{ title: 'Certificate', id: 'certificate', data: certificates },
{ title: 'Language', id: 'language', data: language },
{ title: 'Reference', id: 'reference', data: reference },
{ title: 'Shop', id: 'shop', data: shop },
{ title: 'Contact', id: 'contact', data: contact },
{ title: 'Custom', id: 'custom', data: custom },
]);
setIsLoading(false);
} catch (error: any) {
setIsLoading(false);
setError({ state: true, error: error.message });
setIsLoading(false);
}
};
getUser();
}
}, [urlSlug]);

const [isLoading, setIsLoading] = useState(true);
const [userData, setUserData] = useState({
firstName: '',
Expand Down

0 comments on commit 4ff2556

Please sign in to comment.