Karitchi / infolab

0 stars 0 forks source link

Add Announcement Feature & Refactor Layout #60

Closed Karitchi closed 2 weeks ago

Karitchi commented 2 weeks ago

This pull request introduces a feature for adding announcements to the application and includes various UI and layout changes. Key changes include:

  1. Add Announcement Feature:

    • New Page for Adding Announcements (app/admin/page.jsx):
      • A form-based page to submit announcements, including inputs for title, body, and author.
      • Integrated toast notifications to display success or error messages.
    • Backend Logic (app/lib/serverActions.jsx):
      • Handles form validation and submission of announcements to the database.
      • Uses the joi validation library for data validation.
      • Introduces a new database schema to store announcements.
    • UI Components for the Form (app/ui/):
      • AddAnnounceButton.jsx: A button component with a save icon.
      • AddAnnounceInputs.jsx: Form inputs for title, description, and author.
      • Title.jsx: A component to display the title of the page.
  2. UI/Styling Enhancements:

    • CSS Refactor (app/globals.css):
      • Removed custom color schemes and body styling, relying on default Tailwind CSS utilities.
    • Updated Layout (app/layout.js):
      • Replaced custom fonts with a Google font (Dosis), applied globally to the layout for consistency.
      • Introduced a gradient background and enhanced typography for better visual appeal.
  3. Database Schema Changes:

    • SQL Update (initialize_db.sql):
      • Altered the announcements table to use VARCHAR(1000) for the body instead of TEXT.
      • Added a new SQL block to insert a dummy user if one does not exist.
  4. File Changes:

    • Font Files Removal: Removed unused font files (GeistMonoVF.woff, GeistVF.woff) and replaced them with Google Fonts.
    • Added Save Icon: Added a new SVG icon (public/icons/save.svg) for the add announcement button.

Dependencies:

Impact:

Notes:

This PR implements a significant feature for managing announcements and improves the overall styling and user experience.