Skip to content

Commit

Permalink
Fixed create channel ui , fixed message for unlock profile, removed g…
Browse files Browse the repository at this point in the history
…overnance from sidebar (#1817)

* fixed minor ui issues

* fixed minor ui issues

* fixed minor ui issues

* fixed select text color

* fixed select text color

* fixed select text color

* fixed chain issue
  • Loading branch information
mishramonalisha76 authored Aug 21, 2024
1 parent 5add89b commit 51e30be
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 60 deletions.
2 changes: 1 addition & 1 deletion src/blocks/select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ const StyledOption = styled(ComboboxOption)`
align-items: center;
padding: var(--spacing-xxxs, 4px);
gap: var(--spacing-xxs, 8px);
color: var(--components-dropdown-text-default, #17181b);
color: var(--components-list-item-text-default);
font-family: var(--font-family);
font-size: ${textVariants['bs-regular'].fontSize};
font-style: ${textVariants['bs-regular'].fontStyle};
Expand Down
7 changes: 6 additions & 1 deletion src/common/components/Stepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { FC } from 'react';

// Components
import { Box, Text } from 'blocks';
import { css } from 'styled-components';

type StepperProps = {
steps: Array<{ label: string; value: string }>;
Expand All @@ -20,14 +21,18 @@ const Stepper: FC<StepperProps> = ({ steps, setActiveStepKey, completedSteps })
<Box
display="flex"
gap="spacing-lg"
width="inherit"
justifyContent="space-between"
>
{steps.map((step, index) => (
<Box
key={index}
display="flex"
flexDirection="column"
gap="spacing-xs"
width="180px"
css={css`
flex: 1;
`}
cursor="pointer"
onClick={() => handleChangeActiveStep(step.value)}
>
Expand Down
67 changes: 28 additions & 39 deletions src/config/NavigationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,8 @@ const NavigationList = {
},
},
},


},
Messsaging: {

chat: {
src: 'chatOffIcon',
activeSrc: 'chatOnIcon',
Expand All @@ -118,12 +115,8 @@ const NavigationList = {
},
},
},



},
Developers: {

createChannel: {
uid: GLOBALS.CONSTANTS.NAVBAR_IDENTIFIERS.CREATE_CHANNEL,
src: 'createChannelIcon',
Expand Down Expand Up @@ -176,11 +169,7 @@ const NavigationList = {
},
},
},




}
},
},
third: {
yieldv2: {
Expand Down Expand Up @@ -257,31 +246,31 @@ const NavigationList = {
// }
// }
// },
governance: {
uid: GLOBALS.CONSTANTS.NAVBAR_IDENTIFIERS.GOVERNANCE,
src: 'govOffIcon',
activeSrc: 'govOnIcon',
iconFactory: null,
name: 'Governance',
title: 'Governance',
alt: 'Governance',
href: APP_PATHS.Govern,
newTab: false,
isRoute: true,
hasMenuLogic: true,
hidden: false,
headerTag: {
title: 'Governance',
light: {
bg: GLOBALS.COLORS.GRADIENT_SECONDARY,
fg: themeLight.headerTagFg,
},
dark: {
bg: themeDark.headerTagBg,
fg: themeDark.headerTagFg,
},
},
},
// governance: {
// uid: GLOBALS.CONSTANTS.NAVBAR_IDENTIFIERS.GOVERNANCE,
// src: 'govOffIcon',
// activeSrc: 'govOnIcon',
// iconFactory: null,
// name: 'Governance',
// title: 'Governance',
// alt: 'Governance',
// href: APP_PATHS.Govern,
// newTab: false,
// isRoute: true,
// hasMenuLogic: true,
// hidden: false,
// headerTag: {
// title: 'Governance',
// light: {
// bg: GLOBALS.COLORS.GRADIENT_SECONDARY,
// fg: themeLight.headerTagFg,
// },
// dark: {
// bg: themeDark.headerTagBg,
// fg: themeDark.headerTagFg,
// },
// },
// },

// incentives: {
// src: 'incentivesOffIcon',
Expand Down Expand Up @@ -471,8 +460,8 @@ const NavigationList = {
},
},
},
}
}
},
};

// // remove secret feature
// if (
Expand Down
13 changes: 8 additions & 5 deletions src/modules/addNewChain/AddNewChain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,13 @@ const AddNewChain: FC = () => {
</>
) : channelDetails || alaisDetails ? (
<>
<Stepper
steps={addNewChainSteps}
completedSteps={completedSteps}
setActiveStepKey={(key) => setActiveStepKey(key as ActiveStepKey)}
/>
<Box width="100%">
<Stepper
steps={addNewChainSteps}
completedSteps={completedSteps}
setActiveStepKey={(key) => setActiveStepKey(key as ActiveStepKey)}
/>
</Box>
{activeStepKey === 'newaddress' && (
<NewAddress
isLoading={isPending && !isError}
Expand Down Expand Up @@ -209,6 +211,7 @@ const AddNewChain: FC = () => {
type={UNLOCK_PROFILE_TYPE.MODAL}
showConnectModal={true}
onClose={handleCloseAuthModal}
description="Unlock your profile to proceed."
/>
</Box>
)}
Expand Down
27 changes: 15 additions & 12 deletions src/modules/createChannel/CreateChannel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const CreateChannel = () => {
'Creating your channel, Aligning pixels, adjusting padding... This may take some time.',
'Redirecting... Please do not refresh'
);
navigate(`${APP_PATHS.ChannelDashboard}/${account}`)
navigate(`${APP_PATHS.ChannelDashboard}/${account}`);
}, 3000);
}
},
Expand Down Expand Up @@ -213,14 +213,16 @@ const CreateChannel = () => {
return (
<CreateChannelFormProvider onSubmit={(values: ChannelInfoFormValues) => handleCreateNewChannel(values)}>
<Box
padding={{ initial: 'spacing-lg', ml: 'spacing-sm' }}
backgroundColor="surface-primary"
borderRadius="radius-md"
padding={{ dp: 'spacing-lg', ml: 'spacing-sm' }}
display="flex"
width={{ initial: '648px', ml: '325px' }}
flexDirection="column"
alignItems="center"
gap="spacing-xl"
alignSelf="center"
width={{ dp: '648px', ml: '357px' }}
borderRadius="radius-md"
alignItems="center"
backgroundColor="surface-primary"
margin={{ dp: 'spacing-lg', ml: 'spacing-sm' }}
>
<CreateChannelHeader />

Expand All @@ -246,12 +248,13 @@ const CreateChannel = () => {
alignItems="center"
alignSelf="stretch"
>
<Stepper
steps={createChannelSteps}
completedSteps={completedSteps}
setActiveStepKey={(key) => setActiveStepKey(key as ActiveStepKey)}
/>

<Box width="100%">
<Stepper
steps={createChannelSteps}
completedSteps={completedSteps}
setActiveStepKey={(key) => setActiveStepKey(key as ActiveStepKey)}
/>
</Box>
{activeStepKey == 'channelInfo' && (
<ChannelInfo
handleNextStep={handleNextStep}
Expand Down
3 changes: 2 additions & 1 deletion src/modules/sendNotification/SendNotification.form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as yup from 'yup';

import { SelectOption } from 'blocks/select/Select';
import { getRequiredFieldMessage } from 'common';
import { appConfig } from 'config';

export const getValidationSchema = (isSubsetRecipientPresent: boolean) => {
return yup.object().shape({
Expand Down Expand Up @@ -31,7 +32,7 @@ export const getValidationSchema = (isSubsetRecipientPresent: boolean) => {
export const getFormInitialValues = (delegateesOptions: SelectOption[]) => {
return {
channelAddress: delegateesOptions[0]?.value || '',
chainId: '11155111',
chainId: appConfig.coreContractChain.toString(),
type: 'BROADCAST' as NotificationType,
recipient: '',
titleChecked: false,
Expand Down
1 change: 1 addition & 0 deletions src/modules/sendNotification/SendNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const SendNotification: FC = () => {
type={UNLOCK_PROFILE_TYPE.MODAL}
showConnectModal={true}
onClose={() => setIsAuthModalVisible(false)}
description="Unlock your profile to proceed."
/>
</Box>
)}
Expand Down
3 changes: 2 additions & 1 deletion src/modules/sendNotification/SendNotification.utils.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { NotificationType } from '@pushprotocol/restapi';

import { Box } from 'blocks';
import { appConfig } from 'config';
import { convertAddressToAddrCaip } from 'helpers/CaipHelper';

import { ChannelSetting } from 'helpers/channel/types';
Expand All @@ -12,7 +13,7 @@ export const getChannelChainList = (channelDetails: ChannelDetails) => {
channelDetails?.aliases
?.filter((alias) => alias.is_alias_verified)
?.map((alias) => parseInt(alias.alias_blockchain_id)) || [];
return [...aliases, 11155111];
return [...aliases, appConfig.coreContractChain];
};

export const getChannelDelegatesOptions = (delegatees: [ChannelDetails]) => {
Expand Down

0 comments on commit 51e30be

Please sign in to comment.