Skip to content

Commit

Permalink
fix: swiper pagination 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-yn committed Mar 17, 2024
1 parent 7349403 commit a3b8bb7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'swiper/css';
import 'swiper/css/pagination';
import '@/styles/global.css';
import '@/styles/theme/grayScale.css';
import '@/styles/theme/colorPalette.css';
Expand Down
4 changes: 2 additions & 2 deletions src/components/History/History.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { commonColorThemeVars } from '@/styles/theme/index.css';
export const wrapStyle = style({
display: 'grid',
gridAutoRows: 'auto',
gap: '1rem',
columnGap: '1rem',
width: '100%',

'@media': {
[ODSBreakpointTokenVariables['breakpoint-xxl']]: {
gap: '2.5rem',
columnGap: '2.5rem',
},
[ODSBreakpointTokenVariables['breakpoint-s']]: {
display: 'flex',
Expand Down
2 changes: 1 addition & 1 deletion src/components/History/History.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ const Menu = () => {
handleClick(index);
}}
>
{historySummary.name}
{historySummary.name.toUpperCase()}
</Button>
);
})}
Expand Down
5 changes: 4 additions & 1 deletion src/components/History/Summary/HistorySummary.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client';

import 'swiper/css';
import 'swiper/css/pagination';

import classNames from 'classnames';
import React, { PropsWithChildren, useState } from 'react';
Expand Down Expand Up @@ -162,7 +163,9 @@ const Swipe = () => {
);
})}
</OceanSwiper.Main>
{breakpointXXL && <Spacer direction="horizontal" spacing="spacer-20" />}
{!isDetailView && breakpointXXL && (
<Spacer direction="horizontal" spacing="spacer-20" />
)}
</OceanSwiper>
);
};
Expand Down
5 changes: 3 additions & 2 deletions src/components/OceanSwiper/OceanSwiper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import classNames from 'classnames';
import React, { PropsWithChildren, useEffect, useRef } from 'react';
import { A11y } from 'swiper/modules';
import { A11y, Pagination, Navigation } from 'swiper/modules';
import { Swiper, SwiperRef, SwiperSlide, useSwiper } from 'swiper/react';
import { SwiperOptions } from 'swiper/types';
import Tag from '@/composable/Tag/Tag';
Expand Down Expand Up @@ -111,9 +111,10 @@ const Main = ({
<Swiper
{...rest}
ref={swiperRef}
modules={[A11y]}
modules={[A11y, Pagination]}
slidesPerView={perView || 'auto'}
spaceBetween={gap}
pagination={{ clickable: true }}
allowSlideNext={isSwipeAble}
allowSlidePrev={isSwipeAble}
onRealIndexChange={(e) => {
Expand Down

0 comments on commit a3b8bb7

Please sign in to comment.