Skip to content

Commit

Permalink
fix: useMainPageYScroll.ts를 FeatureSection 내부에서 호출하도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Todari committed Oct 23, 2024
1 parent adb844b commit b4360ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions client/src/pages/MainPage/MainPage.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import useAmplitude from '@hooks/useAmplitude';
import useMainPageYScroll from '@hooks/useMainPageYScroll';

import Nav from './Nav/Nav';
import {MainSection} from './Section/MainSection';
import {DescriptionSection} from './Section/DescriptionSection';
import {FeatureSection} from './Section/FeatureSection';
import {mainContainer} from './MainPage.style';
import CreatorSection from './Section/CreatorSection/CreatorSection';

Check failure on line 8 in client/src/pages/MainPage/MainPage.tsx

View workflow job for this annotation

GitHub Actions / test

There should be at least one empty line between import groups
import useMainPageYScroll from '@hooks/useMainPageYScroll';

Check failure on line 9 in client/src/pages/MainPage/MainPage.tsx

View workflow job for this annotation

GitHub Actions / test

`@hooks/useMainPageYScroll` import should occur before import of `./Nav/Nav`

const MainPage = () => {
const {trackStartCreateEvent} = useAmplitude();
const {featureSectionRef} = useMainPageYScroll();

return (
<div css={mainContainer}>
<Nav trackStartCreateEvent={trackStartCreateEvent} />
<MainSection trackStartCreateEvent={trackStartCreateEvent} />
<DescriptionSection />
<FeatureSection ref={featureSectionRef} />
<FeatureSection />
<CreatorSection />
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import {css} from '@emotion/react';
import {forwardRef, ForwardedRef} from 'react';

import {SimpleShare} from './SimpleShare';
import {AutoCalculate} from './AutoCalculate';
import {CheckDeposit} from './CheckDeposit';
import {SimpleTransfer} from './SimpleTransfer';
import {RecordMemoryWithPhoto} from './RecordMemoryWithPhoto';

Check failure on line 7 in client/src/pages/MainPage/Section/FeatureSection/FeatureSection.tsx

View workflow job for this annotation

GitHub Actions / test

There should be at least one empty line between import groups
import useMainPageYScroll from '@hooks/useMainPageYScroll';

Check failure on line 8 in client/src/pages/MainPage/Section/FeatureSection/FeatureSection.tsx

View workflow job for this annotation

GitHub Actions / test

`@hooks/useMainPageYScroll` import should occur before import of `./SimpleShare`

const FeatureSection = () => {
const {featureSectionRef} = useMainPageYScroll();

const FeatureSection = forwardRef<HTMLDivElement>((props, ref: ForwardedRef<HTMLDivElement>) => {
return (
<div
ref={ref}
ref={featureSectionRef}
css={css({
display: 'flex',
transform: 'translateX(200vw)',
Expand All @@ -25,6 +27,6 @@ const FeatureSection = forwardRef<HTMLDivElement>((props, ref: ForwardedRef<HTML
<RecordMemoryWithPhoto />
</div>
);
});
};

export default FeatureSection;

0 comments on commit b4360ae

Please sign in to comment.