-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature/os 50 fe create pagination category page mob #74
Changes from 7 commits
9d954e6
80a6671
93fcca6
09b66de
52f2334
310bdea
a6d6d8a
cb7f651
6cea079
30386c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
|
||
const ArrowLeft = (): JSX.Element => { | ||
return ( | ||
<svg | ||
width="32" | ||
height="32" | ||
viewBox="0 0 32 32" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M19 22L13 16L19 10" | ||
stroke="#212121" | ||
stroke-width="2" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
/> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default ArrowLeft; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
|
||
const ArrowLeftGrey = (): JSX.Element => { | ||
return ( | ||
<svg | ||
width="32" | ||
height="32" | ||
viewBox="0 0 32 32" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M19 22L13 16L19 10" | ||
stroke="#959595" | ||
stroke-width="2" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
/> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default ArrowLeftGrey; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
|
||
const ArrowRight = () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
return ( | ||
<svg | ||
width="32" | ||
height="32" | ||
viewBox="0 0 32 32" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M13 10L19 16L13 22" | ||
stroke="#212121" | ||
stroke-width="2" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
/> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default ArrowRight; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
|
||
const ArrowRightGrey = () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
return ( | ||
<svg | ||
width="32" | ||
height="32" | ||
viewBox="0 0 32 32" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M13 10L19 16L13 22" | ||
stroke="#959595" | ||
stroke-width="2" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
/> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default ArrowRightGrey; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { PageNumbers } from 'utils/constants'; | ||
|
||
const createPagesList = (pagesAmount: PageNumbers) => { | ||
const pagesArray: number[] = []; | ||
for (let i = 1; i <= Number(pagesAmount); i++) { | ||
pagesArray.push(i); | ||
} | ||
return pagesArray; | ||
}; | ||
|
||
export { createPagesList }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. const numericValues = Object.values(PageNumbers) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,6 @@ const CoreSwiper: FC<CoreSwiperProps> = ({ | |
effect="fade" | ||
fadeEffect={{ crossFade: true }} | ||
rewind | ||
loop | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In case of using "loop" the following error occurs while resizing the window: It is mentioned here: Also it seems the functionality has not been impacted by removing the "loop". |
||
> | ||
{children} | ||
</Swiper> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.ellipsis { | ||
cursor: default; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
import { ELLIPSIS, PageNumbers } from 'utils/constants'; | ||
|
||
import styles from './index.module.scss'; | ||
|
||
const Ellipsis = (): React.JSX.Element => ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
<li key={ELLIPSIS} className={styles.ellipsis}> | ||
{PageNumbers.ELLIPSIS} | ||
</li> | ||
); | ||
|
||
export default Ellipsis; |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -6,12 +6,19 @@ import styles from './index.module.scss'; | |||||||
interface MainLayoutProps { | ||||||||
children: ReactNode; | ||||||||
showFooter?: boolean; | ||||||||
isLoading?: boolean; | ||||||||
} | ||||||||
|
||||||||
const MainLayout: FC<MainLayoutProps> = ({ children, showFooter = true }) => ( | ||||||||
const MainLayout: FC<MainLayoutProps> = ({ | ||||||||
children, | ||||||||
showFooter = true, | ||||||||
isLoading, | ||||||||
}) => ( | ||||||||
<> | ||||||||
<Header /> | ||||||||
<div className={styles.main}>{children}</div> | ||||||||
<div className={`${styles.main} ${isLoading ? styles.mainMaxHeight : ''}`}> | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
{children} | ||||||||
</div> | ||||||||
{showFooter ? <Footer /> : null} | ||||||||
</> | ||||||||
); | ||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@import 'styles/constants'; | ||
|
||
.paginationButton:hover { | ||
cursor: pointer; | ||
} | ||
|
||
.paginationDisabled { | ||
pointer-events: none; | ||
} | ||
|
||
.pagination__icon { | ||
width: 32px; | ||
height: 32px; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React, { FC } from 'react'; | ||
import ArrowLeft from 'assets/svgs/ArrowLeft'; | ||
import ArrowRight from 'assets/svgs/ArrowRight'; | ||
import ArrowLeftGrey from 'assets/svgs/ArrowLeftGrey'; | ||
import ArrowRightGrey from 'assets/svgs/ArrowRightGrey'; | ||
|
||
import styles from './index.module.scss'; | ||
|
||
interface PaginationButtonProps { | ||
isPrevious?: boolean; | ||
isDisabled?: boolean; | ||
handleClick: () => void; | ||
} | ||
|
||
const PaginationButton: FC<PaginationButtonProps> = ({ | ||
isPrevious, | ||
isDisabled, | ||
handleClick, | ||
}) => { | ||
return ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. direct return |
||
<button | ||
className={`${styles.paginationButton} ${ | ||
isDisabled ? styles.paginationDisabled : '' | ||
}`} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consider using getValidClassNames |
||
onClick={handleClick} | ||
> | ||
<div className={styles.pagination__icon}> | ||
{isDisabled ? ( | ||
isPrevious ? ( | ||
<ArrowLeftGrey /> | ||
) : ( | ||
<ArrowRightGrey /> | ||
) | ||
) : isPrevious ? ( | ||
<ArrowLeft /> | ||
) : ( | ||
<ArrowRight /> | ||
)} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consider using a helper for readability There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. at least create a separate constant in this component and don't use nested ternary operator |
||
</div> | ||
</button> | ||
); | ||
}; | ||
|
||
export default PaginationButton; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,5 @@ | |
width: calc((100% - 16px) / 3); | ||
@include media(mobile) { | ||
width: calc((100% - 8px) / 2); | ||
margin-bottom: 8px; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it the same icon as ArrowLeft?
please use ArrowLeft and change color