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

View badges fixes bugs #1472

Open
wants to merge 63 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
0a726f3
Fix: updated the badges
TRIPLE-ADE Oct 14, 2023
8469993
Fix: updated dashboard assessment icon
TRIPLE-ADE Oct 14, 2023
5b2199c
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
TRIPLE-ADE Oct 14, 2023
99ec4ed
Fix: updated dashboard assessment icon
TRIPLE-ADE Oct 14, 2023
e79d986
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
TRIPLE-ADE Oct 14, 2023
9a7758c
Fix: updated routing
TRIPLE-ADE Oct 14, 2023
3eb8848
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
TRIPLE-ADE Oct 14, 2023
d95a41a
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
TRIPLE-ADE Oct 14, 2023
1b40c10
Fix: updated routing
TRIPLE-ADE Oct 14, 2023
31bb366
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
TRIPLE-ADE Oct 14, 2023
21cd6fc
Fix: updated routing
TRIPLE-ADE Oct 14, 2023
c0ba505
badges dashboard added
ggakila Oct 14, 2023
9d2b61b
change directories
Oct 14, 2023
c13d689
Merge branch 'Feat/VIEWBadgesPageRouting' of https://github.com/hngx-…
Oct 14, 2023
b0c2022
badges routes changed
ggakila Oct 14, 2023
1b26c86
change directories
Oct 14, 2023
d3164cb
badge component moved
ggakila Oct 14, 2023
8d6680d
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
TRIPLE-ADE Oct 14, 2023
7d7012b
Feat: fetch details assessment from db
Amity808 Oct 14, 2023
b5ab0b0
Merge branch 'dev' into TAK-3/Fetch-assessment_details
Amity808 Oct 14, 2023
c7792e3
fixed dashboard
Oct 15, 2023
2e56d53
Fix: update assessments dashboard
TRIPLE-ADE Oct 15, 2023
05434d6
Merge branch 'TAK-3/Fetch-assessment_details' of https://github.com/h…
TRIPLE-ADE Oct 15, 2023
3b77a17
api integration ongoing
gafaradetunji Oct 15, 2023
483f9de
build
gafaradetunji Oct 15, 2023
0657737
Fix: update assessments dashboard
TRIPLE-ADE Oct 15, 2023
c6e475c
Merge branch 'TAK-9/Feat/start-assessment' of https://github.com/hngx…
TRIPLE-ADE Oct 15, 2023
c53aae8
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
TRIPLE-ADE Oct 15, 2023
7638186
Merge branch 'VIE-7/Feat/EXIT-ENTRY-POINT' of https://github.com/hngx…
TRIPLE-ADE Oct 15, 2023
5de3eb9
Dashboard inclusion
Oct 15, 2023
4e4e29b
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
Oct 15, 2023
b8d8b9d
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
ggakila Oct 15, 2023
c6b8760
badge new page and routing
ggakila Oct 15, 2023
818f24b
badge new page and routing
ggakila Oct 15, 2023
f6f1afe
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
ggakila Oct 15, 2023
8e6c112
Merge branches 'Feat/VIEWBadgesPageRouting' and 'VIE-7/Feat/fix-Entry…
ggakila Oct 15, 2023
7a092cd
resolve conflicts
ggakila Oct 18, 2023
f5c7e70
resolve conflicts
ggakila Oct 18, 2023
b9c30a2
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
ggakila Oct 18, 2023
a947cb4
resolved conflicts after pull
ggakila Oct 19, 2023
f16de8d
badge dashboard update to align with the header and footer
ggakila Oct 20, 2023
25246e0
back/history button added, badge updated at time changed
ggakila Oct 20, 2023
b22df88
banner text aligned with nav and badge component
ggakila Oct 20, 2023
180152a
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
ggakila Oct 20, 2023
3a947fe
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
ggakila Oct 20, 2023
39b7c70
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
ggakila Oct 20, 2023
15858fd
interactivy added to badges component and loading state height change…
ggakila Oct 20, 2023
36a897a
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
ggakila Oct 20, 2023
3042bd4
badges page SEO and meta data added and no badges earned display mess…
ggakila Oct 21, 2023
9d3c052
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
ggakila Oct 21, 2023
8a72393
badges page SEO and meta data added and no badges earned display mess…
ggakila Oct 21, 2023
5dfe18f
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
ggakila Oct 21, 2023
c595453
badges page SEO and meta data added and no badges earned display mess…
ggakila Oct 21, 2023
7520f6a
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
ggakila Oct 21, 2023
e47b72b
Merge branch 'dev' of https://github.com/hngx-org/zuriportfolio-front…
ggakila Oct 21, 2023
a1e92d2
view badges dashboard implement retake badge and test failed error
ggakila Oct 21, 2023
8ce5f86
view badges dashboard remove retake badge and test failed error
ggakila Oct 21, 2023
cad331c
ui change to remove the extra space below the footer on larger screens
ggakila Oct 21, 2023
16c602d
conficts resolved
ggakila Oct 21, 2023
ee1ba66
conficts resolved
ggakila Oct 21, 2023
7d6a175
pull from dev conflicts resolved
ggakila Oct 22, 2023
d9481cd
seo on assessments/dashboard code cleanup back button possitioning on…
ggakila Oct 22, 2023
116365d
pull from dev conflicts resolved
ggakila Oct 22, 2023
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
2 changes: 1 addition & 1 deletion @types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -931,5 +931,5 @@ export type DashboardActivity = {
};

export interface ExtendedDashboardActivity extends DashboardActivity {
isPage?: boolean;
isPage?: boolean;
}
4 changes: 2 additions & 2 deletions components/Modals/TempUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const TempUser = ({ isOpen, onClose }: TempUser) => {
};
const payment = userForm.get('paymentMethod') as string;
const tempUser = await createTempUser(data);

if (tempUser.data.token) {
localStorage.setItem('trans_token',tempUser.data.token);
localStorage.setItem('trans_token', tempUser.data.token);

const cartItems = JSON.parse(localStorage.getItem('products') as string);
const cartIds = await getCardItemsId(cartItems);
Expand Down
1 change: 0 additions & 1 deletion components/Navbars/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,6 @@ function TopBar(props: { activePage: string; showDashBorad: boolean }) {
)}
</div>
<div className="auth flex items-center gap-3 cursor-pointer" onClick={handleAuthMenu}>

<p className=" font-bold font-manropeEB">
{globalAuth?.user?.firstName} {globalAuth?.user?.lastName}
</p>
Expand Down
6 changes: 3 additions & 3 deletions helpers/formatCurrency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export const formatToNigerianNaira = (num: number | string): string => {
return formatter.format(parsedNum);
};

export const formatCurrency = (currency:number|string) => {
return currency.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
export const formatCurrency = (currency: number | string) => {
return currency.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
};
4 changes: 2 additions & 2 deletions http/super-admin1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,5 @@ export const useDeleteShop = () => {

export const logout = (route: NextRouter) => {
localStorage.removeItem('zpt');
route.push('/')
}
route.push('/');
};
2 changes: 1 addition & 1 deletion modules/assessment/component/Badges/BadgeComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const BadgeComponent: React.FC<BadgeComponentProps> = ({
href={href}
as={as}
passHref
className="badgecomponent w-[330px] h-[330px] sm:w-[236px] sm:h-[236px] lg:min-w-[300px] lg:min-h-[300px] xl:min-w-[330px] xl:min-h-[330px] p-[16px] flex flex-col items-center border border-neutral-200 rounded-[8px] gap-[12px] relative overflow-hidden"
className="badgecomponent w-[330px] h-[330px] sm:w-[236px] sm:h-[236px] lg:min-w-[300px] lg:min-h-[300px] xl:min-w-[330px] xl:min-h-[330px] p-[16px] flex flex-col items-center border border-neutral-200 rounded-[8px] gap-[12px] relative overflow-hidden transition-transform duration-300 hover:scale-105"
>
<div className="badgerewardimage w-[160px] h-[128px] relative">
<Image src={imageSrc} fill={true} alt={imageAlt} style={{ objectFit: 'contain' }} />
Expand Down
24 changes: 12 additions & 12 deletions modules/assessment/component/Badges/BadgesComponentHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import Image from 'next/image';
const BadgesComponentHeader = () => {
return (
<>
<div className="w-full h-[130px] bg-[#005427] px-[15px] sm:px-[68px] xl:px-[100px] flex items-center sm:justify-start md:justify-between relative ">
<div className="gap-[8px] flex flex-col ">
<h1 className="text-[22px] sm:text-[32px] font-[600] text-white-100 leading-[36px] md:leading-[40px] tracking-normal lg:pr-[100px]">
Keep tabs on all yours badges
<div className="w-full h-[130px] bg-brand-green-shade40 px-[15px] sm:px-[60px] lg:px-[60px] xl:px-[150px] flex items-center sm:justify-start md:justify-between relative ">
<div className="gap-[8px] flex flex-col w-full items-center ">
<h1 className="text-[22px] sm:text-[32px] font-[600] text-white-100 leading-[36px] md:leading-[40px] tracking-normal lg:pr-[150px] max-w-[1250px] w-full">
Keep tabs on all your badges
</h1>
<p className="text-[14px] leading-[20px] font-[500] text-white-100">
<p className="text-[14px] leading-[20px] font-[500] text-white-100 max-w-[1250px] w-full">
Start your journey and earn a badge today!
</p>
</div>
Expand Down Expand Up @@ -47,39 +47,39 @@ const BadgesComponentHeader = () => {
src="/assets/images/badges/bannerintermediatebadge.svg"
width={290}
height={30}
alt="expert badge image"
alt="intermediate badge image"
/>
</div>
<div className="absolute top-[-20px] sm:top-0 right-0 hidden lg:block">
<Image
src="/assets/images/badges/bannerbeginnerbadge.png"
width={160}
height={128}
alt="expert badge image"
alt="beginner badge image"
/>
</div>
<div className="absolute bottom-0 hidden sm:block sm:right-[20%] md:right-[10%] lg:right-[30%] mix-blend-hard-light ">
<Image
src="/assets/images/badges/bannerintermediatebadge.svg"
width={290}
height={30}
alt="expert badge image"
alt="intermediate badge image"
/>
</div>
<div className="absolute top-[-20px] sm:top-0 right-0 hidden lg:block">
<Image
src="/assets/images/badges/bannerbeginnerbadge.png"
width={160}
height={128}
alt="expert badge image"
alt="beginner badge image"
/>
</div>
<div className="absolute bottom-0 right-0 block sm:hidden mix-blend-hard-light ">
<Image
src="/assets/images/badges/bannerintermediatesmallbadge.svg"
width={100}
height={30}
alt="expert badge image"
alt="intermediate badge image"
priority={true}
/>
</div>
Expand All @@ -88,15 +88,15 @@ const BadgesComponentHeader = () => {
src="/assets/images/badges/bannerbeginnerbadge.png"
width={160}
height={128}
alt="expert badge image"
alt="beginner badge image"
/>
</div>
<div className="absolute bottom-0 right-0 block sm:hidden mix-blend-hard-light ">
<Image
src="/assets/images/badges/bannerintermediatesmallbadge.svg"
width={100}
height={30}
alt="expert badge image"
alt="intermediate badge image"
priority={true}
/>
</div>
Expand Down
6 changes: 3 additions & 3 deletions modules/assessment/component/Badges/errordata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import React from 'react';

const errordata = () => {
return (
<div className="px-10 md:px-32 py-10 grid grid-cols-1 justify-center align-middle ">
<div className="rounded overflow-hidden shadow-lg text-center">
<div className="px-10 md:px-32 py-10 grid grid-cols-1 justify-center align-middle">
<div className=" flex flex-col items-center justify-center rounded overflow-hidden shadow-lg text-center h-72">
<h1 className="text-6xl font-semibold text-brand-green-primary">Oops!</h1>
<p className=" text-lg text-gray-600 my-5 "> Error fetching data.</p>
<p className=" text-lg text-gray-600 my-5 "> Error fetching data</p>
<div className="animate-bounce my-5">
<svg
className="mx-auto h-16 w-16 text-brand-green-primary"
Expand Down
2 changes: 1 addition & 1 deletion modules/auth/component/ForgotPassword/ForgotPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const ForgotPassword = () => {
// status code for user whose email is not verified
if (e.status === 403) {
notify({
message: "Account not verified, redirecting to verification page.",
message: 'Account not verified, redirecting to verification page.',
type: 'error',
theme: 'light',
});
Expand Down
2 changes: 1 addition & 1 deletion 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
1 change: 0 additions & 1 deletion modules/auth/component/logout/Logout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export const MobileLogout = () => {
</g>
</svg>
<p className="font-manropeB">Sign Out</p>

</div>
);
};
Expand Down
4 changes: 2 additions & 2 deletions modules/auth/verificationComplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function VerificationComplete() {
notify({
message: timeoutErrorMessage,
type: 'error',
theme: 'light'
theme: 'light',
});
setIsError(true);
return;
Expand All @@ -86,7 +86,7 @@ function VerificationComplete() {
notify({
message: error.message,
type: 'error',
theme: 'light'
theme: 'light',
});
setIsError(true);
},
Expand Down
4 changes: 2 additions & 2 deletions modules/portfolio/component/modals/CountryCityDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const CountryCityDropdown: React.FC<Props> = ({
<SelectTrigger className="border-[#59595977] h-[50px] rounded-[10px]">
<SelectValue
defaultValue={selectedCountry || ''}
placeholder='Select Country'
placeholder="Select Country"
className="hover:border-green-500"
/>
</SelectTrigger>
Expand All @@ -95,7 +95,7 @@ const CountryCityDropdown: React.FC<Props> = ({
<SelectTrigger className="border-[#59595977] text-grey-300 h-[50px] rounded-[10px]">
<SelectValue
defaultValue={selectedCity || ''}
placeholder='Select City'
placeholder="Select City"
className="hover:border-green-500"
/>
</SelectTrigger>
Expand Down
11 changes: 3 additions & 8 deletions modules/portfolio/component/modals/edit-profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { useAuth } from '../../../../context/AuthContext';
const inputStyle = `placeholder-gray-300 placeholder-opacity-40 font-semibold text-gray-500 h-[50px] border-2 border-[#bcbcbc] rounded-[10px] px-4 ring-0 outline-brand-green-primary transition-all duration-300 ease-in-out select-none focus-within:border-brand-green-primary`;

const EditProfile = () => {

const { userData, setUserData, showProfileUpdate, setShowProfileUpdate } = useContext(Portfolio);
const [picture, setPicture] = useState<string | StaticImport>();
const [firstNamee, setFirstnamee] = useState('');
Expand Down Expand Up @@ -61,15 +60,14 @@ const EditProfile = () => {
const response = await fetch(`https://hng6-r5y3.onrender.com/api/v1/users/${userId}`);
const userData = await response.json();


// Set default values as placeholders if data is not present
setPicture(userData.data.user.profilePic || '');
setFirstnamee(userData.data.user.firstName || ''); // Access 'user' inside 'data'
setLastNamee(userData.data.user.lastName || ''); // Access 'user' inside 'data'
setCity(userData.data.portfolio.city || ''); // Access 'portfolio' inside 'data'
setCountry(userData.data.portfolio.country || ''); // Access 'portfolio' inside 'data'
setSelectedTrack(userData.data.userTracks.track || ''); // Access 'userTracks' inside 'data'

setAvailableTracks(await getTracks());
setIsLoading(false);
} catch (error: any) {
Expand All @@ -85,15 +83,12 @@ const EditProfile = () => {
const response = await fetch('https://hng6-r5y3.onrender.com/api/v1/tracks');
const data = await response.json();
return data.data;
} catch (error: any) {

}
} catch (error: any) {}
};


const handleSubmit = async (e: any) => {
e.preventDefault();

let matchingTrack: any;
matchingTrack = availableTracks.find((track: any) => track.track === selectedTrack);
if (!isLoading) {
Expand Down
3 changes: 1 addition & 2 deletions modules/portfolio/component/skillModal/SkillsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { notify } from '@ui/Toast';
import Loader from '@ui/Loader';
import Portfolio from '../../../../context/PortfolioLandingContext';


type skillModalProps = {
onCloseModal: () => void;
onSaveModal: () => void;
Expand Down Expand Up @@ -43,7 +42,7 @@ const SkillModal = ({ onCloseModal, onSaveModal, isOpen, userId }: skillModalPro
]);
const [arrayTwo, setArrayTwo] = useState<Array<skillListRes>>([]);
const [values, setValues] = useState<Array<skillListRes>>([]);
const slug = useContext(Portfolio);
const slug = useContext(Portfolio);

const fetchSkillData = useCallback(async () => {
try {
Expand Down
10 changes: 8 additions & 2 deletions modules/shop/component/cart/checkout/Summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ const Summary = ({ prices, summary, token }: SummaryProps & { token: string; sum
<div className="cart-summary__prices flex flex-col space-y-3">
<div className="sum flex justify-between">
<p className="font-bold">Subtotal</p>
<span className="text-gray-200">₦ {summary.subtotal ? formatCurrency(summary.subtotal.toFixed(2)) : ''}</span>
<span className="text-gray-200">
₦ {summary.subtotal ? formatCurrency(summary.subtotal.toFixed(2)) : ''}
</span>
</div>

<div className="sum flex justify-between">
Expand Down Expand Up @@ -107,7 +109,11 @@ const Summary = ({ prices, summary, token }: SummaryProps & { token: string; sum
</button>
</div>
{token.length > 0 && modalOpen ? (
<PaymentInformationModal token={token} orderTotal={formatCurrency(summary.total)} closeModal={closeModal} />
<PaymentInformationModal
token={token}
orderTotal={formatCurrency(summary.total)}
closeModal={closeModal}
/>
) : (
<TempUser isOpen={modalOpen} onClose={closeModal} />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ const SuperAdminSidebar = () => {
))}
</div>
</div>
<button className="flex items-center gap-3 text-brand-red-primary border-t py-5 text-xs md:text-sm mx-5 border-white-115" onClick={() => logout(router)}>
<button
className="flex items-center gap-3 text-brand-red-primary border-t py-5 text-xs md:text-sm mx-5 border-white-115"
onClick={() => logout(router)}
>
<LogoutCurve size="20" color="#ff2e2e" />
Log out
</button>
Expand Down
Loading