mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-06-23 16:05:24 +00:00
styling fixes, guard against edge cases in course handling, guard against invalid slug in navbar
This commit is contained in:
parent
42abbabf9d
commit
6b30d2cce7
@ -239,7 +239,7 @@ const CombinedLesson = ({ lesson, course, decryptionPerformed, isPaid, setComple
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<div
|
<div
|
||||||
className={`${isVideo ? 'bg-gray-800/90 rounded-lg p-4 m-4' : 'w-full mx-auto px-4 py-8 -mt-32 relative z-10'}`}
|
className={`${isVideo ? 'bg-gray-800/90 rounded-lg p-4 m-4 max-mob:px-0' : 'w-full mx-auto px-4 py-8 -mt-32 relative z-10'}`}
|
||||||
>
|
>
|
||||||
<div className={`${!isVideo && 'mb-8 bg-gray-800/70 rounded-lg p-4'}`}>
|
<div className={`${!isVideo && 'mb-8 bg-gray-800/70 rounded-lg p-4'}`}>
|
||||||
<div className="flex flex-row items-center justify-between w-full">
|
<div className="flex flex-row items-center justify-between w-full">
|
||||||
|
@ -217,7 +217,7 @@ export default function CourseDetails({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full bg-gray-800 p-4 rounded-lg">
|
<div className="w-full bg-gray-800 p-4 max-mob:px-0 rounded-lg">
|
||||||
<Toast ref={toastRef} />
|
<Toast ref={toastRef} />
|
||||||
<WelcomeModal />
|
<WelcomeModal />
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import { Tag } from 'primereact/tag';
|
import { Tag } from 'primereact/tag';
|
||||||
import { useRouter } from 'next/router';
|
|
||||||
import ZapDisplay from '@/components/zaps/ZapDisplay';
|
import ZapDisplay from '@/components/zaps/ZapDisplay';
|
||||||
import MoreOptionsMenu from '@/components/ui/MoreOptionsMenu';
|
import MoreOptionsMenu from '@/components/ui/MoreOptionsMenu';
|
||||||
import { Divider } from 'primereact/divider';
|
import { Divider } from 'primereact/divider';
|
||||||
@ -20,8 +19,6 @@ export default function MobileCourseDetails({
|
|||||||
isCompleted,
|
isCompleted,
|
||||||
showCompletedTag
|
showCompletedTag
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* Mobile-specific layout */}
|
{/* Mobile-specific layout */}
|
||||||
@ -33,6 +30,9 @@ export default function MobileCourseDetails({
|
|||||||
processedEvent.topics.map((topic, index) => (
|
processedEvent.topics.map((topic, index) => (
|
||||||
<Tag className="text-white" key={index} value={topic}></Tag>
|
<Tag className="text-white" key={index} value={topic}></Tag>
|
||||||
))}
|
))}
|
||||||
|
{isCompleted && showCompletedTag && (
|
||||||
|
<Tag severity="success" value="Completed" />
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Title and zaps in same row */}
|
{/* Title and zaps in same row */}
|
||||||
|
@ -204,7 +204,7 @@ const VideoLesson = ({ lesson, course, decryptionPerformed, isPaid, setCompleted
|
|||||||
<Toast ref={toastRef} />
|
<Toast ref={toastRef} />
|
||||||
{renderContent()}
|
{renderContent()}
|
||||||
<Divider />
|
<Divider />
|
||||||
<div className="bg-gray-800/90 rounded-lg p-4 m-4">
|
<div className="bg-gray-800/90 rounded-lg p-4 m-4 max-mob:px-2">
|
||||||
<div className="w-full flex flex-col items-start justify-start mt-2 px-2">
|
<div className="w-full flex flex-col items-start justify-start mt-2 px-2">
|
||||||
<div className="flex flex-row items-center justify-between w-full">
|
<div className="flex flex-row items-center justify-between w-full">
|
||||||
<h1 className="text-3xl text-white">{lesson.title}</h1>
|
<h1 className="text-3xl text-white">{lesson.title}</h1>
|
||||||
|
@ -272,7 +272,7 @@ const VideoDetails = ({
|
|||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<Toast ref={toastRef} />
|
<Toast ref={toastRef} />
|
||||||
{renderContent()}
|
{renderContent()}
|
||||||
<div className="bg-gray-800/90 rounded-lg p-4 m-4 max-mob:m-0 max-tab:m-0 max-mob:rounded-t-none max-tab:rounded-t-none">
|
<div className="bg-gray-800/90 rounded-lg p-4 m-4 max-mob:px-2 max-tab:px-2 max-mob:m-0 max-tab:m-0 max-mob:rounded-t-none max-tab:rounded-t-none">
|
||||||
<div className={`w-full flex flex-col items-start justify-start mt-2 px-2`}>
|
<div className={`w-full flex flex-col items-start justify-start mt-2 px-2`}>
|
||||||
<div className="flex flex-col items-start gap-2 w-full">
|
<div className="flex flex-col items-start gap-2 w-full">
|
||||||
<div className="flex flex-row items-center justify-between gap-2 w-full">
|
<div className="flex flex-row items-center justify-between gap-2 w-full">
|
||||||
|
@ -34,13 +34,16 @@ const Navbar = () => {
|
|||||||
const fetchCourse = async () => {
|
const fetchCourse = async () => {
|
||||||
try {
|
try {
|
||||||
const { slug } = router.query;
|
const { slug } = router.query;
|
||||||
|
if (!slug) return; // still preparing
|
||||||
|
|
||||||
|
const slugStr = Array.isArray(slug) ? slug[0] : slug;
|
||||||
let identifier;
|
let identifier;
|
||||||
|
|
||||||
if (slug.includes('naddr')) {
|
if (slugStr.includes('naddr')) {
|
||||||
const { data } = nip19.decode(slug);
|
const { data } = nip19.decode(slugStr);
|
||||||
identifier = data?.identifier;
|
identifier = data?.identifier;
|
||||||
} else {
|
} else {
|
||||||
identifier = slug;
|
identifier = slugStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (identifier) {
|
if (identifier) {
|
||||||
|
@ -402,10 +402,10 @@ const Course = () => {
|
|||||||
// Render the QA section (empty for now)
|
// Render the QA section (empty for now)
|
||||||
const renderQASection = () => {
|
const renderQASection = () => {
|
||||||
return (
|
return (
|
||||||
<div className="rounded-lg p-8 mt-4 bg-gray-800">
|
<div className="rounded-lg p-8 mt-4 bg-gray-800 max-mob:px-4">
|
||||||
<h2 className="text-xl font-bold mb-4">Comments</h2>
|
<h2 className="text-xl font-bold mb-4">Comments</h2>
|
||||||
{nAddress !== null && isAuthorized ? (
|
{nAddress !== null && isAuthorized ? (
|
||||||
<div className="px-4">
|
<div className="px-4 max-mob:px-0">
|
||||||
<ZapThreadsWrapper
|
<ZapThreadsWrapper
|
||||||
anchor={nAddress}
|
anchor={nAddress}
|
||||||
user={nsec || npub || null}
|
user={nsec || npub || null}
|
||||||
@ -513,7 +513,7 @@ const Course = () => {
|
|||||||
<>
|
<>
|
||||||
<div className="mx-auto px-8 max-mob:px-0 mb-12 mt-4">
|
<div className="mx-auto px-8 max-mob:px-0 mb-12 mt-4">
|
||||||
{/* Tab navigation using MenuTab component */}
|
{/* Tab navigation using MenuTab component */}
|
||||||
<div className="sticky z-10 bg-transparent border-b border-gray-700/30"
|
<div className="z-10 bg-transparent border-b border-gray-700/30"
|
||||||
style={{
|
style={{
|
||||||
top: `${navbarHeight}px`,
|
top: `${navbarHeight}px`,
|
||||||
height: `${navbarHeight}px`
|
height: `${navbarHeight}px`
|
||||||
|
@ -191,7 +191,7 @@ export default function Home() {
|
|||||||
className="w-full"
|
className="w-full"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full px-4">
|
<div className="w-full px-4 max-mob:px-0">
|
||||||
<CoursesCarousel />
|
<CoursesCarousel />
|
||||||
<VideosCarousel />
|
<VideosCarousel />
|
||||||
<DocumentsCarousel />
|
<DocumentsCarousel />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user