Skip to content

Commit

Permalink
[Community] Move "Interested in Rating an App section.
Browse files Browse the repository at this point in the history
  • Loading branch information
cvanem committed Oct 12, 2024
1 parent e9aaacf commit 7524daa
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 39 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app-map-db",
"version": "2.1.21",
"version": "2.1.22",
"private": true,
"homepage": "https://mindapps.org",
"enableLogRocket": true,
Expand Down
16 changes: 0 additions & 16 deletions src/components/layout/LeftDrawer/LeftDrawerContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import Logo from '../Logo';
import { useFullScreen } from '../../../hooks';
import FilterCount from './FilterCount';
import TourStep from '../../pages/Tour/TourStep';
import { publicUrl } from '../../../helpers';
import ArrowButton from '../../general/ArrowButton';
import { useHandleChangeRoute } from '../hooks';
import grey from '@mui/material/colors/grey';

const useStyles = makeStyles((theme: Theme) =>
createStyles({
Expand Down Expand Up @@ -63,19 +60,6 @@ export default function LeftDrawerContent({ setLeftDrawer = undefined }) {
<TourStep id={7} onOpen={handleOpen} onPrev={handleClose} onNext={handleClose} onClose={handleClose}>
<FilterContentLeftDrawer />
</TourStep>
<Box ml={1} mr={1} mb={1}>
<Divider />
</Box>
<Box p={1} sx={{ backgroundColor: grey[100] }}>
<Grid container alignItems='center' spacing={1}>
<Grid item xs={12}>
<Typography sx={{ color: 'primary.main', textAlign: 'left', fontSize: 22, fontWeight: 700 }}>Interested in rating an app?</Typography>
</Grid>
<Grid item xs={12} style={{ textAlign: 'right' }}>
<ArrowButton label='Rate an App' onClick={handleChangeRoute(publicUrl('/RateAnApp'))} />
</Grid>
</Grid>
</Box>
</>
);
}
52 changes: 30 additions & 22 deletions src/components/pages/Community/CommunityToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Button, Grid, Toolbar, Typography } from '@mui/material';
import createStyles from '@mui/styles/createStyles';
import makeStyles from '@mui/styles/makeStyles';
import { useUserEmail } from '../../layout/hooks';
import InterestedRateApp from './InterestedRateApp';

const spacing = 3;

Expand All @@ -15,7 +16,7 @@ const useStyles = makeStyles(({ palette }) =>
})
);

const CommunityToolbar = ({ title = undefined, subtitle = undefined, showGreeting = false, buttons = [] }) => {
const CommunityToolbar = ({ title = undefined, subtitle = undefined, showGreeting = false, buttons = [], showInterested = false }) => {
const email = useUserEmail();
const classes = useStyles();

Expand All @@ -32,31 +33,38 @@ const CommunityToolbar = ({ title = undefined, subtitle = undefined, showGreetin
return (
<>
{showToolbar && (
<Toolbar disableGutters style={{ marginTop: 16, paddingBottom: 16 }}>
<Grid alignItems='center' container justifyContent='space-between' spacing={spacing}>
<Grid item>
{title && (
<Typography color='textPrimary' variant='h4' className={classes.primaryHeaderText}>
{title}
</Typography>
<>
<Toolbar disableGutters style={{ marginTop: 16, paddingBottom: 16 }}>
<Grid alignItems='center' container justifyContent='space-between' spacing={spacing}>
{showInterested && (
<Grid item xs={12} sx={{ mt: 1 }}>
<InterestedRateApp />
</Grid>
)}
{SubTitle}
</Grid>
<Grid item>
<Grid container spacing={spacing}>
{buttons.map(
({ label, color = 'primary', size = 'large', startIcon = undefined, variant = 'outlined', onClick = undefined, ...other }: any) => (
<Grid item key={label}>
<Button color={color} size={size} startIcon={startIcon} onClick={onClick} variant='outlined' {...other}>
{label}
</Button>
</Grid>
)
<Grid item>
{title && (
<Typography color='textPrimary' variant='h4' className={classes.primaryHeaderText}>
{title}
</Typography>
)}
{SubTitle}
</Grid>
<Grid item>
<Grid container spacing={spacing}>
{buttons.map(
({ label, color = 'primary', size = 'large', startIcon = undefined, variant = 'outlined', onClick = undefined, ...other }: any) => (
<Grid item key={label}>
<Button color={color} size={size} startIcon={startIcon} onClick={onClick} variant='outlined' {...other}>
{label}
</Button>
</Grid>
)
)}
</Grid>
</Grid>
</Grid>
</Grid>
</Toolbar>
</Toolbar>
</>
)}
</>
);
Expand Down
24 changes: 24 additions & 0 deletions src/components/pages/Community/InterestedRateApp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Box, Grid, Typography } from '@mui/material';
import ArrowButton from '../../general/ArrowButton';
import grey from '@mui/material/colors/grey';
import { useHandleChangeRoute } from '../../layout/hooks';
import { publicUrl } from '../../../helpers';

const InterestedRateApp = () => {
const handleChangeRoute = useHandleChangeRoute();

return (
<Box p={0} sx={{ backgroundColor: grey[100], borderRadius: 0, pl: 2, pr: 1 }}>
<Grid container alignItems='center' spacing={1}>
<Grid item xs={12}>
<Typography sx={{ color: 'primary.main', textAlign: 'left', fontSize: 22, fontWeight: 700 }}>Interested in rating an app?</Typography>
</Grid>
<Grid item xs={12} style={{ textAlign: 'right' }}>
<ArrowButton label='Rate an App' onClick={handleChangeRoute(publicUrl('/RateAnApp'))} />
</Grid>
</Grid>
</Box>
);
};

export default InterestedRateApp;
1 change: 1 addition & 0 deletions src/components/pages/Team/TeamList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const TeamList = () => {
<CommunityToolbar
title='Team Members'
subtitle='Meet our team'
showInterested={true}
buttons={
isAdmin
? [
Expand Down

0 comments on commit 7524daa

Please sign in to comment.