Skip to content

Commit

Permalink
feat: added FunFacts section (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
natterstefan committed Apr 21, 2021
1 parent 756fdac commit 36d2764
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 10 deletions.
53 changes: 53 additions & 0 deletions src/components/fun-facts/FunFacts.tsx
@@ -0,0 +1,53 @@
import React from 'react'
import { FaPencilAlt, FaWarehouse } from 'react-icons/fa'
import { FiMonitor } from 'react-icons/fi'
import { HiOutlineSpeakerphone } from 'react-icons/hi'

import { IItem } from '@/types/types'

import { SectionTitle } from '../section-title'

const ITEMS: IItem[] = [
{
icon: FaPencilAlt,
title: 'Happy Clients',
text: '578',
},
{
icon: FaWarehouse,
title: 'Working Hours',
text: '4780',
},
{
icon: FiMonitor,
title: 'Awards Won',
text: '15',
},
{
icon: HiOutlineSpeakerphone,
title: 'Coffee Consumed',
text: '3',
},
]

export const FunFacts = () => {
return (
<div className="px-4 mx-auto space-y-4">
<SectionTitle>
<span>Fun Facts</span>
</SectionTitle>
<div className="grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-4">
{ITEMS.map(item => (
<div
key={item.title}
className="flex flex-col items-center w-full p-6 mt-4 space-y-4 border-2 border-gray-300 rounded-lg transform transition-all delay-200 ease-in-out hover:shadow-xl hover:-translate-y-0.5"
>
<item.icon className="text-lg text-green-500 md:text-3xl" />
<h4 className="text-lg font-bold">{item.title}</h4>
<p className="text-6xl text-gray-300">{item.text}</p>
</div>
))}
</div>
</div>
)
}
1 change: 1 addition & 0 deletions src/components/fun-facts/index.ts
@@ -0,0 +1 @@
export * from './FunFacts'
File renamed without changes.
9 changes: 9 additions & 0 deletions src/components/section-title/SectionTitle.tsx
@@ -0,0 +1,9 @@
import React, { ReactElement } from 'react'

export const SectionTitle = ({ children }: { children: ReactElement }) => {
return (
<h2 className="relative inline-block pb-2 text-2xl font-bold title">
{children}
</h2>
)
}
1 change: 1 addition & 0 deletions src/components/section-title/index.ts
@@ -0,0 +1 @@
export * from './SectionTitle'
16 changes: 7 additions & 9 deletions src/components/what-i-do/whatido.tsx
@@ -1,13 +1,11 @@
import React, { ComponentType } from 'react'
import React from 'react'
import { FaPencilAlt, FaWarehouse } from 'react-icons/fa'
import { FiMonitor } from 'react-icons/fi'
import { HiOutlineSpeakerphone } from 'react-icons/hi'

interface IItem {
icon: ComponentType
title: string
text: string
}
import { IItem } from '@/types/types'

import { SectionTitle } from '../section-title'

const ITEMS: IItem[] = [
{
Expand Down Expand Up @@ -39,9 +37,9 @@ const ITEMS: IItem[] = [
export const WhatIDo = () => {
return (
<div className="px-4 mx-auto space-y-4">
<h2 className="relative inline-block pb-2 text-2xl font-bold title">
What I do
</h2>
<SectionTitle>
<span>What I do</span>
</SectionTitle>
<div className="flex flex-wrap -mx-6">
{ITEMS.map(item => (
<div
Expand Down
2 changes: 2 additions & 0 deletions src/pages/index.tsx
Expand Up @@ -8,6 +8,7 @@ import { AppLayout } from '@/layouts/AppLayout'
import { NextPageType } from '@/types/next'
import { Header } from '@/components/header'
import { WhatIDo } from '@/components/what-i-do'
import { FunFacts } from '@/components/fun-facts/FunFacts'

const IndexPage: NextPageType = () => {
return (
Expand All @@ -20,6 +21,7 @@ const IndexPage: NextPageType = () => {
<div className="space-y-16">
<Header />
<WhatIDo />
<FunFacts />
</div>
</Page.Content>
</Page>
Expand Down
2 changes: 1 addition & 1 deletion src/styles/index.scss
Expand Up @@ -3,4 +3,4 @@
@import 'tailwindcss/utilities';

@import './Scrollbar.scss';
@import '@/components/what-i-do/whatido.scss';
@import '@/components/section-title/SectionTitle.scss';
7 changes: 7 additions & 0 deletions src/types/types.d.ts
@@ -0,0 +1,7 @@
import { IconType } from 'react-icons'

export interface IItem {
icon: IconType
title: string
text: string
}

1 comment on commit 36d2764

@vercel
Copy link

@vercel vercel bot commented on 36d2764 Apr 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.