Sefaria / Sefaria-Project

New Interfaces for Jewish Texts
https://www.sefaria.org
654 stars 268 forks source link

Products Page #1911

Closed saengel closed 2 months ago

saengel commented 4 months ago

Description

Adding a new products page to the super-about page displaying different experiments and products offered by Sefaria, as well an opportunity for users to explore projects 'powered-by-Sefaria'.

Code changes:

  1. In sites/sefaria/urls.py added the products url
  2. In static/css/s2.css all of the CSS needed for the elements on the page, as well as integrations into the SuperAbout page
  3. Importing and exporting the <ProductsPage /> component from static/js/ReaderApp.jsx
  4. In static/js/StaticPages.jsx adding the <ProductsPage /> component, which is comprised of a <Product /> and a <DevBox /> component. This page queries Strapi for the product data using a GraphQL query. If the user is an admin, it queries for draft content as well. This data is then transformed into a more usable structure, and is mapped to the <Product /> components, creating a list. This list is split at position 2, and we render the first portion of the list of <Product /> components, then the <DevBox/> and finally the remaining list of <Product /> components.
    • Each <Product /> is comprised of sub components for each portion of the product, the <ProductTitle />, <ProductCTA />, <ProductDesc />.
  5. In templates/_sidebar.html code was added to integrate the products page into the new sidebar
  6. In templates/static/products.html, we created the template for the products page.

Notes: