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

Mahdiyeh/ Refactor: Reports monorepo package #5620

Merged
Merged
Show file tree
Hide file tree
Changes from 79 commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
9536d73
add initial config of reports monorepo
mahdiyeh-deriv Mar 17, 2022
f38e031
Merge branch 'master' of github.com:binary-com/deriv-app into reports…
mahdiyeh-deriv Mar 27, 2022
3fc26e0
add config to core
mahdiyeh-deriv Mar 27, 2022
8ba0a55
fix event-source-polyfil version
mahdiyeh-deriv Mar 27, 2022
ff5ffd8
Merge branch 'master' of github.com:binary-com/deriv-app into reports…
mahdiyeh-deriv Apr 5, 2022
da8c6c9
resolve build errors
mahdiyeh-deriv Apr 10, 2022
181850d
Merge branch 'master' of github.com:binary-com/deriv-app into reports…
mahdiyeh-deriv Apr 10, 2022
a25be27
move validator to utils
mahdiyeh-deriv Apr 11, 2022
06895de
fix trader files
mahdiyeh-deriv Apr 11, 2022
e828029
delete reports, change imports
mahdiyeh-deriv Apr 12, 2022
f1d4db7
fix root_store error
mahdiyeh-deriv Apr 12, 2022
af9c182
fix chunkName
mahdiyeh-deriv Apr 13, 2022
fa29824
fix direcory path
mahdiyeh-deriv Apr 13, 2022
2dede3b
fix jest errors
mahdiyeh-deriv Apr 14, 2022
efde5cc
fix directory
mahdiyeh-deriv Apr 14, 2022
e88e988
fix conflicts of master
mahdiyeh-deriv Apr 18, 2022
ca90fbc
Merge branch 'master' of github.com:binary-com/deriv-app into reports…
mahdiyeh-deriv Apr 24, 2022
40fc00b
make separate emptyPrtfolioMessage in trader
mahdiyeh-deriv Apr 24, 2022
83cf144
fix aliases
mahdiyeh-deriv Apr 25, 2022
58528e8
add translation
mahdiyeh-deriv Apr 25, 2022
d77b06d
fix code smell
mahdiyeh-deriv Apr 25, 2022
ccde612
reload tests
mahdiyeh-deriv Apr 25, 2022
e5aa68f
Merge branch 'master' of github.com:binary-com/deriv-app into reports…
mahdiyeh-deriv Apr 25, 2022
9050256
Merge branch 'master' of github.com:binary-com/deriv-app into reports…
mahdiyeh-deriv Apr 26, 2022
d08b84d
Merge branch 'master' of github.com:binary-com/deriv-app into reports…
mahdiyeh-deriv Apr 26, 2022
abc153d
fix empty-portfolio-message conflicts
mahdiyeh-deriv Apr 26, 2022
938fe61
Merge branch 'master' into reports_monorepo_package
mahdiyeh-deriv Apr 26, 2022
dc80617
Merge branch 'master' of github.com:binary-com/deriv-app into reports…
mahdiyeh-deriv Apr 28, 2022
02d50ed
remove unnecessary css files and functions
mahdiyeh-deriv May 5, 2022
2ab5b59
remove deriv-charts package and unnecessary related files
mahdiyeh-deriv May 5, 2022
d2817b5
Merge branch 'master' of github.com:binary-com/deriv-app into reports…
mahdiyeh-deriv May 5, 2022
526baf1
Merge branch 'master' of github.com:binary-com/deriv-app into reports…
mahdiyeh-deriv May 9, 2022
d24e1f8
fix import from trader in reports
mahdiyeh-deriv May 19, 2022
d65b3fc
remove duplicated files
mahdiyeh-deriv May 22, 2022
cbd8cc5
change BinaryLink to NavLink
mahdiyeh-deriv May 22, 2022
c9d1b8b
Merge branch 'master' of github.com:binary-com/deriv-app into reports…
mahdiyeh-deriv May 22, 2022
43ad0c2
rerun tests
mahdiyeh-deriv May 22, 2022
bb145cc
fix circular dependency
mahdiyeh-deriv May 22, 2022
9fe3248
fix EHOIST_PKG_VERSION error
mahdiyeh-deriv May 22, 2022
c0f1726
fix test
mahdiyeh-deriv May 22, 2022
9b23ed6
remove position-drawer-card from trader
mahdiyeh-deriv May 22, 2022
711b64b
remove duplicated scss
mahdiyeh-deriv May 22, 2022
178c564
remove bottom-widget
mahdiyeh-deriv May 22, 2022
8b567a1
fix reports loader
mahdiyeh-deriv May 25, 2022
0ef43ae
Merge branch 'master' of github.com:binary-com/deriv-app into reports…
mahdiyeh-deriv May 25, 2022
66c8432
add contract, portfolio and chartbarrier stores to the core
mahdiyeh-deriv Jun 2, 2022
f4d8274
Merge branch 'master' of github.com:binary-com/deriv-app into reports…
mahdiyeh-deriv Jun 2, 2022
c62bfb4
use core portfolio and contract store in trader and reports
mahdiyeh-deriv Jun 6, 2022
73ff78d
move markers component, helpers and constants to the core
mahdiyeh-deriv Jun 6, 2022
52dfcea
remove all duplicated files from trader and reports
mahdiyeh-deriv Jun 6, 2022
b0141bc
Merge branch 'master' of github.com:binary-com/deriv-app into reports…
mahdiyeh-deriv Jun 6, 2022
916f741
remove contract store from core exports
mahdiyeh-deriv Jun 7, 2022
07f48a5
update reports packages version
mahdiyeh-deriv Jun 7, 2022
54a2d40
remove commented imports
mahdiyeh-deriv Jun 7, 2022
945c82f
add getContactValidationRules to contact core
mahdiyeh-deriv Jun 7, 2022
d4e8c45
move duration test to shared
mahdiyeh-deriv Jun 7, 2022
bc24334
fix active_symbols store
mahdiyeh-deriv Jun 8, 2022
3c589bf
fix moduleLoader in routes.config error
mahdiyeh-deriv Jun 8, 2022
6e9556c
fix stores constructor
mahdiyeh-deriv Jun 14, 2022
6d5cf28
move contract-type file to trader
mahdiyeh-deriv Jun 14, 2022
103549d
move validation-rules to trading
mahdiyeh-deriv Jun 14, 2022
53e0f51
remove serverTime from shared
mahdiyeh-deriv Jun 14, 2022
ddfbeaf
remove .js from imports
mahdiyeh-deriv Jun 14, 2022
4ae49ea
remove all commented lines
mahdiyeh-deriv Jun 14, 2022
8ee17e8
fix error when the trade_store in localStorage in not existd yet
mahdiyeh-deriv Jun 15, 2022
8baec77
clean the code
mahdiyeh-deriv Jun 15, 2022
2e8e335
fix is_multiplier error issue using it from portfolio store
mahdiyeh-deriv Jun 15, 2022
310f3fb
add props type to open-positions and position-drawer
mahdiyeh-deriv Jun 15, 2022
bdb15dc
change portfolio file name
mahdiyeh-deriv Jun 15, 2022
1cce528
add action for updating contract_type observable in portfolio store
mahdiyeh-deriv Jun 16, 2022
b015a93
Merge branch 'master' of github.com:binary-com/deriv-app into reports…
mahdiyeh-deriv Jun 16, 2022
c18ef5d
update with latest master
mahdiyeh-deriv Jun 16, 2022
c10232f
remove comments
mahdiyeh-deriv Jun 16, 2022
2ca9a5c
add shared to translation scripts/add deriv/reports to the build
mahdiyeh-deriv Jun 20, 2022
dee7c92
remove redundant comment in contract-replay.jsx
mahdiyeh-deriv Jun 20, 2022
1c91585
remove connectionWithContractUpdate from reports
mahdiyeh-deriv Jun 28, 2022
69dc5de
Merge branch 'master' of github.com:binary-com/deriv-app into reports…
mahdiyeh-deriv Jun 28, 2022
3fcd64d
fix openPositions default tab issue
mahdiyeh-deriv Jun 28, 2022
c9a2c1d
fix to not remove closed contracts when navigating from reporst to tr…
mahdiyeh-deriv Jun 29, 2022
bdc145e
prevent unmounting the portfolio component when redirecting to report…
mahdiyeh-deriv Jul 5, 2022
6b9c63d
Merge branch 'master' of github.com:binary-com/deriv-app into reports…
mahdiyeh-deriv Jul 5, 2022
cac8faf
fix performance issue on profit_loss input
mahdiyeh-deriv Jul 6, 2022
5fc26f2
fix circular dependancy
mahdiyeh-deriv Jul 6, 2022
8826d95
Merge branch 'master' into reports_monorepo_package2
mahdiyeh-deriv Jul 6, 2022
b0c00dd
Merge branch 'master' into reports_monorepo_package2
carolsachdeva Jul 7, 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
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ commands:
- "packages/cfd/node_modules"
- "packages/indicators/node_modules"
- "packages/p2p/node_modules"
- "packages/reports/node_modules"
- "packages/shared/node_modules"
- "packages/trader/node_modules"
- "packages/translations/node_modules"
Expand Down
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@

/packages/trader/**/* @matin-binary @balakrishna-binary @akmal-binary

# ==============================================================
# deriv-app/reports
# ==============================================================

/packages/reports/**/* @matin-binary @balakrishna-binary

# ==============================================================
# deriv-app/publisher
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
"build": "f () { lerna exec --scope=@deriv/${1:-'*'} -- npm run build $2 ;}; f",
"build:publish": "f () { lerna exec --scope=@deriv/${1:-'*'} -- npm run build:publish $2 ;}; f",
"build:local": "f () { lerna exec --scope @deriv/trader --scope @deriv/bot-web-ui --parallel -- npm run build $1 ;}; f",
"build:travis": "lerna exec --scope @deriv/shared --scope @deriv/components --scope @deriv/translations --scope @deriv/cashier --scope @deriv/account --scope @deriv/p2p --scope @deriv/cfd -- npm run build:travis",
"build:travis": "lerna exec --scope @deriv/shared --scope @deriv/components --scope @deriv/translations --scope @deriv/cashier --scope @deriv/account --scope @deriv/p2p --scope @deriv/cfd --scope @deriv/reports -- npm run build:travis",
"build:prod": "export NODE_ENV=staging && npm run build && export NODE_ENV=",
"build:storybook": "cd packages/components && build-storybook --output-dir .out",
"build:gh-pages": "f () { lerna exec --scope @deriv/components --scope @deriv/p2p -- npm run build && lerna exec --scope @deriv/cashier --scope @deriv/account --scope @deriv/cfd -- npm run build $1 && npm run build:local $1 ;}; f",
"build:gh-pages": "f () { lerna exec --scope @deriv/components --scope @deriv/p2p -- npm run build && lerna exec --scope @deriv/cashier --scope @deriv/account --scope @deriv/cfd --scope @deriv/reports -- npm run build $1 && npm run build:local $1 ;}; f",
"clean": "echo \"Remove $(git rev-parse --show-toplevel)/node_modules\" && lerna clean && rm -rf \"$(git rev-parse --show-toplevel)/node_modules\"",
"deploy": "f () { npm run build:travis && npm run build:local && lerna exec --scope @deriv/core -- npm run deploy $@ ;}; f",
"deploy:clean": "f () { npm run build:travis && npm run build:local && lerna exec --scope @deriv/core -- npm run deploy:clean $@ ;}; f",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const CountdownComponent = ({ count_from = 60, onTimeout }: TCountdownComponent)
}

onTimeout();

// eslint-disable-next-line react-hooks/exhaustive-deps
}, [count]);
return <span className='countdown'>{count}</span>;
Expand Down
3 changes: 1 addition & 2 deletions packages/cfd/src/Containers/cfd-password-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,7 @@ const getCancelButtonLabel = ({

const handlePasswordInputChange = (
e: React.ChangeEvent<HTMLInputElement>,
// eslint-disable-next-line no-shadow
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void,
handleChange: (el: React.ChangeEvent<HTMLInputElement>) => void,
validateForm: (values?: TCFDPasswordFormValues) => Promise<FormikErrors<TCFDPasswordFormValues>>,
setFieldTouched: (field: string, isTouched?: boolean, shouldValidate?: boolean) => void
) => {
Expand Down
8 changes: 8 additions & 0 deletions packages/core/build/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ const copyConfig = base => {
from: path.resolve(__dirname, '../node_modules/@deriv/trader/dist/trader'),
to: 'trader',
},
{
from: path.resolve(__dirname, '../node_modules/@deriv/reports/dist/reports/js/'),
to: 'reports/js',
},
{
from: path.resolve(__dirname, '../node_modules/@deriv/reports/dist/reports/css/'),
to: 'reports/css',
},
{
from: path.resolve(__dirname, '../node_modules/@deriv/cfd/dist/cfd'),
to: 'cfd',
Expand Down
2 changes: 2 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
"@deriv/deriv-api": "^1.0.8",
"@deriv/deriv-charts": "^0.6.0",
"@deriv/p2p": "^0.7.3",
"@deriv/reports": "^1.0.0",
"@deriv/shared": "^1.0.0",
"@deriv/trader": "^3.8.0",
"@deriv/translations": "^1.0.0",
Expand All @@ -116,6 +117,7 @@
"js-cookie": "^2.2.1",
"loadjs": "^4.2.0",
"lodash.debounce": "^4.0.8",
"lodash.throttle": "^4.1.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we need this for portfolio-store.js

"mobx": "^5.15.7",
"mobx-react": "6.3.1",
"mobx-utils": "^5.5.5",
Expand Down
61 changes: 33 additions & 28 deletions packages/core/src/App/Constants/routes-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ const Trader = React.lazy(() =>
})
);

const Reports = React.lazy(() => {
// eslint-disable-next-line import/no-unresolved
return import(/* webpackChunkName: "reports" */ '@deriv/reports');
});

const CFD = React.lazy(() =>
moduleLoader(() => {
// eslint-disable-next-line import/no-unresolved
Expand Down Expand Up @@ -59,6 +64,34 @@ const getModules = ({ is_appstore }, is_social_signup) => {
// Don't use `Localize` component since native html tag like `option` cannot render them
getTitle: () => localize('Bot'),
},
{
path: routes.reports,
component: Reports,
getTitle: () => localize('Reports'),
icon_component: 'IcReports',
is_authenticated: true,
routes: [
{
path: routes.positions,
component: Reports,
getTitle: () => localize('Open positions'),
icon_component: 'IcOpenPositions',
default: true,
},
{
path: routes.profit,
component: Reports,
getTitle: () => localize('Profit table'),
icon_component: 'IcProfitTable',
},
{
path: routes.statement,
component: Reports,
getTitle: () => localize('Statement'),
icon_component: 'IcStatement',
},
],
},
{
path: routes.dxtrade,
component: props => <CFD {...props} platform='dxtrade' />,
Expand Down Expand Up @@ -235,34 +268,6 @@ const getModules = ({ is_appstore }, is_social_signup) => {
component: Trader,
getTitle: () => localize('Trader'),
routes: [
{
path: routes.reports,
component: Trader,
getTitle: () => localize('Reports'),
icon_component: 'IcReports',
is_authenticated: true,
routes: [
{
path: routes.positions,
component: Trader,
getTitle: () => localize('Open positions'),
icon_component: 'IcOpenPositions',
default: true,
},
{
path: routes.profit,
component: Trader,
getTitle: () => localize('Profit table'),
icon_component: 'IcProfitTable',
},
{
path: routes.statement,
component: Trader,
getTitle: () => localize('Statement'),
icon_component: 'IcStatement',
},
],
},
{
path: routes.contract,
component: Trader,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import React from 'react';
import { expect } from 'chai';
import { configure, shallow, mount } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import MarkerSpotLabel from '../marker-spot-label.jsx';

configure({ adapter: new Adapter() });

describe('MarkerSpotLabel', () => {
it('should render one <MarkerSpotLabel /> component', () => {
const wrapper = shallow(<MarkerSpotLabel />);
expect(wrapper).to.have.length(1);
});
it('should have class .chart-spot-label__time-value-container--top if align_label top is passed in props', () => {
const wrapper = shallow(<MarkerSpotLabel align_label={'top'} />);
expect(wrapper.find('.chart-spot-label__time-value-container--top').exists()).to.be.true;
});
it('should have class .chart-spot-label__time-value-container--bottom if align_label bottom is passed in props', () => {
const wrapper = shallow(<MarkerSpotLabel align_label={'bottom'} />);
expect(wrapper.find('.chart-spot-label__time-value-container--bottom').exists()).to.be.true;
});
it('should have class .chart-spot-label__time-value-container--top if no align_label is passed in props', () => {
const wrapper = shallow(<MarkerSpotLabel />);
expect(wrapper.find('.chart-spot-label__time-value-container--top').exists()).to.be.true;
expect(wrapper.find('.chart-spot-label__time-value-container--bottom').exists()).to.be.false;
});
it('should toggle label on hover if has_hover_toggle is passed in props', async () => {
const wrapper = mount(<MarkerSpotLabel has_hover_toggle={true} />);
expect(wrapper.find('.chart-spot-label__info-container').exists()).to.be.false;

wrapper.find('.marker-hover-container').simulate('mouseenter');
wrapper.update();
expect(wrapper.find('.chart-spot-label__info-container').exists()).to.be.true;

wrapper.find('.marker-hover-container').simulate('mouseleave');
wrapper.update();
expect(wrapper.find('.chart-spot-label__info-container').exists()).to.be.false;
});
it('should not toggle label on hover if has_label_toggle is not passed in props', () => {
const wrapper = shallow(<MarkerSpotLabel />);
expect(wrapper.find('.chart-spot-label__info-container').exists()).to.be.true;
expect(wrapper.find('.marker-hover-container').exists()).to.equal(false);
});
it('should have class .chart-spot-label__value-container--won if status won is passed in props', () => {
const wrapper = shallow(<MarkerSpotLabel status={'won'} />);
expect(wrapper.find('.chart-spot-label__value-container--won').exists()).to.be.true;
});
it('should have class .chart-spot-label__value-container--lost if status lost is passed in props', () => {
const wrapper = shallow(<MarkerSpotLabel status={'lost'} />);
expect(wrapper.find('.chart-spot-label__value-container--lost').exists()).to.be.true;
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import { expect } from 'chai';
import { configure, shallow } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import MarkerSpot from '../marker-spot.jsx';

configure({ adapter: new Adapter() });

describe('MarkerSpot', () => {
it('should render one <MarkerSpot /> component', () => {
const wrapper = shallow(<MarkerSpot />);
expect(wrapper).to.have.length(1);
});
it('should not have class .chart-spot__spot--lost or .chart-spot__spot--won if no status is passed in props', () => {
const wrapper = shallow(<MarkerSpot />);
expect(wrapper.find('.chart-spot__spot--lost').exists()).to.be.false;
expect(wrapper.find('.chart-spot__spot--lost').exists()).to.be.false;
expect(wrapper.find('.chart-spot').exists()).to.be.true;
});
});
38 changes: 38 additions & 0 deletions packages/core/src/Components/markers/marker-line.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import classNames from 'classnames';
import { observer } from 'mobx-react';
import PropTypes from 'prop-types';
import React from 'react';
import { Icon } from '@deriv/components';

const MarkerLine = ({ label, line_style, marker_config, status }) => {
// TODO: Find a more elegant solution
if (!marker_config) return <div />;
return (
<div className={classNames('chart-marker-line__wrapper', `chart-marker-line--${line_style}`)}>
{label === marker_config.LINE_END.content_config.label && (
<Icon
icon='IcContractExitTimeCircle'
className='chart-marker-line__icon'
color={status === 'lost' ? 'red' : 'green'}
size={24}
/>
)}
{label === marker_config.LINE_START.content_config.label && (
<Icon
icon='IcContractStartTimeCircle'
className='chart-marker-line__icon chart-marker-line__icon--time'
color='secondary'
size={24}
/>
)}
</div>
);
};

MarkerLine.propTypes = {
label: PropTypes.string,
line_style: PropTypes.string,
marker_config: PropTypes.object,
status: PropTypes.oneOf(['won', 'lost']),
};
export default observer(MarkerLine);
82 changes: 82 additions & 0 deletions packages/core/src/Components/markers/marker-spot-label.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import classNames from 'classnames';
import { observer } from 'mobx-react';
import PropTypes from 'prop-types';
import React from 'react';
import { Icon, Text } from '@deriv/components';
import { addComma, toMoment } from '@deriv/shared';

import MarkerSpot from './marker-spot.jsx';

const MarkerSpotLabel = ({
align_label,
has_hover_toggle,
spot_className,
spot_count,
spot_epoch,
spot_value,
status,
}) => {
const [show_label, setShowLabel] = React.useState(!has_hover_toggle);

const handleHoverToggle = () => {
setShowLabel(!show_label);
};

let marker_spot = <MarkerSpot className={spot_className} spot_count={spot_count} />;

if (has_hover_toggle) {
marker_spot = (
<div className='marker-hover-container' onMouseEnter={handleHoverToggle} onMouseLeave={handleHoverToggle}>
{marker_spot}
</div>
);
}

return (
<div className={'chart-spot-label'}>
{show_label && (
<div className='chart-spot-label__info-container'>
<div
className={`chart-spot-label__time-value-container chart-spot-label__time-value-container--${align_label}`}
>
<div className='chart-spot-label__time-container'>
<Icon
icon='IcClockOutline'
height={10}
width={10}
className='chart-spot-label__time-icon'
/>
<Text as='p' color='prominent' size='xxxs'>
{toMoment(+spot_epoch).format('HH:mm:ss')}
</Text>
</div>
<div
className={classNames('chart-spot-label__value-container', {
'chart-spot-label__value-container--won': status === 'won',
'chart-spot-label__value-container--lost': status === 'lost',
})}
>
<p>{addComma(spot_value)}</p>
</div>
</div>
</div>
)}
{marker_spot}
</div>
);
};

MarkerSpotLabel.defaultProps = {
align_label: 'top',
};

MarkerSpotLabel.propTypes = {
align_label: PropTypes.oneOf(['top', 'bottom']),
has_hover_toggle: PropTypes.bool,
spot_className: PropTypes.string,
spot_count: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
spot_epoch: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
spot_value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
status: PropTypes.oneOf(['won', 'lost']),
};
export default observer(MarkerSpotLabel);
15 changes: 15 additions & 0 deletions packages/core/src/Components/markers/marker-spot.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import classNames from 'classnames';
import { observer } from 'mobx-react';
import PropTypes from 'prop-types';
import React from 'react';

const MarkerSpot = ({ className, spot_count }) => (
<div className={classNames('chart-spot', className)}>{spot_count}</div>
);

MarkerSpot.propTypes = {
className: PropTypes.string,
spot_count: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
};

export default observer(MarkerSpot);
Loading