Details page responsive

This commit is contained in:
austinkelsay 2024-03-19 13:04:46 -05:00
parent 37c824e1c9
commit 919f13c88c
2 changed files with 17 additions and 10 deletions

View File

@ -12,10 +12,9 @@ import ReactMarkdown from 'react-markdown';
import rehypeRaw from 'rehype-raw';
const MarkdownContent = ({ content }) => {
console.log('content:', content);
return (
<div>
<ReactMarkdown rehypePlugins={[rehypeRaw]}>
<ReactMarkdown rehypePlugins={[rehypeRaw]} className='markdown-content'>
{content}
</ReactMarkdown>
</div>
@ -69,11 +68,11 @@ export default function Details() {
}, [event]);
return (
<div className='w-full px-24 pt-12 mx-auto mt-4'>
<div className='w-full flex flex-row justify-between'>
<i className='pi pi-arrow-left pl-8 cursor-pointer hover:opacity-75' onClick={() => router.push('/')} />
<div className='w-[75vw] mx-auto flex flex-row items-start justify-between'>
<div className='flex flex-col items-start max-w-[45vw]'>
<div className='w-full px-24 pt-12 mx-auto mt-4 max-tab:px-0 max-mob:px-0 max-tab:pt-2 max-mob:pt-2'>
<div className='w-full flex flex-row justify-between max-tab:flex-col max-mob:flex-col'>
{/* <i className='pi pi-arrow-left pl-8 cursor-pointer hover:opacity-75 max-tab:pl-2 max-mob:pl-2' onClick={() => router.push('/')} /> */}
<div className='w-[75vw] mx-auto flex flex-row items-start justify-between max-tab:flex-col max-mob:flex-col max-tab:w-[95vw] max-mob:w-[95vw]'>
<div className='flex flex-col items-start max-w-[45vw] max-tab:max-w-[100vw] max-mob:max-w-[100vw]'>
<div className='pt-2 flex flex-row justify-start w-full'>
<Tag className='mr-2' value="Primary"></Tag>
<Tag className='mr-2' severity="success" value="Success"></Tag>
@ -99,7 +98,7 @@ export default function Details() {
</p>
</div>
</div>
<div className='flex flex-col'>
<div className='flex flex-col max-tab:mt-12 max-mob:mt-12'>
{processedEvent && (
<div className='flex flex-col items-center justify-between rounded-lg h-72 p-4 bg-gray-700 drop-shadow-md'>
<Image
@ -127,8 +126,8 @@ export default function Details() {
</div>
</div>
</div>
<div className='w-[75vw] mx-auto mt-32 p-12 border-t-2 border-gray-300'>
{
<div className='w-[75vw] mx-auto mt-32 p-12 border-t-2 border-gray-300 max-tab:p-0 max-mob:p-0 max-tab:max-w-[100vw] max-mob:max-w-[100vw]'>
{
processedEvent?.content && <MarkdownContent content={processedEvent.content} />
}
</div>

View File

@ -62,3 +62,11 @@ h3 {
transform-origin: center center;
animation-fill-mode: forwards; /* Ensures the end state of the animation is retained */
}
/* YT thumbnails */
.markdown-content iframe {
max-width: 100vw;
width: 100%;
height: auto;
aspect-ratio: 16 / 9;
}