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

1703 Side nav bar design #1806

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@ function SubmissionForm() {
const [sending, setSending] = useState(false);
const [unsavedChanges, setunsavedChanges] = useState(false);
const [Dialog, confirmLeave] = useConfirm(
['You have unsaved changes','',''],
['You have unsaved changes', '', ''],
'Are you sure you want to discard the changes and leave',
['alternative primary', 'CANCEL', 'LEAVE']
)
);
const [urrl, setUrrl] = useState('');

const [CreateFailure, confirmFailure] = useConfirm(
['Unable to register your idea.','',''],
['Unable to register your idea.', '', ''],
'Please try again.',
['primary', 'close'],
['primary', 'close']
);

const getDBInvolveLevel = (involveString) => {
if (involveString.includes("and also believe")) {
return "highly";
} else if (involveString.includes("to help with workshopping")) {
return "medium";
}/* else if (involveString.includes("")) {
if (involveString.includes('and also believe')) {
return 'highly';
} else if (involveString.includes('to help with workshopping')) {
return 'medium';
} /* else if (involveString.includes("")) {
return "minimum";
}*/ else {
return "none"
return 'none';
}
};

Expand All @@ -63,7 +63,6 @@ function SubmissionForm() {
involveLevel: Yup.string().required('Level of involvement is Required.'),
});


const submitHandler = async (values) => {
values['author'] = userData.id;
values['ideaOwner'] = userData.id;
Expand All @@ -76,10 +75,11 @@ function SubmissionForm() {
values['experience'] = values['experience'].trim();
values['extraInfo'] = values['extraInfo'].trim();
const involveValueForDataBase = getDBInvolveLevel(
values['involveLevel'].trim());
values['involveLevel'].trim()
);

values['involveLevel'] = involveValueForDataBase;
setSending(true);
setSending(true);

try {
const data = cleanData(await agent.Ideas.post(values));
Expand All @@ -90,20 +90,18 @@ function SubmissionForm() {
} else {
alert('Unable to register your idea.');
}

} catch (error) {
setSending(false);
setunsavedChanges(true);
confirmFailure();
}
};


const handleDialog = async (url) => {
if (await confirmLeave()) {
setUrrl(url);
}
}
};

useEffect(() => {
// For reloading.
Expand All @@ -119,7 +117,7 @@ function SubmissionForm() {
handleDialog(url);
router.events.emit('routeChangeError');
throw 'Abort route change. Please ignore this error.';
}
};
router.events.on('routeChangeStart', routeChangeStart);
return () => {
router.events.off('routeChangeStart', routeChangeStart);
Expand All @@ -139,7 +137,7 @@ function SubmissionForm() {
} else {
window.history.back(-1);
}
}
};

return (
<>
Expand All @@ -148,20 +146,20 @@ function SubmissionForm() {
<StyledRanbow>
<atoms.Layer hasRainbowBottom />
</StyledRanbow>
<BackButton
buttonType="confirm"
clickHandler={backHandler}
/>
<atoms.Typography type='h4' >
Have an idea for a development project?<br />
<BackButton buttonType="confirm" clickHandler={backHandler} />
<atoms.Typography type="h4">
Have an idea for a development project?
<br />
Share your idea with us!
</atoms.Typography>
</HeadWapper>

{!isAuthenticated ? (
<SignInSection
label='Please sign in to submit your idea!'
redirectURL={process.env.NEXT_PUBLIC_FRONT_END_URL + '/ideaspace/submit'}
label="Please sign in to submit your idea!"
redirectURL={
process.env.NEXT_PUBLIC_FRONT_END_URL + '/ideaspace/submit'
}
/>
) : (
<>
Expand All @@ -179,7 +177,6 @@ function SubmissionForm() {
)}
</>
);

}

export default SubmissionForm;
3 changes: 2 additions & 1 deletion apps/user-profile/src/components/common/Card/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import Header from './Header';
function Card({ title, children, onEdit }) {
return (
<div className="flex flex-col shadow-lg w-full h-full bg-white">
<Header title={title} onEdit={onEdit} /> <div className="px-8 pb-10 pt-6">{children}</div>
<Header title={title} onEdit={onEdit} />{' '}
<div className="px-8 pb-10 pt-6">{children}</div>
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ function Header({ title, onEdit }) {
<Typography type="h3" className="m-0 p-0">
{title}
</Typography>
{onEdit != null && typeof onEdit == 'function' ? <EditButton onEdit={onEdit} /> : null}
{onEdit != null && typeof onEdit == 'function' ? (
<EditButton onEdit={onEdit} />
) : null}
</div>
) : (
<></>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import React from 'react';

function FilledCross({ width, height, colorClass, svgClass }) {
return (
Expand All @@ -11,11 +11,19 @@ function FilledCross({ width, height, colorClass, svgClass }) {
xmlns="http://www.w3.org/2000/svg"
>
<g id="Group 865">
<path className={colorClass ?? 'fill-white'} id="Vector" d="M12.6451 14.0026C12.4707 14.0031 12.2984 13.9701 12.1409 13.9061C11.9834 13.842 11.8446 13.7486 11.7347 13.6326L6.09754 7.63256C5.92588 7.45363 5.83203 7.22919 5.83203 6.99756C5.83203 6.76594 5.92588 6.5415 6.09754 6.36256L11.9331 0.362565C12.1312 0.158348 12.4159 0.0299235 12.7245 0.00554376C13.0332 -0.018836 13.3404 0.0628259 13.5788 0.232564C13.8171 0.402303 13.967 0.646214 13.9955 0.910641C14.0239 1.17507 13.9286 1.43835 13.7305 1.64256L8.51348 7.00256L13.5554 12.3626C13.6982 12.5093 13.7888 12.6881 13.8167 12.8776C13.8446 13.0672 13.8085 13.2596 13.7127 13.4321C13.6169 13.6047 13.4655 13.7501 13.2763 13.8512C13.0871 13.9523 12.868 14.0048 12.6451 14.0026Z" />
<path className={colorClass ?? 'fill-white'} id="Vector_2" d="M1.35541 5.95712e-05C1.52977 -0.000448724 1.70205 0.0325236 1.85958 0.0965524C2.01712 0.160581 2.15591 0.25404 2.26576 0.37006L7.90295 6.37006C8.07461 6.54899 8.16846 6.77344 8.16846 7.00506C8.16846 7.23669 8.07461 7.46113 7.90295 7.64006L2.06735 13.6401C1.86924 13.8443 1.58457 13.9727 1.27595 13.9971C0.967335 14.0215 0.660055 13.9398 0.421709 13.7701C0.183363 13.6003 0.0334778 13.3564 0.0050231 13.092C-0.0234307 12.8276 0.0718786 12.5643 0.269983 12.3601L5.48701 7.00006L0.445053 1.64006C0.302334 1.49327 0.211676 1.31453 0.183805 1.12499C0.155935 0.935437 0.192019 0.743012 0.287788 0.570485C0.383557 0.397957 0.535003 0.252546 0.724205 0.151455C0.913407 0.0503649 1.13245 -0.00217204 1.35541 5.95712e-05Z" />
<path
className={colorClass ?? 'fill-white'}
id="Vector"
d="M12.6451 14.0026C12.4707 14.0031 12.2984 13.9701 12.1409 13.9061C11.9834 13.842 11.8446 13.7486 11.7347 13.6326L6.09754 7.63256C5.92588 7.45363 5.83203 7.22919 5.83203 6.99756C5.83203 6.76594 5.92588 6.5415 6.09754 6.36256L11.9331 0.362565C12.1312 0.158348 12.4159 0.0299235 12.7245 0.00554376C13.0332 -0.018836 13.3404 0.0628259 13.5788 0.232564C13.8171 0.402303 13.967 0.646214 13.9955 0.910641C14.0239 1.17507 13.9286 1.43835 13.7305 1.64256L8.51348 7.00256L13.5554 12.3626C13.6982 12.5093 13.7888 12.6881 13.8167 12.8776C13.8446 13.0672 13.8085 13.2596 13.7127 13.4321C13.6169 13.6047 13.4655 13.7501 13.2763 13.8512C13.0871 13.9523 12.868 14.0048 12.6451 14.0026Z"
/>
<path
className={colorClass ?? 'fill-white'}
id="Vector_2"
d="M1.35541 5.95712e-05C1.52977 -0.000448724 1.70205 0.0325236 1.85958 0.0965524C2.01712 0.160581 2.15591 0.25404 2.26576 0.37006L7.90295 6.37006C8.07461 6.54899 8.16846 6.77344 8.16846 7.00506C8.16846 7.23669 8.07461 7.46113 7.90295 7.64006L2.06735 13.6401C1.86924 13.8443 1.58457 13.9727 1.27595 13.9971C0.967335 14.0215 0.660055 13.9398 0.421709 13.7701C0.183363 13.6003 0.0334778 13.3564 0.0050231 13.092C-0.0234307 12.8276 0.0718786 12.5643 0.269983 12.3601L5.48701 7.00006L0.445053 1.64006C0.302334 1.49327 0.211676 1.31453 0.183805 1.12499C0.155935 0.935437 0.192019 0.743012 0.287788 0.570485C0.383557 0.397957 0.535003 0.252546 0.724205 0.151455C0.913407 0.0503649 1.13245 -0.00217204 1.35541 5.95712e-05Z"
/>
</g>
</svg>
)
);
}

export default FilledCross
export default FilledCross;

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

function OutlinedCamera({ width, height, colorClass, svgClass, }) {
function OutlinedCamera({ width, height, colorClass, svgClass }) {
return (
<svg
width={width ?? '18'}
Expand Down
Loading
Loading