AlexsLemonade / AlexsLemonade/refinebio-web

Remove BandContext and useBand and display the band at the page level

Open
#459 0 comments 0 reactions 1 assignee Claimed by @nozomione View on GitHub
Post QA
Dominant language
JavaScript
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

### Context

We display the `Band` component (which contains a background image) on the following pages:

- Homepage (blue)
- About (blue)
- Compendia (white/animation)

e.g. ) The blue band image

![Image](https://github.com/user-attachments/assets/5af94d40-7778-4cce-a64f-3d276bd27cc4)

Currently, this is managed within the `Layout` component using the `BandContext` context and its hook, `useBand`.

The visibility of `Band` is controlled based on the selected route via side effect:

```js
const pathWithBand = ['/', '/about', '/compendia/[type]']

useEffect(() => {
setBand(pathWithBand.includes(pathname))
}, [pathname])
```

### Problem or idea

We want to shift the responsibility of managing the band's visibility from `Layout` to individual page components and remove `BandContext` and `useBand`.

### Solution or next step

- Remove `BandContext` and `useBand` and adjust `Layout`
- Render the corresponding `Band` from the following page components:
- `pages/index.js`
- `pages/about.js`
- `pages/compendia/[type].js`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.