Skip to content

Commit

Permalink
Merge pull request mantinedev#13 from widgeter/new-components
Browse files Browse the repository at this point in the history
Improve About us page
  • Loading branch information
widgeter authored Sep 25, 2023
2 parents 41b36a5 + 49f660f commit 73f4af3
Show file tree
Hide file tree
Showing 13 changed files with 630 additions and 109 deletions.
14 changes: 14 additions & 0 deletions app/(pages)/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,26 @@ import type { Metadata } from 'next';
import Contact from '~/components/widgets/Contact';

import FAQs from '~/components/widgets/FAQs';
import Features from '~/components/widgets/Features';
import Features3 from '~/components/widgets/Features3';
import Features4 from '~/components/widgets/Features4';
import Hero2 from '~/components/widgets/Hero2';
import Stats from '~/components/widgets/Stats';
import Steps from '~/components/widgets/Steps';
import Team2 from '~/components/widgets/Team2';
import Testimonials2 from '~/components/widgets/Testimonials2';
import {
contactAbout,
faqsAbout,
featuresFourAbout,
featuresFourAboutTwo,
features3About,
hero2About,
statsAbout,
stepsAbout,
testimonials2About,
featuresAbout,
teamAbout,
} from '~/shared/data/pages/about.data';

export const metadata: Metadata = {
Expand All @@ -24,7 +33,12 @@ const Page = () => {
<>
<Hero2 {...hero2About} />
<Stats {...statsAbout} />
<Features4 {...featuresFourAbout} />
<Features4 {...featuresFourAboutTwo} />
<Steps {...stepsAbout} />
<Features3 {...features3About} />
<Features {...featuresAbout} />
<Team2 {...teamAbout} />
<Testimonials2 {...testimonials2About} />
<FAQs {...faqsAbout} />
<Contact {...contactAbout} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Headline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Headline = ({ header, containerClass, titleClass, subtitleClass }: Headlin
{title && (
<h2
className={twMerge(
`font-heading mb-4 font-bold tracking-tight text-gray-900 dark:text-white`,
`font-heading mb-4 font-bold tracking-tight`,
titleClass,
)}
>
Expand Down
51 changes: 51 additions & 0 deletions src/components/common/ItemTeam.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import Image from 'next/image';
import { twMerge } from 'tailwind-merge';
import { Team } from '~/shared/types';

const ItemTeam = ({
name,
occupation,
image,
items,
containerClass,
imageClass,
panelClass,
nameClass,
occupationClass,
itemsClass,
}: Team) => {
return (
<div className={twMerge('', containerClass)}>
<Image src={image.src} width={240} height={320} alt={image.alt} className={twMerge('', imageClass)} />
<div className={twMerge('', panelClass)}>
<h3 className={twMerge('', nameClass)}>{name}</h3>
<p className={twMerge('', occupationClass)}>{occupation}</p>
<ul className={twMerge('', itemsClass)}>
{items &&
items.map(
({ title, href, icon: Icon }, index2) =>
Icon &&
href && (
<li
key={`team-${index2}`}
className="m-1 flex items-center justify-center rounded text-primary-700 hover:text-gray-500"
>
<a
href={href}
target="_blank"
rel="noopener noreferrer"
aria-label={title as string}
className="flex items-center justify-center rounded-sm bg-transparent p-0.5 text-primary-900 hover:bg-primary-900 hover:text-slate-200 hover:dark:bg-slate-800 hover:dark:text-slate-200"
>
<Icon className="h-6 w-6 p-0.5" />
</a>
</li>
),
)}
</ul>
</div>
</div>
);
};

export default ItemTeam;
53 changes: 53 additions & 0 deletions src/components/common/Timeline.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { twMerge } from 'tailwind-merge';
import { Timeline } from '~/shared/types';

const Timeline = ({
id,
items,
defaultIcon: DefaultIcon,
containerClass,
panelClass,
iconClass,
titleClass,
descriptionClass,
}: Timeline) => {
return (
<>
{items && items.length && (
<div className={twMerge('', containerClass)}>
{items.map(({ title, description, icon: Icon }, index = 0) => (
<div key={id ? `item-${id}-${index}` : `item-grid-${index}`} className={twMerge('flex', panelClass)}>
<div className="flex flex-col items-center mr-4 rtl:mr-0 rtl:ml-4">
<div
className={`flex items-center justify-center ${
index !== items.length - 1 ? '' : 'text-slate-200 rounded-full bg-primary-900'
}`}
>
{Icon ? (
<Icon className={twMerge('w-10 h-10 p-2 rounded-full border-2', iconClass)} />
) : DefaultIcon ? (
<DefaultIcon className={twMerge('w-10 h-10 p-2 rounded-full border-2', iconClass)} />
) : null}
</div>

{index !== items.length - 1 && <div className="w-px h-full bg-black/10 dark:bg-slate-400/50" />}
</div>
<div className={`pt-1 ${index !== items.length - 1 ? 'pb-8' : ''}`}>
{title && (
<h3 className={twMerge('text-xl font-bold text-gray-900 dark:text-slate-300 mb-2', titleClass)}>
{title}
</h3>
)}
{description && (
<p className={twMerge('text-gray-600 dark:text-slate-400', descriptionClass)}>{description}</p>
)}
</div>
</div>
))}
</div>
)}
</>
);
};

export default Timeline;
10 changes: 8 additions & 2 deletions src/components/widgets/Features.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ import Headline from '../common/Headline';
import WidgetWrapper from '../common/WidgetWrapper';
import ItemGrid from '../common/ItemGrid';

const Features = ({ header, items, columns, id, isDark = false }: FeaturesProps) => (
<WidgetWrapper id={id ? id : ''} isDark={isDark} containerClass="scroll-mt-16 max-w-6xl">
const Features = ({ header, items, columns, isBeforeContent, isAfterContent, id, isDark = false }: FeaturesProps) => (
<WidgetWrapper
id={id ? id : ''}
isDark={isDark}
containerClass={`scroll-mt-16 max-w-6xl ${isBeforeContent ? 'md:pb-8 lg:pb-12' : ''} ${
isAfterContent ? 'pt-0 md:pt-0 lg:pt-0' : ''
}`}
>
{header && <Headline header={header} titleClass="text-4xl md:text-5xl" />}
<ItemGrid
id={id}
Expand Down
10 changes: 8 additions & 2 deletions src/components/widgets/Features3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ import Headline from '../common/Headline';
import WidgetWrapper from '../common/WidgetWrapper';
import ItemGrid from '../common/ItemGrid';

const Features3 = ({ header, items, columns, id, isDark = false }: FeaturesProps) => (
<WidgetWrapper id={id ? id : ''} isDark={isDark} containerClass="max-w-6xl">
const Features3 = ({ header, items, columns, isBeforeContent, isAfterContent, id, isDark = false }: FeaturesProps) => (
<WidgetWrapper
id={id ? id : ''}
isDark={isDark}
containerClass={`max-w-6xl ${isBeforeContent ? 'md:pb-8 lg:pb-12' : ''} ${
isAfterContent ? 'pt-0 md:pt-0 lg:pt-0' : ''
}`}
>
{header && <Headline header={header} titleClass="text-4xl md:text-5xl" />}
<ItemGrid
id={id}
Expand Down
7 changes: 6 additions & 1 deletion src/components/widgets/Hero2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ import Image from 'next/image';
import { HeroProps } from '~/shared/types';
import CTA from '../common/CTA';

const Hero2 = ({ title, subtitle, callToAction, callToAction2, image }: HeroProps) => {
const Hero2 = ({ title, subtitle, tagline, callToAction, callToAction2, image }: HeroProps) => {
return (
<section className="mt-[-72px] bg-primary-50 dark:bg-slate-800" id="heroTwo">
<div className="mx-auto max-w-7xl px-4 pt-[72px] sm:px-6 md:flex md:h-screen 2xl:h-auto">
<div className="block py-12 text-center md:flex md:py-12 md:text-left lg:py-16">
<div className="mx-auto flex max-w-5xl basis-[56%] items-center">
<div className="max-w-3xl pb-12 pr-0 md:py-0 md:pr-8 md:pb-0 lg:pr-16">
{tagline && (
<p className="text-base font-semibold uppercase tracking-wide text-primary-600 dark:text-primary-200">
{tagline}
</p>
)}
{title && (
<h1 className="leading-tighter font-heading mb-4 px-4 text-5xl font-bold tracking-tighter md:px-0 md:text-[3.48rem]">
{title}
Expand Down
60 changes: 21 additions & 39 deletions src/components/widgets/Steps.tsx
Original file line number Diff line number Diff line change
@@ -1,55 +1,37 @@
import Image from 'next/image';
import { IconArrowDown, IconCheck } from '@tabler/icons-react';
import { IconCheck } from '@tabler/icons-react';
import { StepsProps } from '~/shared/types';
import WidgetWrapper from '../common/WidgetWrapper';
import Timeline from '../common/Timeline';
import Headline from '../common/Headline';

const Steps = ({ title, items, image, id, isDark = false }: StepsProps) => (
const Steps = ({ header, items, image, id, isReversed, isDark = false }: StepsProps) => (
<WidgetWrapper id={id ? id : ''} isDark={isDark} containerClass="max-w-6xl ">
<div className="row-gap-10 grid gap-6 md:grid-cols-2">
<div className="mb-4 md:mb-0 md:py-4 md:pr-16">
{title && <h2 className="font-heading mb-8 text-3xl font-bold lg:text-4xl">{title}</h2>}
{items &&
items.length &&
items.map(({ title, description, icon: Icon }, index) => (
<div key={`item-steps-${index}`} className="flex">
<div className="mr-4 flex flex-col items-center">
<div>
{index !== items.length - 1 ? (
<div className="flex h-10 w-10 items-center justify-center rounded-full border-2 border-primary-900">
{Icon ? (
<Icon className="h-6 w-6 text-primary-800 dark:text-slate-200" />
) : (
<IconArrowDown className="h-6 w-6 text-primary-800 dark:text-slate-200" />
)}
</div>
) : (
<div className="flex h-10 w-10 items-center justify-center rounded-full border-2 border-primary-900 bg-primary-900">
{Icon ? (
<Icon className="h-6 w-6 text-white dark:text-slate-200" />
) : (
<IconCheck className="h-6 w-6 text-white dark:text-slate-200" />
)}
</div>
)}
</div>
{index !== items.length - 1 && <div className="h-full w-px bg-gray-300 dark:bg-slate-500"></div>}
</div>
<div className={`pt-1 ${index !== items.length - 1 ? 'pb-8' : ''}`}>
{title && <p className="mb-2 text-xl font-bold text-gray-900 dark:text-slate-300">{title}</p>}
{description && <p className="text-gray-600 dark:text-slate-400">{description}</p>}
</div>
</div>
))}
<div
className={`flex flex-col gap-8 md:gap-12 ${isReversed ? 'md:flex-row-reverse' : ''} ${
image ? 'md:flex-row' : ''
}`}
>
<div className={`md:py-4 md:pr-16 ${image ? 'md:basis-1/2' : 'max-w-4xl mx-auto md:self-center'}`}>
{header && (
<Headline
header={header}
containerClass={image ? 'text-left rtl:text-right' : ''}
titleClass="text-3xl sm:text-4xl"
subtitleClass={image ? 'text-left rtl:text-right' : ''}
/>
)}
<Timeline items={items} defaultIcon={IconCheck} iconClass="text-primary border-primary-900" />
</div>
<div className="relative">
<div className="relative md:basis-1/2">
{image && (
<Image
src={image.src}
width={400}
height={768}
alt={image.alt}
placeholder="blur"
className="inset-0 w-full rounded-md object-cover object-top shadow-lg bg-gray-400 dark:bg-slate-700 md:absolute md:h-full"
className="inset-0 object-cover object-top w-full rounded-md shadow-lg md:absolute md:h-full bg-gray-400 dark:bg-slate-700"
quality={50}
/>
)}
Expand Down
46 changes: 12 additions & 34 deletions src/components/widgets/Team.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Image from 'next/image';
import Headline from '../common/Headline';
import { TeamProps } from '~/shared/types';
import WidgetWrapper from '../common/WidgetWrapper';
import ItemTeam from '../common/ItemTeam';

const Team = ({ header, teams, id, isDark = false }: TeamProps) => (
<WidgetWrapper id={id ? id : ''} isDark={isDark} containerClass="">
Expand All @@ -10,40 +10,18 @@ const Team = ({ header, teams, id, isDark = false }: TeamProps) => (
<div className="grid grid-cols-1 gap-4 dark:text-white sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-4">
{teams.map(({ name, occupation, image, items }, index) => (
<div key={`item-team-${index}`} className="p-2">
<Image
src={image.src}
width={240}
height={320}
alt={image.alt}
className="h-72 w-60 rounded-md object-cover shadow-lg bg-gray-500 dark:bg-slate-700"
<ItemTeam
name={name}
occupation={occupation}
image={image}
items={items}
containerClass=""
imageClass="h-72 w-60 rounded-md object-cover shadow-lg bg-gray-500 dark:bg-slate-700"
panelClass="relative mt-3 text-center"
nameClass="mb-1.5 text-xl font-bold"
occupationClass="mb-7 text-base font-medium capitalize text-gray-600 dark:text-slate-400"
itemsClass="absolute right-[-10px] top-[-290px] block list-none rounded-md bg-white/70 shadow-[0_0_8px_rgba(0,0,0,0.2)] backdrop-blur-sm dark:bg-white/40"
/>
<div className="relative mt-3 text-center">
<h3 className="mb-1.5 text-xl font-bold">{name}</h3>
<p className="mb-7 text-base font-medium capitalize text-gray-600 dark:text-slate-400">{occupation}</p>
<ul className="absolute right-[-10px] top-[-290px] block list-none rounded-md bg-white/70 shadow-[0_0_8px_rgba(0,0,0,0.2)] backdrop-blur-sm dark:bg-white/40">
{items &&
items.map(
({ title, href, icon: Icon }, index2) =>
Icon &&
href && (
<li
key={`team-${index2}`}
className="m-1 flex items-center justify-center rounded text-primary-700 hover:text-gray-500"
>
<a
href={href}
target="_blank"
rel="noopener noreferrer"
aria-label={title as string}
className="flex items-center justify-center rounded-sm bg-transparent p-0.5 text-primary-900 hover:bg-primary-900 hover:text-slate-200 hover:dark:bg-slate-800 hover:dark:text-slate-200"
>
<Icon className="h-6 w-6 p-0.5" />
</a>
</li>
),
)}
</ul>
</div>
</div>
))}
</div>
Expand Down
32 changes: 32 additions & 0 deletions src/components/widgets/Team2.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import Headline from '../common/Headline';
import { TeamProps } from '~/shared/types';
import WidgetWrapper from '../common/WidgetWrapper';
import ItemTeam from '../common/ItemTeam';

const Team = ({ header, teams, id, isDark = false }: TeamProps) => (
<WidgetWrapper id={id ? id : ''} isDark={isDark} containerClass="">
{header && <Headline header={header} titleClass="text-2xl sm:text-3xl" />}
<div className="flex items-stretch justify-center">
<div className="grid grid-cols-1 gap-4 dark:text-white sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-4">
{teams.map(({ name, occupation, image, items }, index) => (
<div key={`item-team-two-${index}`} className="p-2">
<ItemTeam
name={name}
occupation={occupation}
image={image}
items={items}
containerClass="card flex flex-col justify-center w-full px-8 my-12 text-center"
imageClass="self-center flex-shrink-0 w-36 h-36 -mt-20 bg-center bg-cover rounded-full dark:bg-gray-500 ring-4 ring-gray-300 object-cover"
panelClass="flex-1 mt-6"
nameClass="text-base font-semibold text-dark"
occupationClass="text-sm text-body-color"
itemsClass="flex justify-center relative px-3 pt-5 mx-5 overflow-hidden"
/>
</div>
))}
</div>
</div>
</WidgetWrapper>
);

export default Team;
Loading

0 comments on commit 73f4af3

Please sign in to comment.