Skip to content

Commit

Permalink
move Credit section to layout and trim spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
paulclindo committed Feb 23, 2021
1 parent e1da849 commit 57dcb2b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
23 changes: 23 additions & 0 deletions src/components/layout/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import React from 'react';
import type { Node } from 'react';
import styled from 'styled-components';
import adapoolIcon from '../../assets/adapool-logo-extend.svg';

const Container = styled.div`
max-width: 1200px;
Expand All @@ -17,12 +18,34 @@ const Background = styled.div`
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
`;

const CreditSection = styled.div`
display: flex;
align-items: center;
justify-content: flex-end;
margin: 24px 0 0;
color: #676970;
font-size: 14px;
img {
background: #012b51;
margin-left: 10px;
padding: 2px 6px;
border-radius: 4px;
height: 27px;
}
`;

function Layout({ children }: {| children?: ?Node |}): Node {
return (
<Background>
<Container>
<Wrapper>{children}</Wrapper>
</Container>
<CreditSection>
Powered by
<a href="https://adapools.org/" target="_blank" rel="noopener noreferrer">
<img src={adapoolIcon} alt="adapool-logo" />
</a>
</CreditSection>
</Background>
);
}
Expand Down
34 changes: 6 additions & 28 deletions src/containers/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import type { QueryState } from '../utils/types';

import Modal from '../components/common/Modal';
import SaturatedPoolAlert from '../components/SaturatedPoolAlert';
import adapoolIcon from '../assets/adapool-logo-extend.svg'

// k = 500
const SATURATION_LIMIT = 63600000000000;
Expand Down Expand Up @@ -50,21 +49,6 @@ const Header = styled.div`
// }
// `;

const CreditSection = styled.div`
display: flex;
align-items: center;
justify-content: flex-end;
margin: 24px 0 0;
color: #676970;
font-size: 14px;
img {
background: #012b51;
margin-left: 10px;
padding: 2px 6px;
border-radius: 4px;
height: 27px;
}
`;
export type UrlParams = {|
chromeId: ?string,
mozId: ?string,
Expand Down Expand Up @@ -167,8 +151,7 @@ function Home(props: HomeProps): Node {
setDelegationModalData({ ...delegation, totalAda })
setConfirmDelegationModal(true)
setOpenModal(true)
}
else {
} else {
confirmedDelegateFunction(delegation.id)
}
};
Expand All @@ -194,7 +177,7 @@ function Home(props: HomeProps): Node {
Number(item.total_stake) + lovelaceDelegation < SATURATION_LIMIT
));
}

const { urlParams: { selectedPoolIds, totalAda } } = props
return (
<Layout>
Expand All @@ -207,18 +190,18 @@ function Home(props: HomeProps): Node {
{/* </ColorButton> */}
</Header>
<DesktopOnly>
<DesktopTable
<DesktopTable
status={status}
delegateFunction={delegateFunction}
delegateFunction={delegateFunction}
data={filterPools(rowData, totalAda)}
selectedIdPools={selectedPoolIds}
totalAda={totalAda}
/>
</DesktopOnly>
<MobileOnly>
<MobileTable
<MobileTable
status={status}
delegateFunction={delegateFunction}
delegateFunction={delegateFunction}
data={filterPools(rowData, totalAda)}
selectedIdPools={selectedPoolIds}
totalAda={totalAda}
Expand All @@ -237,11 +220,6 @@ function Home(props: HomeProps): Node {
/>
</Modal>
)}
<CreditSection>Powered by
<a href='https://adapools.org/' target='_blank' rel='noopener noreferrer'>
<img src={adapoolIcon} alt="adapool-logo" />
</a>
</CreditSection>
</Layout>
);
}
Expand Down

0 comments on commit 57dcb2b

Please sign in to comment.