-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: universal modal content atom export refactor
- Loading branch information
1 parent
2d88ef5
commit e4bb5d9
Showing
10 changed files
with
41 additions
and
20 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
4 changes: 2 additions & 2 deletions
4
packages/universal-modal/src/components/content/Component.mobile.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,12 +1,12 @@ | ||
import React, { FC } from 'react'; | ||
import cn from 'classnames'; | ||
|
||
import { Content, ContentProps } from './Component'; | ||
import { BaseContent, ContentProps } from './base-content'; | ||
|
||
import styles from './mobile.module.css'; | ||
|
||
export type ContentMobileProps = ContentProps; | ||
|
||
export const ContentMobile: FC<ContentMobileProps> = ({ className, ...restProps }) => ( | ||
<Content className={cn(styles.content, styles.withFooter, className)} {...restProps} /> | ||
<BaseContent className={cn(styles.content, styles.withFooter, className)} {...restProps} /> | ||
); |
17 changes: 17 additions & 0 deletions
17
packages/universal-modal/src/components/content/Component.responsive.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React, { FC } from 'react'; | ||
import { useIsDesktop } from '@alfalab/core-components-mq'; | ||
|
||
import type { ContentDesktopProps, ContentMobileProps } from '.'; | ||
import { ContentDesktop, ContentMobile } from '.'; | ||
|
||
export type ContentResponsiveProps = ContentDesktopProps | ContentMobileProps; | ||
|
||
export const ContentResponsive: FC<ContentResponsiveProps> = ({ ...restProps }) => { | ||
const isDesktop = useIsDesktop(); | ||
|
||
if (isDesktop) { | ||
return <ContentDesktop {...restProps} />; | ||
} | ||
|
||
return <ContentMobile {...restProps} />; | ||
}; |
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