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

feat: Adjust style for PCS #139

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 3 additions & 0 deletions apps/canonical-bridge-ui/core/theme/dark.ts
Original file line number Diff line number Diff line change
@@ -21,6 +21,9 @@ export const dark = {
warning: '#FFEADB',
danger: '#F8545F',
route: { title: '#8C8F9B' },
network: {
title: '#8C8F9B',
},
on: {
color: {
primary: '#181A1E',
3 changes: 3 additions & 0 deletions apps/canonical-bridge-ui/core/theme/light.ts
Original file line number Diff line number Diff line change
@@ -21,6 +21,9 @@ export const light = {
warning: '#BC4E00',
danger: '#EF2A37',
route: { title: '#5C5F6A' },
network: {
title: '#8C8F9B',
},
on: {
color: {
primary: '#FFFFFF',
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@ export function StateModal(props: StateModalProps) {
return (
<Modal isOpen={isOpen} onClose={onClose} isCentered {...restProps}>
<LightMode>
<ModalOverlay />
<ModalOverlay className={`${className}-overlay`} />

<ModalContent className={className} borderRadius={'20px'} maxW={'435px'}>
<ModalCloseButton
Original file line number Diff line number Diff line change
@@ -90,7 +90,10 @@ export function ChooseTokenModal(props: ChooseTokenModalProps) {

return (
<ListItem
className={`bccb-widget-token-list-item` + (isDisabled ? '-disabled' : '')}
className={
`bccb-widget-token-list-item` +
(isActive ? '-active' : isDisabled ? '-disabled' : '')
}
key={item.address}
iconUrl={item.icon}
isActive={isActive}
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@ export function BaseModal(props: BaseModalProps) {
}}
/>
</Flex>
<Flex flexDir="column" p="20px 0px 16px" flex={1}>
<Flex className={`${className}-body`} flexDir="column" p="20px 0px 16px" flex={1}>
<Flex px={'20px'} mb={'20px'}>
<SearchInput
className={`${className}-search`}
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ export const ListItem = React.forwardRef((props: ListItemProps, ref: any) => {
return (
<Box className={`${className}-wrapper`} ref={ref} p="0 20px 4px">
<Flex
className={`${className}` + isDisabled ? '-disabled' : ''}
className={className}
borderRadius={'8px'}
px={'11px'}
py="7px"
Original file line number Diff line number Diff line change
@@ -440,9 +440,27 @@ export function TransferButton({
signTransaction,
]);

const isDisabled =
isLoading ||
isGlobalFeeLoading ||
!sendValue ||
!Number(sendValue) ||
!transferActionInfo ||
!isTransferable ||
(isTronTransfer && (!isToAddressChecked || !toAccount?.address || !isTronAvailableToAccount)) ||
isTronContract === true ||
!!evmBytecode ||
(isSolanaTransfer &&
(!isToAddressChecked || !toAccount.address || !isSolanaAvailableToAccount));

return (
<Flex className="bccb-widget-transfer-button" flexDir="column" w={'100%'}>
<Flex
className={`bccb-widget-transfer-button` + `${isDisabled ? ' disabled' : ''}`}
flexDir="column"
w={'100%'}
>
<Button
className={isDisabled ? 'disabled' : ''}
bg={theme.colors[colorMode].button.brand.default}
size={'lg'}
fontWeight={500}
@@ -453,20 +471,7 @@ export function TransferButton({
_disabled: { bg: theme.colors[colorMode].button.disabled },
}}
onClick={sendTx}
isDisabled={
isLoading ||
isGlobalFeeLoading ||
!sendValue ||
!Number(sendValue) ||
!transferActionInfo ||
!isTransferable ||
(isTronTransfer &&
(!isToAddressChecked || !toAccount?.address || !isTronAvailableToAccount)) ||
isTronContract === true ||
!!evmBytecode ||
(isSolanaTransfer &&
(!isToAddressChecked || !toAccount.address || !isSolanaAvailableToAccount))
}
isDisabled={isDisabled}
>
{isApproveNeeded
? formatMessage({ id: 'transfer.button.approve' })
Original file line number Diff line number Diff line change
@@ -18,7 +18,11 @@ export const NetWorkSection = () => {
justifyContent={'space-between'}
flex={1}
>
<Typography variant="label" size={'md'} color={theme.colors[colorMode].text.placeholder}>
<Typography
variant="label"
size={'md'}
color={theme.colors[colorMode].text.network.title}
>
{formatMessage({ id: 'from.section.title' })}
</Typography>
</Flex>
@@ -30,7 +34,11 @@ export const NetWorkSection = () => {
ml="48px"
display={{ base: 'none', md: 'flex' }}
>
<Typography variant="label" size={'md'} color={theme.colors[colorMode].text.placeholder}>
<Typography
variant="label"
size={'md'}
color={theme.colors[colorMode].text.network.title}
>
{formatMessage({ id: 'to.section.title' })}
</Typography>
</Flex>
Original file line number Diff line number Diff line change
@@ -149,7 +149,12 @@ export const ReceiveInfo = ({ onOpen }: ReceiveInfoProps) => {
<Box className="bccb-widget-received-info-container" mb={isHideSection ? '-24px' : 0}>
<Collapse in={!isHideSection} animateOpacity>
<Flex flexDir={'column'} gap={'8px'}>
<Flex flexDir={'row'} alignItems={'center'} justifyContent={'space-between'}>
<Flex
className="bccb-widget-received-info-title"
flexDir={'row'}
alignItems={'center'}
justifyContent={'space-between'}
>
<Typography
variant={'label'}
size={'md'}
Original file line number Diff line number Diff line change
@@ -101,10 +101,10 @@ export const SendInput: React.FC = () => {

return (
<Flex className="bccb-widget-transfer-input-container" flexDir={'column'} position={'relative'}>
<Flex flexDir={'row'} justifyContent={'space-between'}>
<Flex className="bccb-widget-input-title" flexDir={'row'} justifyContent={'space-between'}>
<Typography
className="input-header-label"
color={theme.colors[colorMode].text.placeholder}
color={theme.colors[colorMode].text.network.title}
variant={'label'}
size={'md'}
>
@@ -113,7 +113,9 @@ export const SendInput: React.FC = () => {
<MaxLink />
</Flex>
<Flex
className="bccb-widget-transfer-input-wrapper"
className={`bccb-widget-transfer-input-wrapper ${
!!error?.text ? 'input-error' : isFocused ? 'input-focused' : ''
}`}
flex={1}
mt={'8px'}
flexDir={'row'}
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@ export function ToAccount(props: FlexProps) {
{formatMessage({ id: 'to.section.account.label' })}
</Box>
<InputGroup
className="bccb-widget-to-account-input"
className={`bccb-widget-to-account-input ${isInvalid ? 'input-error' : ''}`}
alignItems="center"
mt={'12px'}
_hover={{
@@ -130,6 +130,7 @@ export function ToAccount(props: FlexProps) {
}}
>
<Input
className={`${isInvalid ? 'input-error' : ''}`}
isInvalid={isInvalid}
background={theme.colors[colorMode].input.background}
borderColor={theme.colors[colorMode].input.border.default}
Original file line number Diff line number Diff line change
@@ -18,7 +18,9 @@ export const RouteWrapper = ({

return (
<Flex
className="bccb-widget-route-wrapper"
className={`bccb-widget-route-wrapper${isSelected ? '-selected' : ''} ${
isError ? 'route-error' : ''
}`}
flex={1}
flexDir={'column'}
gap={'4px'}
Original file line number Diff line number Diff line change
@@ -138,7 +138,7 @@ export function TransferOverview({ routeContentBottom }: { routeContentBottom?:
>
{formatMessage({ id: 'route.title' })}
{!options.length || isGlobalFeeLoading ? (
<SkeletonCircle w={'32px'} h={'32px'} />
<SkeletonCircle className="skeleton" w={'32px'} h={'32px'} />
) : !isBase ? (
<RefreshingButton />
) : null}