diff --git a/src/main/java/edu/group5/app/view/Header.java b/src/main/java/edu/group5/app/view/Header.java index 35472e1..6bc6133 100644 --- a/src/main/java/edu/group5/app/view/Header.java +++ b/src/main/java/edu/group5/app/view/Header.java @@ -7,6 +7,14 @@ import javafx.scene.image.ImageView; import javafx.scene.layout.*; +/** + * A main header for the app. + * + *
The header consists of a logo button to homepage, + * a navigation bar with buttons to home page, causes page, + * and about us page. The header also has a profile button + * in the upper right corner.
+ */ public class Header extends BorderPane { private final NavigationController controller; diff --git a/src/main/java/edu/group5/app/view/causespage/CausesPageView.java b/src/main/java/edu/group5/app/view/causespage/CausesPageView.java index 1cd6e83..fbf438a 100644 --- a/src/main/java/edu/group5/app/view/causespage/CausesPageView.java +++ b/src/main/java/edu/group5/app/view/causespage/CausesPageView.java @@ -13,6 +13,23 @@ import java.util.Map; import java.util.stream.Collectors; +/** + * A view for the causes page. + * + *This page allows users to browse and search + * for organizations they may want to donate to. + * Organizations are displayed in a grid layout, + * with four organizations per row. Each organization + * is represented as a clickable card containing its name and logo, + * which navigates to the organization's detail page.
+ * + *The page includes a search field that filters the + * displayed organizations based on user input.
+ * + *Logos are fetched asynchronously, and a loading indicator + * is shown while the data is being retrieved. If a logo cannot be loaded, + * a fallback "no image" is displayed.
+ */ public class CausesPageView extends BorderPane { private final AppState appState; private final NavigationController nav; diff --git a/src/main/java/edu/group5/app/view/causespage/OrganizationCard.java b/src/main/java/edu/group5/app/view/causespage/OrganizationCard.java index 31b25ce..e42ebd5 100644 --- a/src/main/java/edu/group5/app/view/causespage/OrganizationCard.java +++ b/src/main/java/edu/group5/app/view/causespage/OrganizationCard.java @@ -10,6 +10,16 @@ import javafx.scene.layout.VBox; import javafx.scene.text.Text; +/** + * OrganizationCard represent a single organization card + * in the causes page. + * + *The card displays the organization's logo, name, and verification + * checkmark. If no logo is available, a fallback text ("No image") is shown.
+ * + *The card is clickable. When pressed it navigates + * to the organization's detail page.
+ */ public class OrganizationCard extends VBox { private final AppState appState; private final Organization organization; diff --git a/src/main/java/edu/group5/app/view/organizationpage/OrganizationPageView.java b/src/main/java/edu/group5/app/view/organizationpage/OrganizationPageView.java index 684a1a6..77ea7ab 100644 --- a/src/main/java/edu/group5/app/view/organizationpage/OrganizationPageView.java +++ b/src/main/java/edu/group5/app/view/organizationpage/OrganizationPageView.java @@ -19,6 +19,15 @@ import java.util.Objects; +/** + * A view for displaying information about a selected organization. + * + *The page shows the organization's logo, name, and description. + * If no logo is available, a fallback "No image" is displayed.
+ * + *The page also includes a donate button that navigates to the + * donation page, and a back button to return to the causes page.
+ */ public class OrganizationPageView extends BorderPane { private final AppState appState; private final NavigationController nav;