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

Remove button backgroundColor prop #151

Open
wants to merge 1 commit into
base: sandbox
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 12 additions & 6 deletions src/app/components/MainLayout/MainLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import { AncestorBackgroundHackProvider, useTheme } from '@akropolis-web/styles';

import { useApi } from 'services/api';
import { useSubscribable } from 'utils/react';
Expand All @@ -14,6 +15,7 @@ type Props = {

export const MainLayout: React.FC<Props> = props => {
const classes = useStyles();
const theme = useTheme();

const api = useApi();
const [account] = useSubscribable(() => api.web3Manager.account$, [], null);
Expand All @@ -22,12 +24,16 @@ export const MainLayout: React.FC<Props> = props => {
<div className={classes.root}>
{account && <Sidebar />}
<div className={classes.headerAndContent}>
<div className={classes.header}>
<NewHeader />
</div>
<div className={classes.content}>
<props.Content />
</div>
<AncestorBackgroundHackProvider backgroundColor={theme.palette.background.paper}>
<div className={classes.header}>
<NewHeader />
</div>
</AncestorBackgroundHackProvider>
<AncestorBackgroundHackProvider backgroundColor={theme.palette.background.paper}>
<div className={classes.content}>
<props.Content />
</div>
</AncestorBackgroundHackProvider>
<div className={classes.footer}>
<AppFooter />
</div>
Expand Down
14 changes: 3 additions & 11 deletions src/app/pages/Lend/views/LoanProposalsTable/LoanProposalsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
Hint,
Loading,
} from 'components';
import { makeStyles, useTheme } from 'utils/styles';
import { makeStyles } from 'utils/styles';
import { useSubscribable } from 'utils/react';
import { useApi } from 'services/api';
import { LiquidityAmount, PercentAmount } from 'model/entities';
Expand Down Expand Up @@ -52,10 +52,7 @@ function AdditionalInfoContent(props: Pick<LoanProposal, 'descriptionHash'>) {
);
}

const makeColumns = (
isStakingAllowed: boolean,
backgroundColor: string,
): Array<NewTable.models.Column<LoanProposal>> => [
const makeColumns = (isStakingAllowed: boolean): Array<NewTable.models.Column<LoanProposal>> => [
{
renderTitle: () => 'Borrower',
cellContent: {
Expand Down Expand Up @@ -106,7 +103,6 @@ const makeColumns = (
variant="outlined"
color="primary"
size="small"
backgroundColor={backgroundColor}
loanSize={x.loanRequested.toString()}
proposalId={x.proposalId}
borrower={x.borrower}
Expand All @@ -133,12 +129,8 @@ const makeColumns = (
export function LoanProposalsTable(props: Props) {
const { loanProposals, isStakingAllowed } = props;
const classes = useStyles();
const theme = useTheme();

const columns = useMemo(() => makeColumns(isStakingAllowed, theme.palette.background.paper), [
isStakingAllowed,
theme,
]);
const columns = useMemo(() => makeColumns(isStakingAllowed), [isStakingAllowed]);

function renderTableHeader() {
return (
Expand Down
11 changes: 2 additions & 9 deletions src/features/auth/AuthButton/components/ProviderButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useCommunication } from 'utils/react';
import { ButtonBase, Loading, Typography, Box, ShortAddress, Grid, Button } from 'components';
import { WalletType } from 'services/api';
import { tKeys, useTranslate } from 'services/i18n';
import { makeStyles, useTheme, Theme } from 'utils/styles';
import { makeStyles, Theme } from 'utils/styles';
import { zeroAddress } from 'utils/mock';
import { Bitski, Fortmatic, Metamask, Portis, WalletConnect } from 'components/icons/wallets';

Expand Down Expand Up @@ -43,7 +43,6 @@ export function ProviderButton({
fullWidth,
}: ProviderButtonProps) {
const classes = useStyles();
const theme = useTheme();
const connecting = useCommunication(connect, [connect]);
const Icon = iconByWallet[type];

Expand Down Expand Up @@ -80,13 +79,7 @@ export function ProviderButton({
</Grid>
<Box clone alignSelf="stretch">
<Grid item>
<Button
variant="outlined"
color="primary"
size="small"
backgroundColor={theme.palette.background.paper}
fullWidth
>
<Button variant="outlined" color="primary" size="small" fullWidth>
{t(tKeys.features.auth.modalTitle.disconnect.getKey())}
</Button>
</Grid>
Expand Down