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

Small UI changes #346

Merged
merged 2 commits into from
Oct 31, 2022
Merged
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
2 changes: 1 addition & 1 deletion frontend/components/navigation/NavDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ const NavDrawer = ({ isOpen, setIsOpen, navigationTextPathMap }: Props) => {
sx={isTabForCurrentPage(path, router.pathname) ? activeTabSx : inactiveTabSx}
onClick={() => {
log(`[NavDrawer] Click "${label}"`);
console.log(`[NavDrawer] Click "${label}"`);
router.push(path);
setIsOpen(false);
}}
>
<ListItemText>
Expand Down
9 changes: 7 additions & 2 deletions frontend/components/navigation/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import {
activeTabSx,
adminCaptionSx,
inactiveTabSx,
toolbarDesktopLogoIconSx,
toolbarHamburgerSx,
toolbarLeftContainerSx,
toolbarLogoIconSx,
toolbarLogoSx,
toolbarMobileLogoIconSx,
toolbarSx,
} from '../../styles/components/navigation/NavbarStyles';
import { log } from '../../utils/analytics';
Expand Down Expand Up @@ -52,7 +53,11 @@ const NavBar = () => {

<Link href={isAdminSignedInPage ? adminPathPrefix : '/'}>
<Stack sx={toolbarLogoSx} component="div" direction="row" spacing={1}>
{!isMobile && <Box sx={toolbarLogoIconSx} component="img" src="/logo-icon.png" />}
{isMobile ? (
<Box sx={toolbarMobileLogoIconSx} component="img" src="/logo-icon.png" />
) : (
<Box sx={toolbarDesktopLogoIconSx} component="img" src="/logo-icon.png" />
)}

<Typography variant={isMobile ? 'h4' : 'h3'}>Giving Coupons</Typography>

Expand Down
8 changes: 4 additions & 4 deletions frontend/pages/admin/campaigns/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ const AdminCampaigns = () => {
<Paper>
<Tabbed
tabs={[
{
label: 'Upcoming',
content: makeCampaignsTable(upcomingCampaigns),
},
{
label: 'Active',
content: makeCampaignsTable(activeCampaigns),
},
{
label: 'Upcoming',
content: makeCampaignsTable(upcomingCampaigns),
},
{
label: 'Completed',
content: makeCampaignsTable(completedCampaigns),
Expand Down
2 changes: 1 addition & 1 deletion frontend/pages/admin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const AdminDashboard: NextPage = () => {

useEffect(() => {
if (router.pathname == '/admin') {
router.push('/admin/interests');
router.push('/admin/campaigns');
}
});

Expand Down
6 changes: 5 additions & 1 deletion frontend/styles/components/navigation/NavbarStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ export const toolbarLogoSx: SxProps = {
},
};

export const toolbarLogoIconSx: SxProps = {
export const toolbarDesktopLogoIconSx: SxProps = {
height: '1.8em',
};

export const toolbarMobileLogoIconSx: SxProps = {
height: '1.4em',
};

export const inactiveTabSx: SxProps = {
display: 'flex',
alignItems: 'center',
Expand Down
2 changes: 1 addition & 1 deletion frontend/utils/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export const defaultNavigationTextPathMap = OrderedMap({
});

export const adminNavigationTextPathMap = OrderedMap({
'Manage interests': '/admin/interests',
'Manage campaigns': '/admin/campaigns',
'Manage interests': '/admin/interests',
'Manage charities': '/admin/charities',
});

Expand Down