Skip to content

Commit

Permalink
Merge pull request #1116 from coderatomy/new-signup
Browse files Browse the repository at this point in the history
New signup
  • Loading branch information
coderatomy authored Feb 23, 2024
2 parents 40bb395 + 6416e8a commit 5e5e48a
Show file tree
Hide file tree
Showing 17 changed files with 1,333 additions and 733 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ import { colors } from "../../../colors";
const styles = theme => ({
primaryButtonStyle: {
backgroundColor: 'var(--primary-color3)',
borderRadius: 30,
borderRadius: theme.spacing(1),
color: 'white',
'&.disabled': {
color: '#7BA8AB',
background: 'rgba(0, 184, 196, 0.10)',
},
'&:hover': {
backgroundColor: 'var(--secondary-color6)',
},
Expand Down
50 changes: 28 additions & 22 deletions zubhub_frontend/zubhub/src/components/Navbar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ function NavBar(props) {
const [searchType, setSearchType] = useState(getQueryParams(window.location.href).get('type') || SearchType.PROJECTS);
const formRef = useRef();
const token = useSelector(state => state.auth.token);
const pathname = props.location?.pathname
const hideSearchAndActions = pathname === '/signup' || pathname === '/login';

const [state, setState] = React.useState({
username: null,
Expand Down Expand Up @@ -215,11 +217,14 @@ function NavBar(props) {
<AppBar className={classes.navBarStyle}>
<Container id="navbar-root" className={classes.mainContainerStyle}>
<Toolbar className={classes.toolBarStyle}>
<Hidden mdUp>
<Box style={{ marginRight: 10 }} onClick={toggleDrawer}>
<MenuIcon />
</Box>
</Hidden>
{!hideSearchAndActions && (
<Hidden mdUp>
<Box style={{ marginRight: 10 }} onClick={toggleDrawer}>
<MenuIcon />
</Box>
</Hidden>
)}

<Box className={classes.logoStyle}>
<Link to="/">
<img src={zubhub?.header_logo_url ? zubhub.header_logo_url : logo} alt="logo" />
Expand Down Expand Up @@ -335,24 +340,25 @@ function NavBar(props) {
</FormControl>
</form>
</Box>
<div className={classes.navActionStyle}>
<SearchOutlined onClick={toggleSearchBar} className={classes.addOn894} />

<NotificationButton />
<Hidden smDown>
{props.auth.username && (
<Box>
<Typography className={clsx(common_classes.title2, classes.username)}>
{props.auth.username}
</Typography>
{/* Todo: Change this subheading based on current role of user */}
<Typography className="">Creator</Typography>
</Box>
)}
</Hidden>

{!hideSearchAndActions && (
<div className={classes.navActionStyle}>
<SearchOutlined onClick={toggleSearchBar} className={classes.addOn894} />

<NotificationButton />
<Hidden smDown>
{props.auth.username && (
<Box>
<Typography className={clsx(common_classes.title2, classes.username)}>
{props.auth.username}
</Typography>
{/* Todo: Change this subheading based on current role of user */}
<Typography className="">Creator</Typography>
</Box>
)}
</Hidden>
<AvatarButton navigate={props.navigate} />
</div>
)}
</Toolbar>
{open_search_form ? (
<ClickAwayListener onClickAway={e => handleSetState(closeSearchFormOrIgnore(e))}>
Expand Down Expand Up @@ -455,4 +461,4 @@ const mapDispatchToProps = dispatch => {
};
};

export default connect(mapStateToProps, mapDispatchToProps)(NavBar);
export default connect(mapStateToProps, mapDispatchToProps)(NavBar);
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { FormHelperText } from '@mui/material';
import React from 'react';

const CustomErrorMessage = props => {
const { name, touched, errors } = props;
return <FormHelperText error>{touched[name] && errors[name] && <>{errors[name]}</>}</FormHelperText>;
};

export default CustomErrorMessage;
29 changes: 20 additions & 9 deletions zubhub_frontend/zubhub/src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,27 @@ import Modal from "./modals/Modal";
import PreviewActivity from "./previewActivity/PreviewActivity";
import PreviewProject from "./previewProject/PreviewProject";
import Pill from "./pill/Pill";
import CustomErrorMessage from './form/errorMessage/ErrorMessage';
import ProtectedRoute from './protected_route/ProtectedRoute';

export {
Comments,
CustomButton, Dropdown,
Editor, Gallery, ImageInput,
LabeledLine, Modal, OrDivider, PreviewProject,
SelectFromPills, Sidenav, TagsInput, VideoInput,
Collapsible,
PreviewActivity,
Pill,
ProtectedRoute,
Comments,
CustomButton,
Dropdown,
Editor,
Gallery,
ImageInput,
LabeledLine,
Modal,
OrDivider,
PreviewProject,
SelectFromPills,
Sidenav,
TagsInput,
VideoInput,
Collapsible,
PreviewActivity,
Pill,
ProtectedRoute,
CustomErrorMessage,
};
Loading

0 comments on commit 5e5e48a

Please sign in to comment.