-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4098 from CrocSwap/merged-mobile-refactors
Merge all mobile refactors PR
- Loading branch information
Showing
59 changed files
with
3,740 additions
and
1,359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 10 additions & 31 deletions
41
src/components/Global/ContentContainer/ContentContainer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,31 @@ | ||
import { ReactNode } from 'react'; | ||
import { CSSProperties, ReactNode } from 'react'; | ||
import styles from './ContentContainer.module.css'; | ||
|
||
interface ContentContainerPropsIF { | ||
children: ReactNode; | ||
customWidth?: boolean; | ||
customWidthAuto?: boolean; | ||
isOnTradeRoute?: boolean; | ||
noPadding?: boolean; | ||
noStyle?: boolean; | ||
style?: CSSProperties; // Allow custom inline styles | ||
} | ||
|
||
export default function ContentContainer(props: ContentContainerPropsIF) { | ||
const { | ||
children, | ||
isOnTradeRoute, | ||
customWidth, | ||
customWidthAuto, | ||
noPadding, | ||
noStyle, | ||
style | ||
} = props; | ||
|
||
const customWidthStyle = customWidth ? styles.customWidth_container : null; | ||
const tradeRouteStyle = isOnTradeRoute | ||
? styles.no_background | ||
: styles.swap_bg; | ||
const swapRouteStyle = isOnTradeRoute ? null : styles.swap_route; | ||
const customWidthAutoStyle = customWidthAuto | ||
? styles.customWidthAuto | ||
: styles.container; | ||
|
||
if (noStyle) return <>{children}</>; | ||
|
||
|
||
? styles.trade_route | ||
: styles.swap_route | ||
|
||
|
||
return ( | ||
<section | ||
className={`$ ${customWidthStyle} ${customWidthAutoStyle} ${tradeRouteStyle} ${swapRouteStyle}`} | ||
> | ||
<section className={`${styles.window} ${tradeRouteStyle}`}> | ||
<div | ||
className={`${styles.main_content} ${ | ||
!isOnTradeRoute && styles.swap_main_content | ||
}`} | ||
style={{ padding: noPadding ? '' : '8px 16px 16px 16px' }} | ||
> | ||
<section className={tradeRouteStyle} style={style}> | ||
<div className={styles.container} > | ||
<div className={styles.main_content}> | ||
{children} | ||
</div> | ||
</section> | ||
</div> | ||
</section> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.