icssc / icssc-website

Website for the ICS Student Council
https://studentcouncil.ics.uci.edu
MIT License
9 stars 2 forks source link

fix: Handle events without Images #94

Open KevinWu098 opened 1 year ago

KevinWu098 commented 1 year ago

Currently, events are formatted like this:

        {
            "src":"/assets/img/events/internpanel.jpg",
            "title":"Internship Panel",
            "time":"Wednesday, October 18th, 2023",
            "location": "DBH 6011 7- 8 PM",
            "desc": "Looking for advice in applying for internships this application season ❓ Come meet our panelists and receive insight/listen to personal experiences about the application process at our ICSSC Internship Pane!"
        },

Every other field can be empty, but Next's Image element requires that an image, passed as src be given to it. We could handle this in a handful of ways, but a simple Image Not Found placeholder (possibly with a cute Anteater) would do.

Something like: src={src ? src : imgNotFound}