Skip to content

Commit

Permalink
Merge pull request #156 from suvarnakale/release-1.0.0
Browse files Browse the repository at this point in the history
Issue #PS-0000 chore: compilation error fixed and buttons fixed
  • Loading branch information
itsvick authored Aug 16, 2024
2 parents 28472bb + 8efd733 commit adc15d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
9 changes: 6 additions & 3 deletions src/components/FormButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react';

interface IFormButtons {
formData: any;
onClick: (formData: any) => void;
onClick: (formData: any) => void;
isCreateCentered?: boolean;
isCreatedFacilitator?: boolean;
isCreatedLearner?: boolean;
Expand All @@ -26,7 +26,7 @@ const FormButtons: React.FC<IFormButtons> = ({
const buttonText = isSingleButton
? t('COMMON.SAVE')
: (isCreateCentered && !isCreatedFacilitator && !isCreatedLearner) ||
(isCreatedLearner && !isCreatedFacilitator && !isCreateCentered)
(isCreatedLearner && !isCreatedFacilitator && !isCreateCentered)
? t('COMMON.CREATE')
: t('GUIDE_TOUR.NEXT');

Expand Down Expand Up @@ -75,7 +75,10 @@ const FormButtons: React.FC<IFormButtons> = ({
height: '2.5rem',
padding: theme.spacing(1),
fontWeight: '500',
width: '100%',
width:
!isSingleButton && !isCreateCentered && !isCreatedFacilitator
? '50%'
: '100%',
}}
type="submit"
onClick={() => onClick(formData)}
Expand Down
15 changes: 7 additions & 8 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import menuIcon from '../assets/images/menuIcon.svg';
import { useTheme } from '@mui/material/styles';
import { useTranslation } from 'next-i18next';
import StyledMenu from './StyledMenu';
import MenuDrawer from './MenuDrawer';

interface HeaderProps {
toggleDrawer?: (newOpen: boolean) => () => void;
Expand Down Expand Up @@ -43,7 +44,7 @@ const Header: React.FC<HeaderProps> = ({ toggleDrawer, openDrawer }) => {
logEvent({
action: 'my-profile-clicked-header',
category: 'Dashboard',
label: 'Profile Clicked'
label: 'Profile Clicked',
});
}
};
Expand All @@ -54,7 +55,6 @@ const Header: React.FC<HeaderProps> = ({ toggleDrawer, openDrawer }) => {
action: 'logout-clicked-header',
category: 'Dashboard',
label: 'Logout Clicked',

});
};

Expand All @@ -73,9 +73,9 @@ const Header: React.FC<HeaderProps> = ({ toggleDrawer, openDrawer }) => {
const handleToggleDrawer = (newOpen: boolean) => () => {
setOpenMenu(newOpen);
};
const MenuDrawer = dynamic(() => import('./MenuDrawer'), {
ssr: false,
});
// const MenuDrawer = dynamic(() => import('./MenuDrawer'), {
// ssr: false,
// });

const [selectedLanguage, setSelectedLanguage] = useState('en');
useEffect(() => {
Expand Down Expand Up @@ -141,7 +141,6 @@ const Header: React.FC<HeaderProps> = ({ toggleDrawer, openDrawer }) => {
<Box
onClick={() => {
if (openDrawer) {

if (toggleDrawer) {
toggleDrawer(true)();
}
Expand Down Expand Up @@ -246,8 +245,8 @@ const Header: React.FC<HeaderProps> = ({ toggleDrawer, openDrawer }) => {
/>

<MenuDrawer
toggleDrawer={ openDrawer ? toggleDrawer : handleToggleDrawer}
open={openDrawer? openDrawer: openMenu}
toggleDrawer={openDrawer ? toggleDrawer : handleToggleDrawer}
open={openDrawer ? openDrawer : openMenu}
language={language}
setLanguage={setLanguage}
/>
Expand Down

0 comments on commit adc15d6

Please sign in to comment.