Skip to content

Commit

Permalink
Merge pull request #562 from soroswap/small-fix
Browse files Browse the repository at this point in the history
small fix
  • Loading branch information
esteblock authored Oct 15, 2024
2 parents 9db375d + 5fe4a2c commit 371b35f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/basic-features/typescript for more information.
44 changes: 25 additions & 19 deletions src/components/Settings/ProtocolsSettings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import Row, { RowBetween } from 'components/Row';
import { BodySmall } from 'components/Text';
import { AppContext } from 'contexts';
import { useRouterSDK } from 'functions/generateRoute';
import React, { useContext, useEffect, useState } from 'react'
import React, { useContext, useEffect, useState } from 'react';
import { Box, styled, Switch, SwitchProps, Typography, useTheme } from 'soroswap-ui';
import { useSWRConfig } from 'swr';


export const CustomSwitch = styled((props: SwitchProps) => (
<Switch sx={{ my: 1 }} focusVisibleClassName=".Mui-focusVisible" disableRipple {...props} />
))(({ theme }) => ({
Expand Down Expand Up @@ -56,10 +55,9 @@ export const CustomSwitch = styled((props: SwitchProps) => (
},
}));


const firstLetterUppercase = (string: string) => {
return string.charAt(0).toUpperCase() + string.slice(1);
}
};
const ProtocolsSettings = () => {
const { resetRouterSdkCache } = useRouterSDK();
const theme = useTheme();
Expand Down Expand Up @@ -88,12 +86,10 @@ const ProtocolsSettings = () => {
undefined,
{ revalidate: true },
);
}
else return;
}
} else return;
};

return (

<Expand
testId="protocols-settings"
isOpen={isOpen}
Expand All @@ -104,7 +100,8 @@ const ProtocolsSettings = () => {
<QuestionHelper
text={
<div>
The protocols Soroswap.finance will use to calculate the most efficient path for your transaction.
The protocols Soroswap.finance will use to calculate the most efficient path for
your transaction.
</div>
}
/>
Expand All @@ -113,21 +110,30 @@ const ProtocolsSettings = () => {
button={<></>}
>
<RowBetween gap="md" width={'100%'}>
<Box sx={{ ml: 2 }} width={'100%'} >
<Box sx={{ ml: 2 }} width={'100%'}>
{protocolsStatus.map((option, index) => {
return (
<Row key={index} gap="4px" justify='space-between' align='center'>
<BodySmall fontWeight={100} color={theme.palette.secondary.main} >{firstLetterUppercase(option.key)}</BodySmall>
<CustomSwitch checked={option.value} onClick={() => { switchProtocolValue(option.key) }} color="secondary" />
<Row key={index} gap="4px" justify="space-between" align="center">
<BodySmall fontWeight={100} color={theme.palette.secondary.main}>
{firstLetterUppercase(option.key)}
</BodySmall>
<CustomSwitch
checked={option.value}
onClick={() => {
switchProtocolValue(option.key);
}}
color="secondary"
/>
</Row>
)
);
})}
<BodySmall fontWeight={100} color={theme.palette.secondary.main}>
Use Phoenix at your own risk
</BodySmall>
</Box>
</RowBetween>

</Expand>
);
};

)
}

export default ProtocolsSettings
export default ProtocolsSettings;

0 comments on commit 371b35f

Please sign in to comment.