Skip to content

Commit

Permalink
clean columns in the second row of wall to use "position" from series
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleguido committed Oct 11, 2024
1 parent 80a5c8a commit ce8e0c1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
21 changes: 10 additions & 11 deletions src/components/App.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import Background from '../components/Background';
import { getCollection } from 'astro:content';
import { getRecursivelyEntryData } from '../logic'
import Modals from './Modals';
import type { Collection } from './CollectionCard';
import { SeriesPositionLeadingColumn, SeriesPositionCentralColumn, SeriesPositionTrailingColumn } from '../constants';
const authors = await getCollection('authors')
const numberOfAuthors = authors.length
Expand All @@ -23,6 +26,8 @@ for(const seriesEntry of series){
seriesDataIndex[seriesEntry.slug]['body'] = seriesEntry.body
}
const seriesValues:Collection[] = Object.values(seriesDataIndex)
const associatedPartners = await getCollection('associatedPartners')
const associatedPartnersData = associatedPartners.map((entry) => {
return {
Expand All @@ -31,23 +36,17 @@ const associatedPartnersData = associatedPartners.map((entry) => {
}
})
---
<Header client:only="react" />
<Wall
client:only="react"
enterImpressoPy={seriesDataIndex['enter-impresso']}
enterImpressoModels={seriesDataIndex['enter-impresso-models']}
seriesYourData={[
seriesDataIndex['entities'],
]}
seriesUnexpected={[
seriesDataIndex['graph-network-visualisations'],
seriesDataIndex['drawing-basic-visualisation'],
]}
seriesTutorials={[
seriesDataIndex['impresso-py-in-depth'],
]}

seriesInLeadingColumn={seriesValues.filter((series) => series.position === SeriesPositionLeadingColumn)}
seriesInCentralColumn={seriesValues.filter((series) => series.position === SeriesPositionCentralColumn)}
seriesInTrailingColumn={seriesValues.filter((series) => series.position === SeriesPositionTrailingColumn)}

numberOfNotebooks={numberOfNotebooks}
numberOfSeries={numberOfSeries}
numberOfAuthors={numberOfAuthors}
Expand Down
3 changes: 3 additions & 0 deletions src/components/CollectionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from "react"
import "./CollectionCard.css"
import NotebookCard, { type Notebook } from "./NotebookCard.tsx"
import MarkdownSnippet from "./MarkdownSnippet.tsx"

export interface Collection {
title: string
excerpt: string
Expand All @@ -13,6 +14,8 @@ export interface Collection {
}
| null
| undefined
category?: string[]
position?: string
notebooks: Notebook[]
}

Expand Down
18 changes: 9 additions & 9 deletions src/components/Wall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ const Wall = ({
numberOfNotebooks = 100,
numberOfSeries = 2,
// series = [],
seriesUnexpected = [],
seriesTutorials = [],
seriesYourData = [],
seriesInTrailingColumn = [],
seriesInLeadingColumn = [],
seriesInCentralColumn = [],
enterImpressoPy,
enterImpressoModels,
scrollToTop = false,
}: {
numberOfAuthors?: number
numberOfNotebooks?: number
numberOfSeries?: number
seriesUnexpected?: Collection[]
seriesTutorials?: Collection[]
seriesYourData?: Collection[]
seriesInTrailingColumn?: Collection[]
seriesInLeadingColumn?: Collection[]
seriesInCentralColumn?: Collection[]
enterImpressoPy: Collection
enterImpressoModels: Collection
scrollToTop?: boolean
Expand Down Expand Up @@ -118,7 +118,7 @@ const Wall = ({

<CodeSnippet value={CodeSample} theme={"duotoneDark"} />
</CollectionCard>
{seriesTutorials.map((collection) => (
{seriesInLeadingColumn.map((collection) => (
<CollectionCard
className="mb-3"
key={collection.title}
Expand All @@ -127,7 +127,7 @@ const Wall = ({
))}
</Col>
<Col md={6} xl={4} className="order-md-3 order-xl-2">
{seriesYourData.map((collection) => (
{seriesInCentralColumn.map((collection) => (
<CollectionCard
className="mb-3"
key={collection.title}
Expand All @@ -142,7 +142,7 @@ const Wall = ({
theme={"duotoneDark"}
/>
</CollectionCard>
{seriesUnexpected.map((collection) => (
{seriesInTrailingColumn.map((collection) => (
<CollectionCard
key={collection.title}
collection={collection}
Expand Down

0 comments on commit ce8e0c1

Please sign in to comment.