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

Suisin/Create connected-app article #6801

Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e5fa694
Create connected-app article
suisin-deriv Oct 21, 2022
298170e
Merge branch 'master' into suisin/79192/to_add_infobox_related_to_API…
suisin-deriv Oct 21, 2022
2f14bc0
Merge branch 'master' of github.com:binary-com/deriv-app into suisin/…
suisin-deriv Oct 21, 2022
78b37e5
Merge branch 'master' of github.com:binary-com/deriv-app into suisin/…
suisin-deriv Oct 28, 2022
e133915
Merge branch 'suisin/79192/to_add_infobox_related_to_API_article_at_c…
suisin-deriv Oct 28, 2022
d729c63
Merge branch 'master' into suisin/79192/to_add_infobox_related_to_API…
suisin-deriv Oct 28, 2022
262fcca
Merge branch 'master' into suisin/79192/to_add_infobox_related_to_API…
suisin-deriv Nov 1, 2022
d127eec
Merge branch 'master' into suisin/79192/to_add_infobox_related_to_API…
suisin-deriv Nov 8, 2022
92ad3ae
Merge branch 'suisin/79192/to_add_infobox_related_to_API_article_at_c…
suisin-deriv Nov 9, 2022
5364716
Merge branch 'master' into suisin/79192/to_add_infobox_related_to_API…
suisin-deriv Nov 9, 2022
4751e48
Merge branch 'master' into suisin/79192/to_add_infobox_related_to_API…
suisin-deriv Nov 9, 2022
3104608
Merge branch 'master' into suisin/79192/to_add_infobox_related_to_API…
suisin-deriv Nov 9, 2022
38502b8
Merge branch 'master' of github.com:binary-com/deriv-app into suisin/…
suisin-deriv Nov 11, 2022
1f02ade
Merge branch 'suisin/79192/to_add_infobox_related_to_API_article_at_c…
suisin-deriv Nov 11, 2022
d590193
update Title
suisin-deriv Nov 11, 2022
81fc260
remove infobox when it is in loading screen
suisin-deriv Nov 14, 2022
8f7ce5d
Merge branch 'master' of github.com:binary-com/deriv-app into suisin/…
suisin-deriv Nov 16, 2022
3b3c692
fix: change title to include ?
suisin-deriv Nov 16, 2022
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
6 changes: 4 additions & 2 deletions packages/account/src/Components/article/article.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { Icon, Text } from '@deriv/components';
import { Localize } from '@deriv/translations';
import './article.scss';
import classNames from 'classnames';

type TDescriptionsItem = {
key: string;
Expand All @@ -12,14 +13,15 @@ export type TArticle = {
title: string;
descriptions: Array<TDescriptionsItem | React.ReactElement>;
onClickLearnMore?: () => void;
className?: string;
};

const Article = ({ title, descriptions, onClickLearnMore }: TArticle) => {
const Article = ({ title, descriptions, onClickLearnMore, className }: TArticle) => {
const has_descriptions: boolean = descriptions?.length > 0;
const has_single_description: boolean = descriptions?.length === 1;

return (
<article className='da-article'>
<article className={classNames('da-article', className)}>
<Text as='h4' color='prominent' line_height='m' size='xs' weight='bold' className='da-article__header'>
{title}
</Text>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react';
import { localize, Localize } from '@deriv/translations';
import AccountArticle from 'Components/article';

suisin-deriv marked this conversation as resolved.
Show resolved Hide resolved
const openAPIManagingWebsite = () => {
window.open(
'https://community.deriv.com/t/api-tokens-managing-access-on-third-party-applications-and-mobile-apps/29159',
'_blank'
);
};

const ConnectedAppsArticle = () => (
<AccountArticle
className='connected-apps__article'
title={localize('Learn more about APIs')}
descriptions={[
<Localize
key={0}
matin-deriv marked this conversation as resolved.
Show resolved Hide resolved
i18n_default_text='Go to our Deriv community and learn about APIs, API tokens, ways to use Deriv APIs, and more.'
/>,
]}
onClickLearnMore={openAPIManagingWebsite}
matin-deriv marked this conversation as resolved.
Show resolved Hide resolved
/>
);

export default ConnectedAppsArticle;
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
Loading,
Text,
} from '@deriv/components';
import ConnectedAppsArticle from './connected-apps-article.jsx';
import { PlatformContext, WS } from '@deriv/shared';
import { localize } from '@deriv/translations';
import ErrorComponent from 'Components/error-component';
Expand Down Expand Up @@ -95,27 +96,36 @@ const ConnectedApps = () => {
{localize('Authorised applications')}
</Text>
{is_error && <ErrorComponent />}
{is_loading ? (
<Loading is_fullscreen={false} />
) : (
<>
<DesktopWrapper>
<DataTable
className='connected-apps'
data_source={connected_apps}
columns={GetConnectedAppsColumnsTemplate(handleToggleModal)}
/>
</DesktopWrapper>
<MobileWrapper>
<DataList
className='connected-apps'
data_source={connected_apps}
row_gap={is_appstore ? 16 : 10}
rowRenderer={mobileRowRenderer}
/>
</MobileWrapper>
</>
)}
<div
className={classNames('connected-apps__container', 'connected-apps__wrapper', {
'connected-apps__wrapper--dashboard': is_appstore,
})}
>
{is_loading ? (
<Loading is_fullscreen={false} />
) : (
<React.Fragment>
<DesktopWrapper>
<DataTable
className='connected-apps'
data_source={connected_apps}
columns={GetConnectedAppsColumnsTemplate(handleToggleModal)}
/>
</DesktopWrapper>
<MobileWrapper>
<DataList
className='connected-apps'
data_source={connected_apps}
row_gap={is_appstore ? 16 : 10}
rowRenderer={mobileRowRenderer}
/>
</MobileWrapper>
</React.Fragment>
)}

{!!connected_apps.length && <ConnectedAppsArticle />}
</div>

<Modal is_open={is_modal_open} className='connected-apps' toggleModal={handleToggleModal}>
<Modal.Body>
<div className='connected-app-modal'>
Expand Down
17 changes: 16 additions & 1 deletion packages/account/src/Styles/account.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1770,7 +1770,6 @@ $MIN_HEIGHT_FLOATING: calc(
}

&__wrapper {
max-width: 682px;
max-height: 560px;
height: 100%;
width: 100%;
Expand All @@ -1792,6 +1791,22 @@ $MIN_HEIGHT_FLOATING: calc(
}
}

&__container {
display: flex;

@include mobile {
flex-direction: column-reverse;
}
}

&__article {
margin-top: -4rem;
suisin-deriv marked this conversation as resolved.
Show resolved Hide resolved

@include mobile {
margin-top: -0.8rem;
matin-deriv marked this conversation as resolved.
Show resolved Hide resolved
}
}

.table__body .table__row {
border-bottom: 1px solid var(--general-section-1);
}
Expand Down