Skip to content
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

hamid/76782/ts-components-desktop-wrapper #45

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { ReactNode } from 'react';
import { isDesktop } from '@deriv/shared';

type TDesktopProps = {
children: ReactNode;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better use React.ReactNode since we get no named imports error from webpack when we use named imports from react.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

};

const Desktop = ({ children }: TDesktopProps) => {
if (!isDesktop()) return null;
return children;
};

export default Desktop;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import DesktopWrapper from './desktop-wrapper.jsx';
import DesktopWrapper from './desktop-wrapper';
import './desktop-wrapper.scss';

export default DesktopWrapper;
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import { isMobile } from '@deriv/shared';
import ButtonLink from '../button-link/button-link.jsx';
import DesktopWrapper from '../desktop-wrapper/desktop-wrapper.jsx';
import DesktopWrapper from '../desktop-wrapper';
import MobileWrapper from '../mobile-wrapper/mobile-wrapper.jsx';
import Text from '../text/text.jsx';

Expand Down