Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added FunFacts section #2

Merged
merged 1 commit into from Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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'
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
}