DemocracyLab / DemocracyLab/CivicTechExchange

Volunteer Activity Reporting - Profile Tabs

Open
#1,137 4 comments 0 reactions 0 assignees View on GitHub
Front End
Dominant language
JavaScript
Stars
105
Forks
71
PR merge metrics
No merged PRs in 30d

Description

# Volunteer Activity Reporting Profile Tabs

## Description:

This issue outlines the necessary modifications to the existing AboutUserController to introduce a tabbed navigation interface on the volunteer profile page. Specifically, the _renderAboutMe method within common/components/controllers/AboutUserController.jsx will be refactored to conditionally render either the "About Me" section or the "My Activity" section based on the currently selected tab.

This refactoring is a foundational step for integrating the Volunteer Activity Reporting (VAR) features. The "My Activity" tab will eventually render the common/components/controllers/MyActivity.jsx controller. Please note that the creation of the MyActivity controller itself, along with its associated components (which will reside in components/common/componentsBySection/VolunteerActivityReport), will be handled in a separate GitHub issue. For the scope of this issue, the "My Activity" tab will render a placeholder until the dedicated controller is available.

## Figma:
[VAR Profile Tabs](https://www.figma.com/design/WADcmVjJh5ARVoZ09xlpfdFN/DemocracyLab?node-id=39346-89091&t=C4A5diAd0xC4ACpB-4)

![Image](https://github.com/user-attachments/assets/4141941c-4ad2-4949-95e5-d9ed930cde4c)

## Location:

- Primary Modification: common/components/controllers/AboutUserController.jsx
- New Components Location: components/common/componentsBySection/VolunteerActivityReport/ (This is where components like VARProfileTabs, AboutMeSection, and MyActivitySection will be located.)
- Future Controller (placeholder for now): common/components/controllers/MyActivity.jsx

## Structure:
```
common/components/controllers/
└── AboutUserController.jsx <-- This file will be modified
└── MyActivity.jsx <-- Placeholder for future controller
components/common/componentsBySection/VolunteerActivityReport/
├── VARProfileTabs/
│ ├── VARProfileTabs.jsx
│ ├── VARProfileTabs.module.scss
│ ├── AboutMeSection.jsx
│ └── MyActivitySection.jsx

```

```
// common/components/controllers/AboutUserController.jsx (Illustrative changes)

import React, { useState } from 'react';
// Assuming VARProfileTabs is imported from its new, consolidated location
import VARProfileTabs from '../../componentsBySection/VolunteerActivityReport/VARProfileTabs/VARProfileTabs';
import AboutMeSection from '../../componentsBySection/VolunteerActivityReport/VARProfileTabs/AboutMeSection';
// Import MyActivityController (once created in its own issue)
// import MyActivityController from '../MyActivity'; // This import will be uncommented in a future issue

const AboutUserController = ({ userData, ...props }) => {
const [activeTab, setActiveTab] = useState('about'); // 'about' or 'activity'

// This function will replace or be integrated into the existing _renderAboutMe logic
const renderProfileContent = () => {
if (activeTab === 'about') {
return ;
} else if (activeTab === 'activity') {
// Placeholder for MyActivityController until it's built in a separate issue.
// Once MyActivityController is available, it will be rendered here.
// return ;
return (


My Activity content will be displayed here (via MyActivityController, to be developed in a separate issue).

);
}
return null;
};

return (


{/* The VARProfileTabs component will manage the tab selection UI */}


{renderProfileContent()}

{/* Other existing AboutUserController content can remain around this tabbed section */}

);
};

export default AboutUserController;

```

## Dependencies

- VARProfileTabs (from components/common/componentsBySection/VolunteerActivityReport/VARProfileTabs/VARProfileTabs.jsx)

- AboutMeSection (from components/common/componentsBySection/VolunteerActivityReport/VARProfileTabs/AboutMeSection.jsx)

- Uses EditUserBioModal (Path: componentsBySection/AboutUser/EditUserBioModal.jsx)

## Stories:
- Default state: About Me tab selected
- Tab switch interaction to My Activity
- AboutMeSection includes editable bio via EditUserBioModal
- MyActivitySection includes LogActivityForm and VARLogWeek

# Acceptance Criteria

- The AboutUserController is successfully modified to include VARProfileTabs for tabbed navigation.
- Clicking the "About Me" tab correctly displays the AboutMeSection (including its nested EditUserBioModal functionality).
- Clicking the "My Activity" tab correctly displays a placeholder message/div, indicating where the MyActivityController will eventually render.
- The tab switching interaction is smooth, visually clear, and maintains the correct active state.
- The AboutUserController's layout, including the integrated tabs, remains responsive across various screen sizes.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.