Skip to content

Commit

Permalink
Rename InfoBox type
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyEJohnson committed Oct 28, 2024
1 parent 32be904 commit 8371984
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/app/pages/subjects/new/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import buildContext from '~/components/jsx-helpers/build-context';
import usePageData from '~/helpers/use-page-data';
import useLanguageContext from '~/contexts/language';
import type {LocaleEntry} from '~/components/language-selector/language-selector';
import type {InfoBox} from './info-boxes';
import type {InfoBoxValues} from './info-boxes';
import type {TutorValue} from './tutor-ad';
import {toNumber} from 'lodash';

Expand Down Expand Up @@ -34,7 +34,7 @@ type SubjectsPageData = {
downloadUrl: string;
};
};
infoBoxes: InfoBox[];
infoBoxes: [InfoBoxValues]
tutorAd: [
{
value: TutorValue;
Expand Down
6 changes: 3 additions & 3 deletions src/app/pages/subjects/new/info-boxes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import useSubjectsContext, {ImageData} from './context';
import RawHTML from '~/components/jsx-helpers/raw-html';
import './info-boxes.scss';

export type InfoBox = {
export type InfoBoxValues = {
value: {
heading: string;
text: string;
image: ImageData;
}[];
};

function AboutBlurb({image, heading, text: description}: InfoBox['value'][0]) {
function AboutBlurb({image, heading, text: description}: InfoBoxValues['value'][0]) {
return (
<div className="container">
<div className="blurb">
Expand All @@ -25,7 +25,7 @@ function AboutBlurb({image, heading, text: description}: InfoBox['value'][0]) {
);
}

export function InfoBoxes({infoBoxes}: {infoBoxes: InfoBox['value']}) {
export function InfoBoxes({infoBoxes}: {infoBoxes: InfoBoxValues['value']}) {
return (
<section className="info-boxes">
<div className="content">
Expand Down
4 changes: 2 additions & 2 deletions src/app/pages/subjects/new/specific/context.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { LocaleEntry } from '~/components/language-selector/language-selector';
import { ImageData } from '../context';
import type { InfoBox } from '../info-boxes';
import type { InfoBoxValues } from '../info-boxes';

// There will be more, but this is what I need for now
export type Book = {
Expand Down Expand Up @@ -55,7 +55,7 @@ type SpecificSubjectPageData = {
tutorAd: SectionInfo;
aboutOs: SectionInfo;
webinarHeader: WebinarSectionInfo;
infoBoxes: InfoBox;
infoBoxes: InfoBoxValues;
};

export default function (): SpecificSubjectPageData;
Expand Down

0 comments on commit 8371984

Please sign in to comment.