Skip to content

Commit

Permalink
refactor: section higher order component
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbrusegard committed Jan 4, 2025
1 parent a5c6b10 commit 1fb3ca5
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 55 deletions.
4 changes: 2 additions & 2 deletions src/components/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { motion, Variants } from 'motion/react';
import Image from 'next/image';
import { services } from '../constants';
import { fadeIn, textVariant } from '../utils/motion';
import SectionWrapper from '../components/sectionWrapper';
import { SectionHOC } from '@/components/layout/SectionHOC';

const ServiceCard = ({
index,
Expand Down Expand Up @@ -82,4 +82,4 @@ const About = () => {
);
};

export default SectionWrapper(About, 'about');
export default SectionHOC(About, 'about');
4 changes: 2 additions & 2 deletions src/components/contact.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useRef, useEffect } from 'react';
import { Variants, motion } from 'motion/react';
import SectionWrapper from './sectionWrapper';
import { SectionHOC } from '@/components/layout/SectionHOC';
import { slideIn } from '../utils/motion';
import DogCanvas from './dog';

Expand Down Expand Up @@ -149,4 +149,4 @@ const Contact = () => {
);
};

export default SectionWrapper(Contact, 'contact');
export default SectionHOC(Contact, 'contact');
4 changes: 2 additions & 2 deletions src/components/experience.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useState, useEffect } from 'react';
import { Variants, motion } from 'framer-motion';
import 'react-vertical-timeline-component/style.min.css';
import { experiences } from '../constants';
import SectionWrapper from '../components/sectionWrapper';
import { SectionHOC } from '@/components/layout/SectionHOC';
import { textVariant } from '../utils/motion';
import Image from 'next/image';

Expand Down Expand Up @@ -98,4 +98,4 @@ const Experience = () => {
);
};

export default SectionWrapper(Experience, 'work');
export default SectionHOC(Experience, 'work');
4 changes: 2 additions & 2 deletions src/components/feedbacks.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Variants, motion } from 'motion/react';
import SectionWrapper from './sectionWrapper';
import { SectionHOC } from '@/components/layout/SectionHOC';
import { fadeIn, textVariant } from '../utils/motion';
import { testimonials } from '../constants/index';
import Image, { StaticImageData } from 'next/image';
Expand Down Expand Up @@ -121,4 +121,4 @@ const Feedbacks = () => {
);
};

export default SectionWrapper(Feedbacks, '');
export default SectionHOC(Feedbacks, '');
File renamed without changes.
45 changes: 0 additions & 45 deletions src/components/sectionWrapper.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/works.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Tilt from 'react-parallax-tilt';
import { Variants, motion } from 'motion/react';
import SectionWrapper from '../components/sectionWrapper';
import { SectionHOC } from '@/components/layout/SectionHOC';
import { projects } from '../constants/index';
import { fadeIn, textVariant } from '../utils/motion';
import Image, { StaticImageData } from 'next/image';
Expand Down Expand Up @@ -143,4 +143,4 @@ const Works = () => {
);
};

export default SectionWrapper(Works, '');
export default SectionHOC(Works, '');

0 comments on commit 1fb3ca5

Please sign in to comment.