Shares the Instagram block between pages
Moves InstagramGrid out of the homepage sections and gives it its own content module, so the portfolio can show the same block. The homepage renders exactly as before; the tiles keep reusing the intro and review photos, so each photo keeps one description. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+11
-2
@@ -1,11 +1,13 @@
|
||||
import { screen, within } from '@testing-library/react';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import homeContent from '@/content/homeContent';
|
||||
import { introPhotos } from '@/content/homeContent';
|
||||
import instagramContent from '@/content/instagramContent';
|
||||
import testimonials from '@/content/testimonials';
|
||||
import { axeResults } from '@/test/axe';
|
||||
import { renderWithProviders } from '@/test/renderWithProviders';
|
||||
import InstagramGrid from './InstagramGrid';
|
||||
|
||||
const instagram = homeContent.instagram;
|
||||
const instagram = instagramContent;
|
||||
const PROFILE = 'https://www.instagram.com/andreaslopfotografie/';
|
||||
|
||||
function expectExternal(link: HTMLElement) {
|
||||
@@ -50,6 +52,13 @@ describe('InstagramGrid', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('reuses the intro photos and then the review photos, so each photo keeps one description', () => {
|
||||
expect(instagram.photos).toEqual([
|
||||
...introPhotos,
|
||||
...testimonials.map((testimonial) => testimonial.image),
|
||||
]);
|
||||
});
|
||||
|
||||
it('still renders the heading and handle when there are no photos', async () => {
|
||||
await renderWithProviders(
|
||||
<InstagramGrid
|
||||
+3
-2
@@ -3,12 +3,12 @@ import DeferredImage from '@/components/DeferredImage/DeferredImage';
|
||||
import PageSection from '@/components/PageSection/PageSection';
|
||||
import Reveal from '@/components/Reveal/Reveal';
|
||||
import SectionHeading from '@/components/SectionHeading/SectionHeading';
|
||||
import type { HomeContent } from '@/content/types';
|
||||
import type { InstagramContent } from '@/content/types';
|
||||
|
||||
const TITLE_ID = 'instagram-title';
|
||||
|
||||
type InstagramGridProps = {
|
||||
content: HomeContent['instagram'];
|
||||
content: InstagramContent;
|
||||
// A checked https link (visibleSocials); without one the route leaves
|
||||
// the section out
|
||||
profileUrl: string;
|
||||
@@ -17,6 +17,7 @@ type InstagramGridProps = {
|
||||
// "Instagram" (design .instagram): the handle as a link to the profile and
|
||||
// a row of square photos running from edge to edge, each linking to the
|
||||
// profile too. A fixed selection until the API delivers the real feed.
|
||||
// Shared by the homepage and the portfolio.
|
||||
export default function InstagramGrid({
|
||||
content,
|
||||
profileUrl,
|
||||
Reference in New Issue
Block a user