Component boundaries, interfaces, services and dependencies for the shell: footer, back-to-top, skip link, status pages, page intro, shared RouterLink, content folder and navigation module. Includes the answered design questions and the revised site content requirement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
90 lines
4.3 KiB
Markdown
90 lines
4.3 KiB
Markdown
# Component Dependencies — frontend-shell
|
|
|
|
## Dependency Graph
|
|
|
|
```mermaid
|
|
graph TD
|
|
main_tsx["main.tsx"] --> router_cfg["createRouter (scrollRestoration, defaultErrorComponent)"]
|
|
router_cfg --> root_route["routes/__root.tsx"]
|
|
root_route --> AppShell["AppShell"]
|
|
root_route --> NotFound["NotFound"]
|
|
root_route --> ErrorPage["ErrorPage"]
|
|
AppShell --> SkipNav["Chakra SkipNavLink / SkipNavContent"]
|
|
AppShell --> NavigationBar["NavigationBar"]
|
|
AppShell --> Footer["Footer"]
|
|
AppShell --> BackToTop["BackToTop"]
|
|
AppShell --> siteContent["content/siteContent"]
|
|
NavigationBar --> navigation["navigation.ts"]
|
|
Footer --> navigation
|
|
NavigationBar --> RouterLink["RouterLink"]
|
|
Footer --> RouterLink
|
|
Footer --> socialPlatforms["content/socialPlatforms"]
|
|
NotFound --> StatusPage["StatusPage"]
|
|
ErrorPage --> StatusPage
|
|
StatusPage --> LinkButton["LinkButton"]
|
|
LinkButton --> RouterLink
|
|
BackToTop --> useScrolledPast["useScrolledPast"]
|
|
NavigationBar --> useScrolledPast
|
|
pages["routes: portfolio, soorten-fotoshoots, contact, privacyverklaring, over-mij"] --> PageIntro["PageIntro"]
|
|
index_route["routes/index.tsx"] --> Hero["Hero"]
|
|
index_route --> heroContent["content/heroContent"]
|
|
index_route --> siteContent
|
|
Hero --> socialPlatforms
|
|
Hero --> iconControl["recipe iconControl"]
|
|
classDef entry fill:#f6e05e,stroke:#c05621,stroke-width:1px,color:#000;
|
|
classDef comp fill:#63b3ed,stroke:#2b6cb0,stroke-width:1px,color:#000;
|
|
classDef data fill:#9ae6b4,stroke:#2f855a,stroke-width:1px,color:#000;
|
|
classDef shared fill:#e2e8f0,stroke:#4a5568,stroke-width:1px,color:#000;
|
|
class main_tsx,router_cfg,root_route,index_route,pages entry;
|
|
class AppShell,NotFound,ErrorPage,NavigationBar,Footer,BackToTop,StatusPage,PageIntro,Hero comp;
|
|
class siteContent,heroContent,navigation,socialPlatforms data;
|
|
class SkipNav,RouterLink,LinkButton,useScrolledPast,iconControl shared;
|
|
```
|
|
|
|
Text alternative: main.tsx configures the router, which renders the root route (AppShell, NotFound, ErrorPage). AppShell composes the Chakra skip link, NavigationBar, Footer and BackToTop and feeds siteContent to the Footer. Navigation menus come from navigation.ts, links go through RouterLink, the status pages share StatusPage, and content pages share PageIntro. Colours: yellow = entry/routes, blue = components, green = data modules, grey = shared primitives.
|
|
|
|
## Dependency Matrix
|
|
|
|
| Component | Depends on |
|
|
|---|---|
|
|
| AppShell | NavigationBar, Footer, BackToTop, Chakra SkipNav*, siteContent |
|
|
| NavigationBar | navigation (mainNav), RouterLink, NavLink, MobileNav, useScrolledPast, logo assets |
|
|
| Footer | SiteContent type, navigation (footerNav), RouterLink, Chakra Link (`subtle`), socialPlatforms, visibleSocials, copyrightLine, logo-dark.png |
|
|
| BackToTop | useScrolledPast, backToTopThreshold, Iconify `up-outlined` |
|
|
| StatusPage | LinkButton, Container/Heading/Text |
|
|
| NotFound / ErrorPage | StatusPage |
|
|
| PageIntro | Container, Heading, `header` spacing token |
|
|
| Hero | HeroContent, SocialLink, HeroArrows, HeroSocials, LinkButton, useHeroSlider |
|
|
| HeroArrows / HeroSocials | `iconControl` recipe; HeroSocials also socialPlatforms, visibleSocials |
|
|
| LinkButton / NavLink / MobileNav | RouterLink |
|
|
|
|
No circular dependencies. Content modules depend only on types and assets; components never import content (except the two provisioning points: `AppShell` and `routes/index.tsx`).
|
|
|
|
## Data Flow
|
|
|
|
```mermaid
|
|
sequenceDiagram
|
|
box rgba(246,224,94,0.4) Data
|
|
participant C as content modules
|
|
end
|
|
box rgba(99,179,237,0.4) Shell
|
|
participant S as AppShell
|
|
participant F as Footer
|
|
end
|
|
box rgba(154,230,180,0.4) Page
|
|
participant R as Home route
|
|
participant H as Hero
|
|
end
|
|
S->>C: import siteContent
|
|
S->>F: props content
|
|
R->>C: import heroContent and siteContent
|
|
R->>H: props content and socials
|
|
```
|
|
|
|
Text alternative: AppShell reads siteContent and passes it to Footer as props; the home route reads heroContent and siteContent and passes them to Hero as props.
|
|
|
|
## Communication Patterns
|
|
- **Props down only**: no context or global state is added.
|
|
- **Routing state**: via TanStack Router hooks (`useRouterState`) inside `NavigationBar` only (existing).
|
|
- **Scroll state**: a local hook per consumer (`useScrolledPast`), no shared store.
|