amfoss / amfoss/amFOSS.in

Extract page logic into custom hooks

Offen
#18 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
help wanted
Vorherrschende Sprache
JavaScript
Sterne
2
Forks
14
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Several page level components currently contain complex state management and side effect logic directly within their bodies. This violates the [separation of concerns](https://www.freecodecamp.org/news/separation-of-concerns-react-container-and-presentational-components/) principle, making the components bloated and hard to maintain.

Below is an initial list of refactoring tasks and potential custom hooks

#### Pages to Refactor
- [ ] **Home page:** Extract animation logic and `useRef` hooks.
- [ ] **About page:** Move `useRef` logic to the Hero component or a dedicated hook.
- [ ] **Team page:** Extract animation variants and `useRef` hooks.
- [ ] **Gallery page:** Move `useRef` and `useRouter` logic into a custom hook.
- [ ] **Clublife page:** Extract animation variants into a shared location.

#### Suggested Custom Hooks to Create
- [ ] `useScrollDirection` (for Navbar)
- [ ] `useNavbarColor` (for Navbar)
- [ ] `useOnClickOutside` (for MenuDrawer)
- [ ] `useScrollVisibility` (for ScrollDown)
- [ ] `useResponsiveGrid` (for MembersAndAlumni)

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.