-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from Dolcinella/main
Add dialog window/Make changes to the About page
- Loading branch information
Showing
5 changed files
with
232 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { defaultHead } from 'next/head'; | ||
import React, { useState, useEffect } from 'react'; | ||
import Image from "next/image"; | ||
import * as Dialog from "@radix-ui/react-dialog"; | ||
|
||
interface ProfileModalProps { | ||
ID: String; | ||
|
||
Name: string; | ||
|
||
Position: string; | ||
|
||
Description: string; | ||
|
||
ImageBuffer: string; | ||
|
||
imageWidth: number; | ||
} | ||
|
||
export default function ProfileModal ({Name, Position, ImageBuffer, Description, imageWidth} : ProfileModalProps) { | ||
const [isSmallScreen, setIsSmallScreen] = useState(false); | ||
|
||
useEffect(() => { | ||
const handleResize = () => { | ||
setIsSmallScreen(window.innerWidth < 1200); | ||
}; | ||
|
||
handleResize(); | ||
|
||
window.addEventListener('resize', handleResize); | ||
|
||
return () => window.removeEventListener('resize', handleResize); | ||
}, []); | ||
|
||
return ( | ||
<div className="content flex" style={{ flexDirection: isSmallScreen ? "column" : "row", padding: '20px', overflowY: 'auto', boxSizing: 'border-box', maxWidth: "60vw", maxHeight: "60vh"}}> | ||
<div className="flex flex-col items-center gap-3"> | ||
<Image src={ImageBuffer} width={imageWidth} height={imageWidth} alt={Name} style={{borderRadius: "100%", minHeight: "20vb", minWidth: "20vb"}} className={`w-[${imageWidth}px] h-[${imageWidth}px] aspect-square rounded-2xl`}/> | ||
<div className='profile-info flex text-center' style={{flexDirection: "column"}}> | ||
|
||
<h2 className='font-bold'>{Name}</h2> | ||
<p>{Position}</p> | ||
|
||
</div> | ||
</div> | ||
<div className='description-section flex text-left' style={{flexDirection: "column", marginLeft: isSmallScreen ? "0px" : "40px", marginTop: isSmallScreen ? "20px" : "0px"}}> | ||
<h3 className='font-bold'>Description</h3> | ||
<p>{Description}</p> | ||
</div> | ||
<Dialog.Close className='close-modal' style={{ position: 'absolute', top: 10, right: 10, padding: '5px 7px', borderRadius: '4px' }}>Close</Dialog.Close> | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.