diff --git a/package.json b/package.json
index 3ad77ef..cdac08b 100644
--- a/package.json
+++ b/package.json
@@ -10,13 +10,12 @@
"test": "jest"
},
"dependencies": {
- "@headlessui/react": "^2.1.9",
- "@headlessui/tailwindcss": "^0.2.1",
"@nextui-org/date-picker": "^2.1.8",
"@nextui-org/theme": "^2.2.11",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-progress": "^1.1.0",
+ "@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-slot": "^1.1.0",
"@tanstack/react-query": "^5.51.5",
"axios": "^1.7.2",
@@ -32,6 +31,7 @@
"react-dom": "^18",
"tailwind-merge": "^2.5.5",
"tailwindcss-animate": "^1.0.7",
+ "uuid": "^11.0.3",
"zustand": "^4.5.4"
},
"devDependencies": {
diff --git a/public/app-icons/Scooped.png b/public/app-icons/Scooped.png
deleted file mode 100644
index 54f7b92..0000000
Binary files a/public/app-icons/Scooped.png and /dev/null differ
diff --git a/src/app/past/page.tsx b/src/app/past/page.tsx
index 4e0c800..28aa7bf 100644
--- a/src/app/past/page.tsx
+++ b/src/app/past/page.tsx
@@ -1,7 +1,23 @@
-export default function Past() {
+"use client";
+
+import AuthGuard from "@/components/authGuard/authGuard";
+import Past from "@/components/past/past";
+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+
+export default function PastPage() {
+ const queryClient = new QueryClient({
+ defaultOptions: {
+ queries: {
+ refetchOnWindowFocus: false, // default: true
+ },
+ },
+ });
+
return (
-
-
Past Announcements
-
+
+
+
+
+
);
}
diff --git a/src/components/announcement/announcementBanner.tsx b/src/components/announcement/announcementBanner.tsx
index 45cf3f9..e7af974 100644
--- a/src/components/announcement/announcementBanner.tsx
+++ b/src/components/announcement/announcementBanner.tsx
@@ -1,4 +1,4 @@
-import CrossThick from "@/icons/CrossThickIcon";
+import CrossThick from "@/icons/crossThickIcon";
import { Announcement } from "@/models/announcement";
interface Props {
diff --git a/src/components/announcement/announcementCell.tsx b/src/components/announcement/announcementCell.tsx
index c0ed7a7..1f9ca61 100644
--- a/src/components/announcement/announcementCell.tsx
+++ b/src/components/announcement/announcementCell.tsx
@@ -1,8 +1,9 @@
-import AppIcon from "@/icons/AppIcon";
-import TertiaryButton from "../system/ButtonTertiary";
+import AppIcon from "@/icons/appIcon";
+import ButtonTertiary from "../system/button/buttonTertiary";
import { Announcement } from "@/models/announcement";
import { dateInRange, filterActiveAnnouncements, formatDate } from "@/utils/utils";
import AnnouncementIndicator from "./announcementIndicator";
+import { DateFormat } from "@/models/enums/dateFormat";
interface Props {
announcement: Announcement;
@@ -18,31 +19,34 @@ export default function AnnouncementCell({ announcement, onClick, onEditClick }:
className="flex flex-col p-6 items-start md:items-end md:flex-row justify-center gap-6 md:gap-8 self-stretch bg-neutral-white rounded-lg border border-other-stroke relative cursor-pointer"
onClick={onClick}
>
-
+
-
+
{announcement.title}
- {" "}
- {formatDate(new Date(announcement.startDate))} - {formatDate(new Date(announcement.endDate))}{" "}
+ {formatDate(new Date(announcement.startDate), DateFormat.SHORT)} -{" "}
+ {formatDate(new Date(announcement.endDate), DateFormat.SHORT)}
- {isActive ?
: null}
+ {isActive ? (
+
+ ) : null}
-
- {announcement.apps.map((app) => (
-
- ))}
+
+
+ {announcement.apps.map((app) => (
+
+ ))}
+
+ {dateInRange(new Date(announcement.startDate), new Date(announcement.endDate), new Date()) ? (
+
+ ) : null}
- {isActive ?
: null}
+ {isActive ? (
+
+ ) : null}
- {dateInRange(new Date(announcement.startDate), new Date(announcement.endDate), new Date()) ? (
-
- ) : null}
);
}
diff --git a/src/components/announcement/announcementForm.tsx b/src/components/announcement/announcementForm.tsx
index 0ed169a..ae3ca62 100644
--- a/src/components/announcement/announcementForm.tsx
+++ b/src/components/announcement/announcementForm.tsx
@@ -1,13 +1,13 @@
-import CrossThinIcon from "@/icons/CrossThinIcon";
-import SpeakerIcon from "@/icons/SpeakerIcon";
+import CrossThinIcon from "@/icons/crossThinIcon";
+import SpeakerIcon from "@/icons/speakerIcon";
import AnnouncementBanner from "./announcementBanner";
-import { useMemo, useState } from "react";
+import { useEffect, useMemo, useState } from "react";
import { Announcement } from "@/models/announcement";
import InputText from "../system/input/inputText";
import InputDatePicker from "../system/input/inputDatePicker";
import InputMultiSelect from "../system/input/inputMultiselect";
import InputUpload from "../system/input/inputUpload";
-import ButtonPrimary1 from "../system/ButtonPrimary1";
+import ButtonPrimary1 from "../system/button/buttonPrimary1";
import { useUserStore } from "@/stores/useUserStore";
import { addDays } from "date-fns";
@@ -46,9 +46,11 @@ export default function AnnouncementForm({ onClose, editingAnnouncement }: Props
() =>
announcement.apps.length !== 0 &&
announcement.body !== "" &&
+ announcement.endDate &&
announcement.endDate !== "" &&
announcement.imageUrl !== "" &&
announcement.link !== "" &&
+ announcement.startDate &&
announcement.startDate !== "" &&
announcement.title !== "",
[announcement]
@@ -59,7 +61,7 @@ export default function AnnouncementForm({ onClose, editingAnnouncement }: Props
if (!user) return;
try {
- console.log("scheduling");
+ console.log("Scheduling", announcement);
} catch (err) {
console.error(err);
}
@@ -110,8 +112,8 @@ export default function AnnouncementForm({ onClose, editingAnnouncement }: Props
to: new Date(announcement.endDate),
}}
setDateRange={(dateRange) => {
- handleChange("startDate", dateRange.from);
- handleChange("endDate", dateRange.to);
+ handleChange("startDate", dateRange?.from ?? "");
+ handleChange("endDate", dateRange?.to ?? "");
}}
/>
@@ -123,7 +125,7 @@ export default function AnnouncementForm({ onClose, editingAnnouncement }: Props
/>
Apps
- handleChange("apps", apps)} />
+ handleChange("apps", apps)} />
Upload Image
diff --git a/src/components/announcement/announcementModal.tsx b/src/components/announcement/announcementModal.tsx
index 24173fa..1bf87d4 100644
--- a/src/components/announcement/announcementModal.tsx
+++ b/src/components/announcement/announcementModal.tsx
@@ -1,11 +1,12 @@
import { Announcement } from "@/models/announcement";
import AnnouncementBanner from "./announcementBanner";
-import AppIcon from "@/icons/AppIcon";
-import ButtonPrimary2 from "../system/ButtonPrimary2";
-import ButtonPrimary3 from "../system/ButtonPrimary3";
-import CrossThinIcon from "@/icons/CrossThinIcon";
+import AppIcon from "@/icons/appIcon";
+import CrossThinIcon from "@/icons/crossThinIcon";
import { dateInRange, formatDate } from "@/utils/utils";
import AnnouncementIndicator from "./announcementIndicator";
+import { DateFormat } from "@/models/enums/dateFormat";
+import ButtonSecondary2 from "../system/button/buttonSecondary2";
+import ButtonPrimary2 from "../system/button/buttonPrimary2";
interface AnnouncementModalProps {
onClose: () => void;
@@ -28,7 +29,10 @@ export default function AnnouncementModal({ onClose, announcement }: Announcemen
- {`${formatDate(new Date(announcement.startDate))} - ${formatDate(new Date(announcement.endDate))}`}
+ {`${formatDate(new Date(announcement.startDate), DateFormat.SHORT)} - ${formatDate(
+ new Date(announcement.endDate),
+ DateFormat.SHORT
+ )}`}
@@ -50,12 +54,12 @@ export default function AnnouncementModal({ onClose, announcement }: Announcemen
{dateInRange(new Date(announcement.startDate), new Date(announcement.endDate), new Date()) ? (
- console.log("End Live Announcement button tapped")}
/>
) : (
- console.log("Delete button tapped")} />
+ console.log("Delete button tapped")} />
)}
diff --git a/src/components/common/navBar.tsx b/src/components/common/navBar.tsx
index 3a126f2..5fd9be2 100644
--- a/src/components/common/navBar.tsx
+++ b/src/components/common/navBar.tsx
@@ -1,6 +1,6 @@
import appDevLogo from "@/../public/images/appdev_logo.png";
import appDevLogoName from "@/../public/images/appdev_logo_name.png";
-import ButtonSecondary2 from "../system/ButtonSecondary2";
+import ButtonSecondary2 from "../system/button/buttonSecondary2";
import { Constants } from "@/utils/constants";
import { useUserStore } from "@/stores/useUserStore";
import { useRouter } from "next/navigation";
@@ -25,7 +25,7 @@ export default function NavBar() {
-
+
diff --git a/src/components/landing/landing.tsx b/src/components/landing/landing.tsx
index cf47449..3df2232 100644
--- a/src/components/landing/landing.tsx
+++ b/src/components/landing/landing.tsx
@@ -56,7 +56,7 @@ export default function Landing() {
};
return user?.name !== "" ? (
-
+
{showForm ?
: null}
diff --git a/src/components/landing/landingActiveSection.tsx b/src/components/landing/landingActiveSection.tsx
index df71b96..a60b38e 100644
--- a/src/components/landing/landingActiveSection.tsx
+++ b/src/components/landing/landingActiveSection.tsx
@@ -1,4 +1,4 @@
-import CalendarArrowIcon from "@/icons/CalendarArrowIcon";
+import CalendarArrowIcon from "@/icons/calendarArrowIcon";
import { Announcement } from "@/models/announcement";
import { filterActiveAnnouncements, sortAnnouncementsByStartDate } from "@/utils/utils";
import AnnouncementModal from "../announcement/announcementModal";
diff --git a/src/components/landing/landingCreateAnnouncement.tsx b/src/components/landing/landingCreateAnnouncement.tsx
index 751d0bd..f50df36 100644
--- a/src/components/landing/landingCreateAnnouncement.tsx
+++ b/src/components/landing/landingCreateAnnouncement.tsx
@@ -1,5 +1,5 @@
-import SpeakerIcon from "@/icons/SpeakerIcon";
-import ButtonPrimary1 from "../system/ButtonPrimary1";
+import SpeakerIcon from "@/icons/speakerIcon";
+import ButtonPrimary1 from "../system/button/buttonPrimary1";
interface Props {
action: () => void;
diff --git a/src/components/landing/landingPastSection.tsx b/src/components/landing/landingPastSection.tsx
index 80c2558..c30075d 100644
--- a/src/components/landing/landingPastSection.tsx
+++ b/src/components/landing/landingPastSection.tsx
@@ -1,11 +1,12 @@
-import CalendarPlainIcon from "@/icons/CalendarPlainIcon";
+import CalendarPlainIcon from "@/icons/calendarPlainIcon";
import { Announcement } from "@/models/announcement";
import { filterPastAnnouncements, sortAnnouncementsByStartDate } from "@/utils/utils";
import AnnouncementCell from "../announcement/announcementCell";
import AnnouncementModal from "../announcement/announcementModal";
import { useState } from "react";
-import ButtonSecondary1 from "../system/ButtonSecondary1";
+import ButtonSecondary1 from "../system/button/buttonSecondary1";
import { Constants } from "@/utils/constants";
+import { useRouter } from "next/navigation";
interface Props {
announcements?: Announcement[];
@@ -13,6 +14,8 @@ interface Props {
}
export default function LandingPastSection({ announcements, onEditClick }: Props) {
+ const router = useRouter();
+
const pastAnnouncements = sortAnnouncementsByStartDate(filterPastAnnouncements(announcements ?? []));
const [selectedAnnouncement, setSelectedAnnouncement] = useState
(null);
@@ -23,6 +26,10 @@ export default function LandingPastSection({ announcements, onEditClick }: Props
setSelectedAnnouncement(null);
};
+ const viewAllAction = () => {
+ router.push(Constants.pagePath.past);
+ };
+
return (
@@ -41,9 +48,7 @@ export default function LandingPastSection({ announcements, onEditClick }: Props
onClick={() => openModal(pastAnnouncements[0])}
onEditClick={() => onEditClick(pastAnnouncements[0])}
/>
- {pastAnnouncements.length > 1 && (
- console.log("Button clicked")} />
- )}
+ {pastAnnouncements.length > 1 && }
@@ -57,7 +62,7 @@ export default function LandingPastSection({ announcements, onEditClick }: Props
onEditClick={() => onEditClick(announcement)}
/>
))}
-
console.log("Button clicked")} />
+
>
) : (
pastAnnouncements.map((announcement) => (
diff --git a/src/components/landing/landingUpcomingSection.tsx b/src/components/landing/landingUpcomingSection.tsx
index 0ab5fe2..c86dfc0 100644
--- a/src/components/landing/landingUpcomingSection.tsx
+++ b/src/components/landing/landingUpcomingSection.tsx
@@ -1,5 +1,5 @@
import { useState, useEffect, useMemo } from "react";
-import HourglassIcon from "@/icons/HourglassIcon";
+import HourglassIcon from "@/icons/hourglassIcon";
import AnnouncementBanner from "../announcement/announcementBanner";
import { Announcement } from "@/models/announcement";
import { calculateTimeRemaining, filterFutureAnnouncements, getEarliestAnnouncements } from "@/utils/utils";
diff --git a/src/components/past/past.tsx b/src/components/past/past.tsx
new file mode 100644
index 0000000..0a8c98a
--- /dev/null
+++ b/src/components/past/past.tsx
@@ -0,0 +1,204 @@
+"use client";
+
+import { Announcement } from "@/models/announcement";
+import { AppName } from "@/models/enums/appName";
+import { SortType } from "@/models/enums/sortType";
+import { createDummyAnnouncement } from "@/utils/dummy";
+import { ChangeEvent, useEffect, useState } from "react";
+import NavBar from "../common/navBar";
+import PageHeader from "../common/pageHeader";
+import InputSearch from "../system/input/inputSearch";
+import Divider from "../system/divider";
+import PastAnnouncementCell from "./pastAnnouncementCell";
+import Footer from "../common/footer";
+import { InputSelect } from "../system/input/inputSelect";
+import FilterIcon from "@/icons/filterIcon";
+import PastFilter from "./pastFilter";
+import { DateRange } from "react-day-picker";
+import { dateInRange } from "@/utils/utils";
+
+// TODO: Replace with React Query to fetch from API
+const allAnnouncements: Announcement[] = [
+ createDummyAnnouncement(),
+ createDummyAnnouncement(new Date().toDateString(), new Date().toDateString(), [AppName.EATERY]),
+ createDummyAnnouncement(new Date().toDateString(), new Date().toDateString(), [AppName.EATERY, AppName.RESELL]),
+ createDummyAnnouncement(new Date().toDateString(), new Date().toDateString(), [
+ AppName.EATERY,
+ AppName.RESELL,
+ AppName.TRANSIT,
+ ]),
+ createDummyAnnouncement(new Date().toDateString(), new Date().toDateString(), [
+ AppName.EATERY,
+ AppName.RESELL,
+ AppName.TRANSIT,
+ AppName.COURSEGRAB,
+ ]),
+ createDummyAnnouncement(new Date().toDateString(), new Date().toDateString(), [
+ AppName.EATERY,
+ AppName.RESELL,
+ AppName.TRANSIT,
+ AppName.COURSEGRAB,
+ AppName.VOLUME,
+ ]),
+ {
+ id: "uuidv4",
+ apps: [AppName.EATERY, AppName.RESELL, AppName.TRANSIT, AppName.COURSEGRAB],
+ body: "Get a taste of the course content, ask questions, and see if DPD is the right fit for you!",
+ creator: {
+ email: "vdb23@cornell.edu",
+ idToken: "idToken",
+ imageUrl: "https://lh3.googleusercontent.com/a/ACg8ocLSV3bTsn-XINmiSkt4FbdlzRDV0EJBc_LX-hv7gdo3LGp8cAB_=s96-c",
+ isAdmin: true,
+ name: "Vin Bui",
+ },
+ endDate: "2024-10-16T03:00:00.000Z",
+ imageUrl: "https://appdev-upload.nyc3.cdn.digitaloceanspaces.com/announcements/n07chyp8.jpg",
+ link: "https://www.instagram.com/p/C4ExCD1rB6U",
+ startDate: "2024-08-15T03:00:00.000Z",
+ title: "Testing",
+ },
+];
+
+export default function Past() {
+ const [searchText, setSearchText] = useState("");
+ const [selectedSort, setSelectedSort] = useState(SortType.MOST_RECENT);
+ const [listedAnnouncements, setListedAnnouncements] = useState(
+ // Sort by most recent first
+ allAnnouncements.sort((a, b) => new Date(b.startDate).getTime() - new Date(a.startDate).getTime())
+ );
+ const [showFilters, setShowFilters] = useState(false);
+ const [filterDateRange, setFilterDateRange] = useState(undefined);
+ const [filterApps, setFilterApps] = useState([]);
+
+ const handleSearchChange = (event: ChangeEvent) => {
+ setSearchText(event.target.value);
+ };
+
+ useEffect(() => {
+ // Searching
+ const searched = allAnnouncements.filter((announcement) => {
+ const title = announcement.title.toLowerCase().replace(/\s/g, "");
+ const search = searchText.toLowerCase().replace(/\s/g, "");
+ return title.includes(search);
+ });
+
+ // Sorting
+ const sorted = [...searched].sort((a, b) => {
+ switch (selectedSort) {
+ case SortType.MOST_RECENT:
+ return new Date(b.startDate).getTime() - new Date(a.startDate).getTime();
+ case SortType.OLDEST:
+ return new Date(a.startDate).getTime() - new Date(b.startDate).getTime();
+ case SortType.TITLE_A_Z:
+ return a.title.localeCompare(b.title);
+ case SortType.TITLE_Z_A:
+ return b.title.localeCompare(a.title);
+ default:
+ return 0; // No sorting if selectedSort is invalid
+ }
+ });
+
+ // Filtering
+ const hasOverlap = (arr1: AppName[], arr2: AppName[]) => {
+ if (filterApps.length === 0) return true;
+ return arr1.some((item) => arr2.includes(item));
+ };
+ const withinRange = (announcement: Announcement) => {
+ const startDate = filterDateRange?.from;
+ const endDate = filterDateRange?.to;
+ if (!startDate || !endDate) return true;
+
+ // Beginning of start date to end of end date
+ startDate.setHours(0, 0, 0, 0);
+ endDate.setHours(23, 59, 59, 999);
+
+ return (
+ dateInRange(startDate, endDate, new Date(announcement.startDate)) ||
+ dateInRange(startDate, endDate, new Date(announcement.endDate))
+ );
+ };
+ const filtered = sorted.filter(
+ (announcement) => hasOverlap(announcement.apps, filterApps) && withinRange(announcement)
+ );
+ setListedAnnouncements(filtered);
+ setShowFilters(false);
+ }, [searchText, selectedSort, filterDateRange, filterApps]);
+
+ return (
+
+
+
+ {/* Header */}
+
+
+ {/* Filters */}
+
+
+
+
setShowFilters(true)}
+ >
+
+
+ {filterDateRange && filterApps.length !== 0
+ ? "Filter - 2"
+ : filterDateRange || filterApps.length !== 0
+ ? "Filter - 1"
+ : "Filter"}
+
+
+ {showFilters ? (
+
setShowFilters(false)}
+ onApply={(newDateRange, newApps) => {
+ setFilterDateRange(newDateRange);
+ setFilterApps(newApps);
+ }}
+ />
+ ) : null}
+
+
SORT BY
+
setSelectedSort(selected)} />
+
+
+
+
+ {/* Table Header */}
+
{`${listedAnnouncements.length} ${
+ listedAnnouncements.length === 1 ? "announcement" : "announcements"
+ }`}
+
+
+
Image
+ Title
+ Start Time
+ End Time
+ Scheduler
+ Apps
+
+ {listedAnnouncements.map((announcement) => (
+
+ ))}
+
+
+ {/* Table Rows */}
+
+ {listedAnnouncements.map((announcement) => (
+
+ ))}
+
+
+
+ {/* Footer */}
+
+
+
+
+ );
+}
diff --git a/src/components/past/pastAnnouncementCell.tsx b/src/components/past/pastAnnouncementCell.tsx
new file mode 100644
index 0000000..2c82981
--- /dev/null
+++ b/src/components/past/pastAnnouncementCell.tsx
@@ -0,0 +1,84 @@
+import AppIcon from "@/icons/appIcon";
+import { Announcement } from "@/models/announcement";
+import { AppName } from "@/models/enums/appName";
+import { DateFormat } from "@/models/enums/dateFormat";
+import { formatDate, getAppCountString } from "@/utils/utils";
+
+interface Props {
+ announcement: Announcement;
+}
+
+export default function PastAnnouncementCell({ announcement }: Props) {
+ const renderAppIcons = () => {
+ const appLength = announcement.apps.length;
+
+ if (appLength === Object.keys(AppName).length) {
+ return All Apps
;
+ } else if (appLength < 4) {
+ return (
+
+ {announcement.apps.map((app) => (
+
+ ))}
+
+ );
+ } else {
+ return (
+
+ {announcement.apps.slice(0, 3).map((app) => (
+
+ ))}
+
{`and ${appLength - 3} more`}
+
+ );
+ }
+ };
+
+ return (
+ <>
+
+
+
{announcement.title}
+
+ {formatDate(new Date(announcement.startDate), DateFormat.SHORT_YEAR)}
+
+
+ {formatDate(new Date(announcement.endDate), DateFormat.SHORT_YEAR)}
+
+
+
+
{announcement.creator.name}
+
+
{getAppCountString(announcement.apps)}
+
{renderAppIcons()}
+
+
+
+
+
+
{announcement.title}
+
+ {`${formatDate(new Date(announcement.startDate), DateFormat.SHORT)} - ${formatDate(
+ new Date(announcement.endDate),
+ DateFormat.SHORT
+ )}`}
+
+
+
+
+
{`Scheduled by ${announcement.creator.name}`}
+
+
+ {announcement.apps.map((app) => (
+
+ ))}
+
+
+
+ >
+ );
+}
diff --git a/src/components/past/pastFilter.tsx b/src/components/past/pastFilter.tsx
new file mode 100644
index 0000000..f613f7a
--- /dev/null
+++ b/src/components/past/pastFilter.tsx
@@ -0,0 +1,63 @@
+import { AppName } from "@/models/enums/appName";
+import InputDatePicker from "../system/input/inputDatePicker";
+import { DateRange } from "react-day-picker";
+import InputMultiSelect from "../system/input/inputMultiselect";
+import ButtonPrimary2 from "../system/button/buttonPrimary2";
+import ButtonPrimary3 from "../system/button/buttonPrimary3";
+import { useState } from "react";
+
+interface Props {
+ initialDateRange: DateRange | undefined;
+ initialApps: AppName[];
+ onCancel: () => void;
+ onApply: (newDateRange: DateRange | undefined, newApps: AppName[]) => void;
+}
+
+export default function PastFilter({ initialDateRange, initialApps, onCancel, onApply }: Props) {
+ const [dateRange, setDateRange] = useState(initialDateRange);
+ const [apps, setApps] = useState(initialApps);
+ const [filtersReset, setFiltersReset] = useState("");
+
+ // Reset Filters
+ const resetFilters = () => {
+ setDateRange(undefined);
+ setApps([]);
+
+ filtersReset === "" ? setFiltersReset("reset") : setFiltersReset(""); // Force re-render
+ };
+
+ return (
+
+
+
Filters
+
+ {/* Date */}
+
+
Date
+
+
+
+ {/* Apps */}
+
+
Apps
+ setApps(apps.map((str) => AppName[str.toUpperCase() as keyof typeof AppName]))}
+ />
+
+
+ {/* CTAs */}
+
+
+ Reset Filters
+
+
+
+ onApply(dateRange, apps)} className="py-2" textStyle="label" />
+
+
+
+
+ );
+}
diff --git a/src/components/system/ButtonSecondary1.tsx b/src/components/system/ButtonSecondary1.tsx
deleted file mode 100644
index def5d85..0000000
--- a/src/components/system/ButtonSecondary1.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import CaretRightIcon from "@/icons/CaretRightIcon";
-
-interface Props {
- text: string;
- action: () => void;
- disabled?: boolean;
- className?: string;
-}
-
-export default function ButtonPrimary1({ text, action, disabled = false, className }: Props) {
- const handleClick = (event: React.MouseEvent) => {
- event.stopPropagation(); // Prevent event from bubbling up
- action();
- };
-
- return (
-
- );
-}
diff --git a/src/components/system/ButtonPrimary1.tsx b/src/components/system/button/buttonPrimary1.tsx
similarity index 59%
rename from src/components/system/ButtonPrimary1.tsx
rename to src/components/system/button/buttonPrimary1.tsx
index ad3e47b..fe7a6c7 100644
--- a/src/components/system/ButtonPrimary1.tsx
+++ b/src/components/system/button/buttonPrimary1.tsx
@@ -1,13 +1,16 @@
-import CaretRightIcon from "@/icons/CaretRightIcon";
+"use client";
+
+import CaretRightIcon from "@/icons/caretRightIcon";
interface Props {
text: string;
action: () => void;
disabled?: boolean;
className?: string;
+ textStyle?: string;
}
-export default function ButtonPrimary1({ text, action, disabled = false, className }: Props) {
+export default function ButtonPrimary1({ text, action, disabled = false, className, textStyle }: Props) {
const handleClick = (event: React.MouseEvent) => {
event.stopPropagation(); // Prevent event from bubbling up
action();
@@ -15,13 +18,19 @@ export default function ButtonPrimary1({ text, action, disabled = false, classNa
return (
);
diff --git a/src/components/system/ButtonPrimary2.tsx b/src/components/system/button/buttonPrimary2.tsx
similarity index 57%
rename from src/components/system/ButtonPrimary2.tsx
rename to src/components/system/button/buttonPrimary2.tsx
index 6eb8460..0f6bb90 100644
--- a/src/components/system/ButtonPrimary2.tsx
+++ b/src/components/system/button/buttonPrimary2.tsx
@@ -5,21 +5,18 @@ interface Props {
action: () => void;
disabled?: boolean;
className?: string;
+ textStyle?: string;
}
-export default function ButtonPrimary2({ text, action, disabled = false, className }: Props) {
+export default function ButtonPrimary2({ text, action, disabled = false, className, textStyle }: Props) {
const handleClick = (event: React.MouseEvent) => {
event.stopPropagation(); // Prevent event from bubbling up
action();
};
return (
-