Skip to content

Commit

Permalink
Add editable tagline to testimonial component (#1031)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackreimers authored Jul 17, 2023
1 parent f251cfd commit 88142e7
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .tina/__generated__/_graphql.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .tina/__generated__/_schema.json

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions .tina/__generated__/formGroup.module-5FN2Y3T3.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions .tina/__generated__/popup.module-6BC6KIGZ.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .tina/__generated__/training.module-IJDVUL7D.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .tina/collections/consulting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as Schemas from "../../components/blocks";
import { seoSchema } from "../../components/util/seo";

import type { Collection } from "tinacms";
import { testimonialRowSchema } from "../../components/testimonials/TestimonialRow";

export const consultingIndexSchema: Collection = {
label: "Consulting - Index",
Expand Down Expand Up @@ -175,6 +176,8 @@ export const consultingSchema: Collection = {
fields: [
// @ts-ignore
seoSchema,
// @ts-ignore
testimonialRowSchema,
{
type: "object",
label: "Booking",
Expand Down
3 changes: 3 additions & 0 deletions .tina/collections/training.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as Schemas from "../../components/blocks";
import { trainingHeaderSchema } from "../../components/training/trainingHeader";
import { seoSchema } from "../../components/util/seo";
import { videoCardSchema } from "../../components/util/videoCards";
import { testimonialRowSchema } from "../../components/testimonials/TestimonialRow";

export const trainingSchema: Collection = {
label: "Training Pages",
Expand All @@ -19,6 +20,8 @@ export const trainingSchema: Collection = {
seoSchema,
// @ts-ignore
trainingHeaderSchema,
// @ts-ignore
testimonialRowSchema,
{
type: "string",
name: "title",
Expand Down
18 changes: 16 additions & 2 deletions components/testimonials/TestimonialRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import { TinaMarkdown } from "tinacms/dist/rich-text";
import { Rating } from "../util/consulting/rating";
import { Container } from "../util/container";

export const TestimonialRow = ({ testimonialsResult }) => {
export const TestimonialRow = ({ testimonialsResult, tagline }) => {
return (
<Container size="custom">
<h2 className="mb-8 text-center">
<h2 className="mb-2 text-center">
What do people <span className="text-sswRed">say</span>?
</h2>
<p className="mb-8 text-center">{tagline}</p>
<div className="grid gap-6 md:grid-cols-3">
{testimonialsResult?.map((testimonial, i) => (
<TestimonialCard key={i} testimonial={testimonial} />
Expand Down Expand Up @@ -49,3 +50,16 @@ const TestimonialCard = ({ testimonial }) => {
</div>
);
};

export const testimonialRowSchema = {
type: "object",
label: "Testimonials",
name: "testimonials",
fields: [
{
type: "string",
label: "Tagline",
name: "tagline",
},
],
};
3 changes: 2 additions & 1 deletion content/training/internship-fullstack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ footer: >
<SubNewsletterRow headerText="Subscribe to get notified about <span
class='font-bold text-sswRed'>SSW training programs</span>"
subscribeSubTitle="Get the most popular courses from our developers" />
testimonials:
tagline: Hear from some of our past students who are now working in the industry
showTestimonials: true
---

Expand All @@ -201,4 +203,3 @@ showTestimonials: true




5 changes: 4 additions & 1 deletion pages/consulting/[filename].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ export default function ConsultingPage(
) : (
<></>
)}
<TestimonialRow testimonialsResult={props.testimonialsResult} />
<TestimonialRow
testimonialsResult={props.testimonialsResult}
tagline={data.consulting.testimonials?.tagline}
/>
<BookingButton {...bookingButtonProps} containerClass="mt-20" />
</Container>
</Section>
Expand Down
1 change: 1 addition & 0 deletions pages/training/[filename].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default function TrainingPage(
<div className="mx-auto flex max-w-9xl flex-col items-center">
<TestimonialRow
testimonialsResult={props.testimonialResult}
tagline={data.training.testimonials?.tagline}
/>
</div>
</Container>
Expand Down

0 comments on commit 88142e7

Please sign in to comment.