Skip to content

Commit

Permalink
fix: fix dark theme logo
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed May 26, 2022
1 parent 88df9ff commit effa1d4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
13 changes: 1 addition & 12 deletions packages/widget/src/components/LiFiLogo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useTheme } from '@mui/material/styles';
import { CSSProperties } from 'react';
import { ReactComponent as LiFiFullLogo } from '../icons/LiFiFullLogo.svg';
import { ReactComponent as LiFiIconLogo } from '../icons/LiFiLogo.svg';
Expand All @@ -7,16 +6,6 @@ export const LiFiLogo: React.FC<{
variant?: 'icon' | 'full';
style?: CSSProperties;
}> = ({ variant = 'icon', style }) => {
const theme = useTheme();
const Component = variant === 'icon' ? LiFiIconLogo : LiFiFullLogo;
return (
<Component
style={style}
fill={
theme.palette.mode === 'light'
? theme.palette.common.black
: theme.palette.common.white
}
/>
);
return <Component style={style} fill="currentColor" />;
};
1 change: 1 addition & 0 deletions packages/widget/src/components/PoweredBy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const PoweredBy: React.FC = () => {
href="https://li.fi"
target="_blank"
underline="none"
color="text.primary"
>
<Typography color="text.secondary" fontSize={12} px={0.5}>
Powered by
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
Avatar,
StepConnector as MuiStepConnector,
StepContent as MuiStepContent,
StepLabel as MuiStepLabel,
Expand Down Expand Up @@ -52,3 +53,10 @@ export const StepContent = styled(MuiStepContent)(({ theme }) => ({
paddingLeft: theme.spacing(4.1875),
},
}));

export const StepAvatar = styled(Avatar)(({ theme, variant }) => ({
color:
variant === 'square' ? theme.palette.text.primary : theme.palette.grey[900],
backgroundColor:
variant === 'square' ? 'transparent' : theme.palette.background.paper,
}));
6 changes: 3 additions & 3 deletions packages/widget/src/components/StepActions/StepActions.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { LifiStep, Step } from '@lifinance/sdk';
import { ArrowForward as ArrowForwardIcon } from '@mui/icons-material';
import {
Avatar,
Box,
Step as MuiStep,
Stepper,
Expand All @@ -13,6 +12,7 @@ import { useChains } from '../../hooks';
import { formatTokenAmount } from '../../utils/format';
import { LiFiLogo } from '../LiFiLogo';
import {
StepAvatar,
StepConnector,
StepContent,
StepIcon,
Expand All @@ -36,13 +36,13 @@ export const StepActions: React.FC<StepActionsProps> = ({
sx={{ display: 'flex', alignItems: 'center' }}
mb={isFullView ? 1 : 0}
>
<Avatar
<StepAvatar
variant={step.type === 'lifi' ? 'square' : 'circular'}
src={step.type !== 'lifi' ? step.toolDetails.logoURI : undefined}
alt={step.toolDetails.name}
>
{step.type === 'lifi' ? <LiFiLogo /> : step.toolDetails.name[0]}
</Avatar>
</StepAvatar>
<Typography
ml={2}
fontSize={18}
Expand Down

0 comments on commit effa1d4

Please sign in to comment.