-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add more derived acounts component (#6341)
- Loading branch information
1 parent
e5de8ae
commit 889d19e
Showing
7 changed files
with
91 additions
and
15 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
packages/appstore/src/components/add-derived/add-derived.scss
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,12 @@ | ||
.add-derived { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
align-items: center; | ||
width: 100%; | ||
cursor: pointer; | ||
& > p { | ||
color: $color-black-7; | ||
margin-left: 0.4rem; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/appstore/src/components/add-derived/add-derived.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,23 @@ | ||
import React, { HTMLAttributes } from 'react'; | ||
import { Text } from '@deriv/ui'; | ||
import classNames from 'classnames'; | ||
import { Icon } from '@deriv/components'; | ||
|
||
export interface TAddDerivedProps extends HTMLAttributes<HTMLDivElement> { | ||
onClickHandler: () => void; | ||
class_names?: string; | ||
title: string; | ||
} | ||
|
||
const AddDerived = ({ title, onClickHandler, class_names }: TAddDerivedProps) => { | ||
return ( | ||
<div className={classNames('add-derived', class_names)} onClick={onClickHandler}> | ||
<Icon icon='icAppstoreAddRounded' width='24' height='24' /> | ||
<Text type='paragraph-2' bold> | ||
{title} | ||
</Text> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AddDerived; |
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,4 @@ | ||
import AddDerived from './add-derived'; | ||
import './add-derived.scss'; | ||
|
||
export default AddDerived; |
23 changes: 23 additions & 0 deletions
23
packages/appstore/src/components/add-derived/stories/add-derived.stories.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,23 @@ | ||
import React from 'react'; | ||
import type { Meta, Story } from '@storybook/react'; | ||
import AddDerived from '../index'; | ||
|
||
type AddDerivedProps = Parameters<typeof AddDerived>[0]; | ||
|
||
export default { | ||
title: 'AddDerived', | ||
argTypes: { | ||
title: { | ||
type: 'string', | ||
defaultValue: 'More Derived accounts', | ||
}, | ||
class_names: { | ||
type: 'string', | ||
defaultValue: '', | ||
}, | ||
}, | ||
} as Meta<AddDerivedProps>; | ||
|
||
const Template: Story<AddDerivedProps> = args => <AddDerived {...args} />; | ||
|
||
export const AppLauncherTemplate = Template.bind({}); |
11 changes: 11 additions & 0 deletions
11
packages/components/src/components/icon/appstore/ic-appstore-add-rounded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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