Skip to content

Commit 73f8736

Browse files
authored
Merge pull request #102 from ctfguide-tech/dev
merge dev into main
2 parents c7bef99 + 4f26966 commit 73f8736

File tree

20 files changed

+1768
-1547
lines changed

20 files changed

+1768
-1547
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"react-simplemde-editor": "^5.2.0",
5757
"react-text-loop": "^2.3.0",
5858
"react-text-transition": "^3.1.0",
59-
"react-toastify": "^9.1.3",
59+
"react-toastify": "^10.0.5",
6060
"react-tooltip": "^5.25.1",
6161
"react-top-loading-bar": "^2.3.1",
6262
"react-visibility-sensor": "^5.1.1",

public/geo-pattern.svg

Lines changed: 1 addition & 0 deletions
Loading

src/components/StandardNav.jsx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function classNames(...classes) {
2828
const auth = getAuth();
2929
const baseUrl = process.env.NEXT_PUBLIC_FRONTEND_URL;
3030

31-
const adminList = ['pranav,'];
31+
const adminList = ['pranav'];
3232

3333
const DEFAULT_NOTIFICATION = {
3434
image:
@@ -38,12 +38,12 @@ const DEFAULT_NOTIFICATION = {
3838
receivedTime: '12h ago',
3939
};
4040

41-
export function StandardNav() {
41+
export function StandardNav(props) {
4242
const [isAdmin, setIsAdmin] = useState(false);
4343
const [points, setPoints] = useState('0');
4444
const [notifications, setNotifications] = useState([]);
4545
const [showBanner, setShowBanner] = useState(false);
46-
46+
const { guestAllowed } = props;
4747
const router = useRouter();
4848

4949
function logout() {
@@ -81,13 +81,22 @@ export function StandardNav() {
8181
]);
8282

8383
const [username, setUsername] = useState(null);
84-
const [pfp, setPfp] = useState('');
84+
const [pfp, setPfp] = useState(null);
8585

8686
// get user's profile picture
8787
useEffect(() => {
8888
if (!username) {
8989
return;
9090
}
91+
92+
93+
if (localStorage.getItem("pfp")) {
94+
setPfp(localStorage.getItem("pfp"));
95+
}
96+
97+
98+
99+
91100
const fetchData = async () => {
92101
try {
93102
const endPoint = process.env.NEXT_PUBLIC_API_URL + '/users/' + username + '/pfp';
@@ -258,7 +267,8 @@ export function StandardNav() {
258267
)}
259268
</div>
260269
</div>
261-
<div className="flex items-center">
270+
{ !guestAllowed &&
271+
<div className="flex items-center ">
262272
<div
263273
className="mb-0 flex items-center space-x-2 rounded-lg px-4 py-1"
264274
style={{ backgroundColor: '#212121', borderWidth: '0px' }}
@@ -389,6 +399,8 @@ export function StandardNav() {
389399
</Menu>
390400
</div>
391401
</div>
402+
}
403+
392404
</div>
393405
</div>
394406

src/components/auth/AuthFooter.jsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import Link from 'next/link';
2+
3+
export default function AuthFooter() {
4+
return (
5+
6+
<div className='text-neutral-500 text-sm mt-4 items-center justify-center'>
7+
&copy; CTFGuide Corporation 2024 <br />
8+
<div className='flex items-center'>
9+
<Link href="/terms-of-service" target="_blank" rel="noopener noreferrer" className="text-sm text-blue-600 hover:text-blue-700 mr-2">Terms of Service</Link>
10+
<Link href="/privacy-policy" target="_blank" rel="noopener noreferrer" className="text-sm text-blue-600 hover:text-blue-700 mr-2">Privacy Policy</Link>
11+
<a href="https://status.ctfguide.com" target="_blank" rel="noopener noreferrer" className="text-sm text-blue-600 hover:text-blue-700 ">Status</a>
12+
</div>
13+
14+
15+
</div>
16+
)
17+
}
18+

src/components/dashboard/DashboardHeader.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ export function DashboardHeader() {
1414

1515
const [points, setPoints] = useState('');
1616
const [rank, setRank] = useState('');
17+
const baseUrl = process.env.NEXT_PUBLIC_FRONTEND_URL;
18+
1719

1820
useEffect(() => {
1921
try {
@@ -50,6 +52,7 @@ export function DashboardHeader() {
5052
console.log(result)
5153
if (result) {
5254
setPfp(result)
55+
localStorage("pfp", result)
5356
} else {
5457
setPfp(`https://robohash.org/${username}.png?set=set1&size=150x150`)
5558
}
@@ -84,7 +87,7 @@ export function DashboardHeader() {
8487
<div className="mx-auto max-w-7xl ">
8588
<div className="-mt-12 sm:-mt-16 sm:flex sm:items-end sm:space-x-5">
8689
<div className="flex">
87-
<a href={`https://ctfguide.com/users/${username}`}>
90+
<a href={`${baseUrl}/users/${username}`}>
8891
{(pfp && (
8992
<img
9093
style={{ borderColor: '#ffbf00' }}

src/components/dashboard/SideNavContents.jsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
export function SideNavContent({ username }) {
1+
import { useState } from 'react';
2+
import { useEffect } from 'react';
3+
4+
export function SideNavContent({ }) {
5+
6+
const [username, setUsername] = useState(null);
7+
8+
useEffect(() => {
9+
setUsername(localStorage.getItem('username'))
10+
}, []);
11+
212
return (
313
<>
414
<div
@@ -16,7 +26,7 @@ export function SideNavContent({ username }) {
1626
</li>
1727
<li className="mb-4 py-1">
1828
<a
19-
href={`../dashboard/profile`}
29+
href={`../users/${username}`}
2030
className="px-2 py-1 text-lg font-medium text-white hover:text-neutral-300"
2131
>
2232
<i class="fas fa-user-circle mr-2"></i>Profile

src/components/home/Hero.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function Hero() {
111111
</div>
112112
<div className="py-24 sm:py-32 lg:pb-40">
113113
<div className="mx-auto max-w-7xl px-6 lg:px-8">
114-
<div className="mx-auto max-w-4xl text-center">
114+
<div className= " animate__animated animate__fadeInUp mx-auto max-w-4xl text-center">
115115
<h1 className="text-4xl font-bold tracking-normal text-white sm:text-6xl leading-relaxed ">
116116
The platform that <span className="text-blue-600 leading-relaxed">
117117
<TextLoop>
@@ -127,7 +127,7 @@ export function Hero() {
127127
<div className="mt-10 flex items-center justify-center gap-x-6">
128128
<a
129129
href="../register"
130-
className="rounded-md px-6 py-1.5 text-lg font-semibold text-white border border-white hover:bg-slate-900 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-400"
130+
className="rounded-md px-6 py-1.5 text-lg font-semibold text-white border border-white hover:bg-neutral-800/100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-400"
131131
>
132132
Get started
133133
</a>
@@ -145,7 +145,7 @@ export function Hero() {
145145
autoPlay
146146
width={2432}
147147
height={1442}
148-
className="mt-16 rounded-md bg-white/5 shadow-2xl ring-1 ring-white/10 sm:mt-24"
148+
className="animate__animated animate__fadeInUp mt-16 rounded-md bg-white/5 shadow-2xl ring-1 ring-white/10 sm:mt-24"
149149

150150
>
151151
<source src="../sample_vid.mp4" type="video/mp4" />

0 commit comments

Comments
 (0)