Skip to content

Commit

Permalink
fix: removed float and refactored creeateMenuItems
Browse files Browse the repository at this point in the history
  • Loading branch information
rudouglas committed Jun 3, 2021
1 parent 0362474 commit af37d37
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/components/InstallButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,8 @@ import { css } from '@emotion/react';

const sampleItems = new Array(10).fill().map((_, i) => i + 1);

const createMenuItems = (items) => items.map((i) => <Dropdown.MenuItem>{i}</Dropdown.MenuItem>)
const menuItems = [];
for (const item of items) {
menuItems.push(<Dropdown.MenuItem>{item}</Dropdown.MenuItem>);
}
return menuItems;
};
const createMenuItems = (items) =>
items.map((item) => <Dropdown.MenuItem>{item}</Dropdown.MenuItem>);

const createInstallLink = () => {
return `https://one.newrelic.com/launcher/nr1-core.explorer`;
Expand All @@ -23,7 +18,6 @@ const InstallButton = ({ children, title, ...props }) => {
css={css`
display: flex;
flex-direction: row;
float: right;
`}
>
<Button
Expand All @@ -48,7 +42,7 @@ const InstallButton = ({ children, title, ...props }) => {
padding: 5px;
`}
/>
<Dropdown.Menu>{createMenuItems(children, sampleItems)}</Dropdown.Menu>
<Dropdown.Menu>{createMenuItems(sampleItems)}</Dropdown.Menu>
</Dropdown>
</div>
);
Expand Down

0 comments on commit af37d37

Please sign in to comment.