-
Notifications
You must be signed in to change notification settings - Fork 0
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 #49 from devsoc-unsw/feature/calendarFrontendTo…
…Backend Feature/calendar frontend to backend
- Loading branch information
Showing
14 changed files
with
218 additions
and
20 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
backend/prisma/migrations/20241213143101_20241213074516/migration.sql
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,8 @@ | ||
/* | ||
Warnings: | ||
- A unique constraint covering the columns `[text]` on the table `Keyword` will be added. If there are existing duplicate values, this will fail. | ||
*/ | ||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Keyword_text_key" ON "Keyword"("text"); |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -52,4 +52,3 @@ | |
.monthYearName { | ||
font-size: 1.5rem; | ||
} | ||
|
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
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,40 @@ | ||
import classes from './CalendarEventElement.module.css'; | ||
import EventDetails from '../EventDetails/EventDetails'; | ||
import { useState } from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { format } from 'date-fns' | ||
|
||
interface Event { | ||
startDateTime: Date; | ||
[key: string]: any; | ||
}; | ||
|
||
type CalendarEventElemProps = { | ||
event: Event | ||
} | ||
|
||
function CalendarEventElem(props: CalendarEventElemProps) { | ||
const [eventDetailsOpen, setEventDetailsOpen] = useState(false); | ||
const containerDOM = document.querySelector(`.${classes.container}`) | ||
|
||
const showEventDetails = () => { | ||
setEventDetailsOpen(true); | ||
} | ||
const closeEventDetails = () => setEventDetailsOpen(false); | ||
|
||
return ( | ||
<div className={classes.CalEventElemWrapper} onClick={showEventDetails}> | ||
<p className={classes.title}>{props.event.name}</p> | ||
<p className={classes.startTime}>{format(props.event.startDateTime, 'ha')}</p> | ||
|
||
{ | ||
containerDOM && eventDetailsOpen && ReactDOM.createPortal( | ||
<EventDetails image={props.event.image} backgroundPositionY={props.event.backgroundPositionY} name={props.event.name} | ||
society={props.event.society} eventDate={format(props.event.startDateTime, 'dd-MM-yyyy')} startTime={format(props.event.startDateTime, 'ha')} | ||
endTime={format(props.event.endDateTime, 'ha')} location={props.event.location} attending={0} description={props.event.description} closeEventDetails={closeEventDetails}/>, containerDOM | ||
)} | ||
</div> | ||
) | ||
} | ||
|
||
export default CalendarEventElem |
28 changes: 28 additions & 0 deletions
28
frontend/src/CalendarEventElem/CalendarEventElement.module.css
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,28 @@ | ||
.CalEventElemWrapper{ | ||
border-radius: 20px; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
width: 90%; | ||
height: 20px; | ||
padding: 2%; | ||
background-color: hsl(201, 39%, 87%); | ||
margin-bottom: 5px; | ||
} | ||
|
||
.title { | ||
margin-left: 2%; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
font-size: 14px; | ||
color: hsl(216.4,78%,24.9%); | ||
font-weight:bold; | ||
max-width: 70%; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
.startTime{ | ||
margin-right: 2%; | ||
font-size: 12px; | ||
color: hsl(216, 50%, 35%); | ||
} |
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
Oops, something went wrong.