Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
dd4fc4a
Merge pull request #210 from ctfguide-tech/dev
Laphatize Sep 15, 2024
f94b1f0
Merge pull request #211 from ctfguide-tech/dev
Laphatize Sep 17, 2024
f96c101
Merge pull request #212 from ctfguide-tech/dev
Laphatize Sep 18, 2024
1ea585e
Update middleware.js
Laphatize Sep 19, 2024
0ce1597
Merge pull request #213 from ctfguide-tech/dev
Laphatize Sep 19, 2024
a63e16f
Merge pull request #214 from ctfguide-tech/dev
Laphatize Sep 19, 2024
372a427
Update StandardNav.jsx
Laphatize Sep 19, 2024
008a110
Update StandardNav.jsx
Laphatize Sep 19, 2024
ac8987d
Update StandardNav.jsx
Laphatize Sep 20, 2024
3a9ce4b
Merge pull request #215 from ctfguide-tech/dev
Laphatize Nov 12, 2024
f81a98b
Merge pull request #216 from ctfguide-tech/dev
Laphatize Nov 12, 2024
94bcefa
Merge pull request #217 from ctfguide-tech/dev
Laphatize Nov 12, 2024
33d4bf4
Merge pull request #218 from ctfguide-tech/dev
Laphatize Nov 13, 2024
a6dcba3
Merge pull request #219 from ctfguide-tech/dev
Laphatize Nov 13, 2024
92ec53f
Merge pull request #220 from ctfguide-tech/dev
Laphatize Nov 13, 2024
9d15ccb
Merge pull request #221 from ctfguide-tech/dev
Laphatize Nov 15, 2024
6f52f9c
Update careers.jsx
Laphatize Dec 11, 2024
32d7508
Update careers.jsx
Laphatize Dec 11, 2024
da6f5fe
Update Hero.jsx
Laphatize Dec 14, 2024
eb44bd9
Merge pull request #223 from ctfguide-tech/dev
Laphatize Jan 5, 2025
8c1808b
feat: fix bug with image rednering
Laphatize Jan 5, 2025
e254eea
feat: cors fix
Laphatize Jan 5, 2025
f5974f7
feat: cors fix
Laphatize Jan 5, 2025
a5b9fe9
feat: beta learn flag
Laphatize Jan 5, 2025
80cd825
feat: update coloring of modal
Laphatize Jan 5, 2025
754b5a2
feat: updating coloring of beta flag modal
Laphatize Jan 5, 2025
52ad0a2
feat: fix webcontainers
Laphatize Jan 5, 2025
59ebf37
feat: CTFGuide AI, Learn improvements, etc
Laphatize Jan 5, 2025
cc7b61b
feat: temp disabled some things
Laphatize Jan 5, 2025
495d4ac
feat: misc ui changes
Laphatize Jan 6, 2025
59d46ec
feat: studio ui/ux improvements
Laphatize Jan 6, 2025
35caa6d
feat: bug fixes
Laphatize Jan 6, 2025
69712cf
feat: moderation flow for learn
Laphatize Jan 6, 2025
85fe164
chore: remove unused import
Laphatize Jan 6, 2025
3b041ac
feat: renable learn ui
Laphatize Jan 6, 2025
ec8b946
feat: update ui
Laphatize Jan 6, 2025
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
33 changes: 16 additions & 17 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,22 @@ const nextConfig = {
esmExternals: 'loose',
},
transpilePackages: ['@uiw/react-md-editor', '@uiw/react-markdown-preview'],
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'Cross-Origin-Embedder-Policy',
value: 'require-corp',
},
{
key: 'Cross-Origin-Opener-Policy',
value: 'same-origin',
},
],
},
];
},
// next.config.js
// async headers() {
// return [
// {
// source: '/(.*)',
// headers: [
// { key: 'Cross-Origin-Opener-Policy', value: 'same-origin' },
// { key: 'Cross-Origin-Embedder-Policy', value: 'credentialless' },
// // Optionally, you can add this if you still have issues with images:
// // { key: 'Cross-Origin-Resource-Policy', value: 'cross-origin' },
// ],
// },

// ];
// }

};

module.exports = withPWA(removeImports(nextConfig));
100 changes: 75 additions & 25 deletions src/components/StandardNav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
EllipsisVerticalIcon,
ShieldCheckIcon,
BellIcon,
UserGroupIcon,
} from '@heroicons/react/24/outline';
import { Logo } from '@/components/Logo';
import Link from 'next/link';
Expand All @@ -39,6 +40,7 @@ import SpawnTerminal from './nav/SpawnTerminal';
import { Context } from '@/context';
import { useContext } from 'react';
import timeTracker from '@/utils/timeTracker';
import NotificationsModal from './nav/NotificationsModal';

function classNames(...classes) {
return classes.filter(Boolean).join(' ');
Expand Down Expand Up @@ -269,6 +271,8 @@ export function StandardNav({ guestAllowed, alignCenter = true }) {
};
}, []);

const [showAllNotifications, setShowAllNotifications] = useState(false);

return (
<>
{isPopoverOpen && (
Expand Down Expand Up @@ -379,24 +383,33 @@ export function StandardNav({ guestAllowed, alignCenter = true }) {
leaveFrom="opacity-100 translate-y-0"
leaveTo="opacity-0 translate-y-1"
>
<Popover.Panel className="absolute z-10 w-48 max-w-sm transform px-4 sm:px-0 lg:max-w-3xl">
<div className="overflow-hidden shadow-lg ">
<div className="relative grid gap-6 border border-neutral-800 bg-neutral-900 sm:gap-8 sm:p-8">
<Popover.Panel className="absolute z-10 w-64 transform px-4 sm:px-0">
<div className="overflow-hidden rounded-xl shadow-lg ring-1 ring-black/5">
<div className="relative bg-neutral-900 p-3">
<Link
href="/create"
className="flex w-full items-start rounded-lg "
className="flex items-center space-x-3 rounded-lg px-4 py-3 text-base text-gray-300 transition-all hover:bg-neutral-800 hover:text-white"
>
<p className="text-base font-medium text-gray-400 hover:text-white">
Create
</p>
<div className="flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg bg-neutral-800 text-white">
<PencilSquareIcon className="h-5 w-5" />
</div>
<div>
<p className="font-medium">Create</p>
<p className="text-sm text-gray-500">Design your own challenges</p>
</div>
</Link>

<Link
href="/groups"
className=" s flex items-start rounded-lg"
className="mt-2 flex items-center space-x-3 rounded-lg px-4 py-3 text-base text-gray-300 transition-all hover:bg-neutral-800 hover:text-white"
>
<p className="text-base font-medium text-gray-400 hover:text-white">
Classrooms
</p>
<div className="flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg bg-neutral-800 text-white">
<UserGroupIcon className="h-5 w-5" />
</div>
<div>
<p className="font-medium">Classrooms</p>
<p className="text-sm text-gray-500">Join or manage your classes</p>
</div>
</Link>
</div>
</div>
Expand Down Expand Up @@ -480,20 +493,52 @@ export function StandardNav({ guestAllowed, alignCenter = true }) {
leaveFrom="opacity-100 translate-y-0"
leaveTo="opacity-0 translate-y-1"
>
<Popover.Panel className="absolute right-0 mt-2 w-80 bg-neutral-800 rounded-md shadow-lg overflow-hidden z-20">
<div className="py-2">
{notificationData.length > 0 ? (
notificationData.slice(0, 6).map((notification, index) => (
<div key={index} className="flex items-center px-4 py-3 ">

<div className="ml-3 text-white">
<p className="text-sm font-medium">{notification.message}</p>
<p className="text-xs">{notification.receivedTime}</p>
<Popover.Panel className="absolute right-0 mt-2 w-80 bg-neutral-900 rounded-md shadow-lg overflow-hidden z-20">
<div className="p-2">
<div className="px-4 py-3 border-b border-neutral-800">
<h3 className="text-sm font-medium text-white">Notifications</h3>
</div>

<div className="max-h-96 overflow-y-auto">
{notificationData.length > 0 ? (
notificationData.slice(0, 6).map((notification, index) => (
<div
key={index}
className="px-4 py-3 hover:bg-neutral-800 transition-colors cursor-pointer border-b border-neutral-800/50 last:border-0"
>
<div className="flex items-start">
<div className="flex-shrink-0">
<div className="h-8 w-8 rounded-full bg-blue-500/10 flex items-center justify-center">
<BellIcon className="h-4 w-4 text-blue-500" />
</div>
</div>
<div className="ml-3 flex-1">
<p className="text-sm text-gray-200">{notification.message}</p>
<p className="text-xs text-gray-500 mt-1">{notification.receivedTime}</p>
</div>
</div>
</div>
))
) : (
<div className="px-4 py-6 text-center">
<BellIcon className="mx-auto h-8 w-8 text-gray-500" />
<p className="mt-2 text-sm text-gray-500">No new notifications</p>
</div>
))
) : (
<p className="text-center text-gray-500 py-4">No notifications</p>
)}
</div>

{notificationData.length > 0 && (
<div className="px-4 py-3 bg-neutral-900 border-t border-neutral-800">
<button
onClick={() => {
setShowAllNotifications(true)
setIsPopoverOpen(false) // Close the notifications popover
}}
className="block w-full text-sm text-blue-500 hover:text-blue-400 text-center"
>
View all notifications
</button>
</div>
)}
</div>
</Popover.Panel>
Expand Down Expand Up @@ -743,14 +788,19 @@ export function StandardNav({ guestAllowed, alignCenter = true }) {
/>
<Upgrade open={upgradeModalOpen} setOpen={setUpgradeModalOpen} />

<div className="mx-auto hidden w-full bg-yellow-800 py-1 text-center text-sm text-white ">
<div className="mx-auto hidden w-full bg-yellow-800 py-1 text-center text-sm text-white ">
<h1 className="mx-auto px-4 text-left">
Our terminal infrastructure is experiencing issues due to hardware faults. We are taking steps to resolve this and get things working again as possible.
Our server hosting provider is experiencing issues which may result in CTFGuide not working as expected. Join our <a className="font-bold" href="https://discord.gg/BwbCYHVX">Discord</a> for updates.
</h1>
</div>


<SpawnTerminal open={terminaIsOpen} setOpen={setTerminalIsOpen} />
<NotificationsModal
open={showAllNotifications}
setOpen={setShowAllNotifications}
notifications={notificationData}
/>
</>
);
}
Loading