Skip to content

Clientside Overview

Imogen Hardy edited this page Dec 14, 2023 · 5 revisions

Contents

Introduction

Each page of the support site is a self-contained React application, and on the checkout pages we also use Redux to handle the internal state of the page. To learn more about our usage of Redux, see our Redux documentation. We also make use use of client-side routing with React Router on the contributions and digital subscriptions checkouts.

The site is written in TypeScript and styled using Emotion with base style tokens and core components originating from the Guardian's design system, Source.

File Structure

Our client-side code sits in assets folder and is organised in the following way:

  • components - shared React components.
  • helpers - shared helper modules.
  • pages - the pages.

Pages

Each page is a folder inside the pages/ directory. These folders are typically structured as seen in the following example for regular contributions:

components/                             πŸ‘ˆ react components specific to this page
helpers/                                πŸ‘ˆ helper modules specific to this page
regularContributions.tsx                πŸ‘ˆ the entry point for the page

The .tsx file is the entry point for the page's JavaScript.

Components

Component folders may contain multiple related components, or a single component. More complex components that need to communicate with the Redux store will be split into a presentational component that handles the UI, and a container that handles store communication and logic- for more about this approach see Presentational and Container Components.

errorSummary.tsx                        πŸ‘ˆ the presentational component
errorSummaryContainer.tsx               πŸ‘ˆ the container component

πŸ™‹β€β™€οΈ General Information

🎨 Client-side 101

βš›οΈ React+Redux

πŸ’° Payment methods

πŸŽ› Deployment & Testing

πŸ“Š AB Testing

🚧 Helper Components

πŸ“š Other Reference

1️⃣ Quickstarts

πŸ›€οΈ Tracking

Clone this wiki locally