Skip to content

Commit 028f5bc

Browse files
Merge pull request #2291 from zetkin/issue-2255/better-organize-landing-page
Better organize landing page
2 parents 9190993 + 7b5bbf6 commit 028f5bc

File tree

7 files changed

+144
-18
lines changed

7 files changed

+144
-18
lines changed

.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
ZETKIN_APP_DOMAIN=http://www.dev.zetkin.org
2+
ZETKIN_GEN2_ORGANIZE_URL=http://organize.dev.zetkin.org
23

34
ZETKIN_PRIVACY_POLICY_LINK=https://zetkin.org/privacy
45

src/core/env/Environment.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ type EnvVars = {
44
FEAT_AREAS?: string | null;
55
MUIX_LICENSE_KEY: string | null;
66
ZETKIN_APP_DOMAIN: string | null;
7+
ZETKIN_GEN2_ORGANIZE_URL?: string | null;
78
};
89

910
export default class Environment {
@@ -20,6 +21,7 @@ export default class Environment {
2021
FEAT_AREAS: null,
2122
MUIX_LICENSE_KEY: null,
2223
ZETKIN_APP_DOMAIN: null,
24+
ZETKIN_GEN2_ORGANIZE_URL: null,
2325
};
2426
}
2527

src/features/organizations/components/OrganizationsList.tsx

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,54 @@
11
import NextLink from 'next/link';
2-
import { Avatar, Box, Link, List, ListItem, Typography } from '@mui/material';
2+
import { Key } from '@mui/icons-material';
3+
import {
4+
Alert,
5+
AlertTitle,
6+
Avatar,
7+
Box,
8+
Link,
9+
List,
10+
ListItem,
11+
Typography,
12+
} from '@mui/material';
313

414
import messageIds from 'features/organizations/l10n/messageIds';
515
import useMemberships from '../hooks/useMemberships';
6-
import { useMessages } from 'core/i18n';
16+
import { Msg, useMessages } from 'core/i18n';
717
import ZUIFuture from 'zui/ZUIFuture';
18+
import { useEnv } from 'core/hooks';
819

920
const OrganizationsList = () => {
1021
const messages = useMessages(messageIds);
22+
const env = useEnv();
1123
const organizations = useMemberships();
1224

1325
return (
14-
<ZUIFuture future={organizations}>
26+
<ZUIFuture future={organizations} ignoreDataWhileLoading>
1527
{(data) => {
28+
if (organizations.data && organizations.data.length == 0) {
29+
return (
30+
<Alert icon={<Key />} severity="error">
31+
<AlertTitle>
32+
<Msg id={messageIds.notOrganizer.title} />
33+
</AlertTitle>
34+
<Typography>
35+
<Msg id={messageIds.notOrganizer.description} />
36+
</Typography>
37+
<Typography my={1}>
38+
<NextLink
39+
href={env.vars.ZETKIN_APP_DOMAIN || ''}
40+
legacyBehavior
41+
passHref
42+
>
43+
<Link>
44+
<Msg id={messageIds.notOrganizer.myPageButton} />
45+
</Link>
46+
</NextLink>
47+
</Typography>
48+
</Alert>
49+
);
50+
}
51+
1652
return (
1753
<Box style={{ margin: '30px' }}>
1854
<Typography variant="h3">{messages.page.title()}</Typography>

src/features/organizations/l10n/messageIds.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
import { m, makeMessages } from 'core/i18n';
22

33
export default makeMessages('feat.organizations', {
4+
gen3: {
5+
description: m(
6+
'This is the new (generation 3) organizer web app. If you are used to the old one, you will find lots of new features and an improved user interface here. But if you want, you can still use the old organizer app for a while longer.'
7+
),
8+
gen2Button: m('Go to the old interface'),
9+
title: m('Welcome to the new Zetkin!'),
10+
},
11+
notOrganizer: {
12+
description: m(
13+
'This part of Zetkin is only available to users who have been granted organizer access by another organization official. You do not currently have the sufficient level of access. If you believe that this is a mistake, please reach out to your local Zetkin officials or to Zetkin Foundation.'
14+
),
15+
myPageButton: m('Go to activist portal'),
16+
title: m('You do not have organizer access'),
17+
},
418
page: {
519
title: m('Select organization:'),
620
},

src/pages/organize/index.tsx

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
import { AutoAwesome } from '@mui/icons-material';
2+
import { Alert, AlertTitle, Box, Link, Typography } from '@mui/material';
3+
import NextLink from 'next/link';
14
import { GetServerSideProps } from 'next';
25
import Head from 'next/head';
36

47
import messageIds from 'features/organizations/l10n/messageIds';
5-
import NoMenuLayout from 'utils/layout/NoMenuLayout';
68
import { PageWithLayout } from 'utils/types';
79
import { scaffold } from 'utils/next';
8-
import { useMessages } from 'core/i18n';
10+
import { Msg, useMessages } from 'core/i18n';
911
import UserOrganizations from 'features/organizations/components/OrganizationsList';
12+
import ZUILogo from 'zui/ZUILogo';
13+
import { useEnv } from 'core/hooks';
1014

1115
const scaffoldOptions = {
1216
authLevelRequired: 2,
@@ -21,18 +25,46 @@ export const getServerSideProps: GetServerSideProps = scaffold(async () => {
2125

2226
const OrganizePage: PageWithLayout = () => {
2327
const messages = useMessages(messageIds);
28+
const env = useEnv();
29+
2430
return (
2531
<>
2632
<Head>
2733
<title>{messages.page.title()}</title>
2834
</Head>
29-
<UserOrganizations />
35+
<Box maxWidth={800} mx="auto" my={2}>
36+
<Box textAlign="center">
37+
<ZUILogo htmlColor="black" size={100} />
38+
</Box>
39+
<Box my={1}>
40+
<Alert icon={<AutoAwesome fontSize="inherit" />} severity="info">
41+
<AlertTitle>
42+
<Msg id={messageIds.gen3.title} />
43+
</AlertTitle>
44+
<Typography>
45+
<Msg id={messageIds.gen3.description} />
46+
</Typography>
47+
<Typography my={1}>
48+
<NextLink
49+
href={env.vars.ZETKIN_GEN2_ORGANIZE_URL || ''}
50+
legacyBehavior
51+
passHref
52+
>
53+
<Link>
54+
<Msg id={messageIds.gen3.gen2Button} />
55+
</Link>
56+
</NextLink>
57+
</Typography>
58+
</Alert>
59+
</Box>
60+
<UserOrganizations />
61+
</Box>
3062
</>
3163
);
3264
};
3365

3466
OrganizePage.getLayout = function getLayout(page) {
35-
return <NoMenuLayout>{page}</NoMenuLayout>;
67+
return page;
3668
};
3769

3870
export default OrganizePage;

src/utils/next.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ export const scaffold =
207207
FEAT_AREAS: process.env.FEAT_AREAS || null,
208208
MUIX_LICENSE_KEY: process.env.MUIX_LICENSE_KEY || null,
209209
ZETKIN_APP_DOMAIN: process.env.ZETKIN_APP_DOMAIN || null,
210+
ZETKIN_GEN2_ORGANIZE_URL:
211+
process.env.ZETKIN_GEN2_ORGANIZE_URL || null,
210212
},
211213
lang,
212214
messages,

src/zui/ZUILogo/index.tsx

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,57 @@ const ZUILogo = ({
4040
color={color}
4141
htmlColor={htmlColor}
4242
style={{ fontSize: size }}
43-
viewBox="0 0 39 32"
43+
viewBox="0 0 177 107"
4444
>
45-
<path d="M11.8315 3.72506C12.8601 3.72506 13.694 2.89117 13.694 1.86253C13.694 0.833882 12.8601 0 11.8315 0C10.8028 0 9.96893 0.833882 9.96893 1.86253C9.96893 2.89117 10.8028 3.72506 11.8315 3.72506Z" />
46-
<path d="M18.4677 4.58636C19.6357 4.58636 20.5825 3.63953 20.5825 2.47156C20.5825 1.30358 19.6357 0.35675 18.4677 0.35675C17.2997 0.35675 16.3529 1.30358 16.3529 2.47156C16.3529 3.63953 17.2997 4.58636 18.4677 4.58636Z" />
47-
<path d="M25.2714 5.21903C26.435 5.21903 27.3783 4.27573 27.3783 3.11211C27.3783 1.94849 26.435 1.00519 25.2714 1.00519C24.1077 1.00519 23.1644 1.94849 23.1644 3.11211C23.1644 4.27573 24.1077 5.21903 25.2714 5.21903Z" />
48-
<path d="M32.282 6.10398C33.5947 6.10398 34.6589 5.03978 34.6589 3.72704C34.6589 2.41429 33.5947 1.3501 32.282 1.3501C30.9692 1.3501 29.905 2.41429 29.905 3.72704C29.905 5.03978 30.9692 6.10398 32.282 6.10398Z" />
49-
<path d="M24.8003 12.2789C26.223 12.2789 27.3763 11.1256 27.3763 9.70289C27.3763 8.28021 26.223 7.12689 24.8003 7.12689C23.3776 7.12689 22.2243 8.28021 22.2243 9.70289C22.2243 11.1256 23.3776 12.2789 24.8003 12.2789Z" />
50-
<path d="M15.4364 18.6213C16.9832 18.6213 18.2371 17.3674 18.2371 15.8206C18.2371 14.2739 16.9832 13.02 15.4364 13.02C13.8896 13.02 12.6357 14.2739 12.6357 15.8206C12.6357 17.3674 13.8896 18.6213 15.4364 18.6213Z" />
51-
<path d="M3.34079 27.0037C5.18582 27.0037 6.68151 25.508 6.68151 23.663C6.68151 21.818 5.18582 20.3223 3.34079 20.3223C1.49575 20.3223 6.10352e-05 21.818 6.10352e-05 23.663C6.10352e-05 25.508 1.49575 27.0037 3.34079 27.0037Z" />
52-
<path d="M13.3176 28.6455C15.2889 28.6455 16.8869 27.0475 16.8869 25.0762C16.8869 23.1049 15.2889 21.5068 13.3176 21.5068C11.3463 21.5068 9.74823 23.1049 9.74823 25.0762C9.74823 27.0475 11.3463 28.6455 13.3176 28.6455Z" />
53-
<path d="M23.671 30.2479C25.7174 30.2479 27.3763 28.5889 27.3763 26.5425C27.3763 24.4961 25.7174 22.8372 23.671 22.8372C21.6246 22.8372 19.9656 24.4961 19.9656 26.5425C19.9656 28.5889 21.6246 30.2479 23.671 30.2479Z" />
54-
<path d="M34.4481 32C36.6186 32 38.3781 30.2405 38.3781 28.07C38.3781 25.8995 36.6186 24.14 34.4481 24.14C32.2776 24.14 30.5181 25.8995 30.5181 28.07C30.5181 30.2405 32.2776 32 34.4481 32Z" />
45+
<path
46+
d="M150.54,97.82c-0.53-0.15-1.06-0.05-1.58-0.01c-5.14,0.32-10.19-0.43-15.18-2.11c-2.22-0.75-4.37-1.71-6.43-2.93
47+
c-1.81-1.07-3.52-2.33-5.05-3.89c-1.16-1.18-2.17-2.49-2.94-4.03c-0.48-0.95-0.83-1.94-1.02-3.01c-0.43-2.38-0.02-4.53,1.14-6.49
48+
c0.93-1.58,2.19-2.77,3.62-3.75c1.54-1.06,3.2-1.82,4.94-2.4c1.58-0.53,3.2-0.88,4.84-1.12c3.02-0.43,6.07-0.42,9.12-0.06
49+
c3.99,0.47,7.87,1.52,11.61,3.28c2.34,1.11,4.56,2.47,6.59,4.23c1.35,1.17,2.57,2.48,3.57,4.04c0.33,0.51,0.61,1.06,0.9,1.61
50+
c0.24,0.45,0.43,0.93,0.53,1.45c0.03,0.14,0.12,0.27,0.18,0.41c0.14,0.87,0.28,1.75,0.43,2.62c-0.02,0.12-0.07,0.25-0.06,0.36
51+
c0.07,0.55-0.01,1.08-0.11,1.61c-0.17,0.89-0.47,1.71-0.88,2.47c-0.61,1.15-1.42,2.1-2.35,2.92c-1.36,1.21-2.89,2.08-4.51,2.78
52+
c-1.17,0.5-2.39,0.85-3.6,1.21c-0.21,0.06-0.41,0.18-0.62,0.28C152.64,97.48,151.59,97.65,150.54,97.82z"
53+
/>
54+
<path
55+
d="M78.22,79.54c-4.18-0.05-8.07-0.62-11.8-2.11c-1.58-0.63-3.07-1.41-4.44-2.42c-1.14-0.84-2.14-1.82-2.91-3.02
56+
c-0.67-1.05-1.1-2.18-1.21-3.42c-0.12-1.33,0.18-2.59,0.75-3.78c0.65-1.33,1.59-2.43,2.69-3.41c1.63-1.46,3.51-2.51,5.51-3.34
57+
c2.3-0.94,4.68-1.55,7.14-1.91c2.64-0.39,5.29-0.49,7.94-0.27c3.63,0.3,7.14,1.09,10.41,2.77c1.66,0.85,3.17,1.9,4.39,3.33
58+
c0.44,0.51,0.84,1.07,1.17,1.65c1.24,2.21,1.34,4.5,0.29,6.81c-0.6,1.32-1.47,2.45-2.53,3.43c-1.68,1.56-3.64,2.67-5.76,3.52
59+
c-2.13,0.86-4.35,1.41-6.62,1.76C81.51,79.4,79.77,79.49,78.22,79.54z"
60+
/>
61+
<path
62+
d="M17.6,67.17c-1.88,0.03-3.95-0.16-5.98-0.67c-1.11-0.28-2.19-0.66-3.2-1.21c-0.6-0.32-1.16-0.7-1.65-1.18
63+
c-0.73-0.71-1.23-1.54-1.36-2.57c-0.1-0.74,0.04-1.45,0.31-2.14c0.33-0.86,0.85-1.61,1.46-2.29c0.97-1.1,2.12-2,3.35-2.79
64+
c2.46-1.6,5.14-2.73,7.94-3.58c2.75-0.83,5.55-1.37,8.41-1.61c2.08-0.17,4.16-0.18,6.24,0.06c1.76,0.21,3.49,0.59,5.11,1.34
65+
c0.86,0.4,1.65,0.89,2.3,1.58c1.15,1.22,1.5,2.64,1,4.25c-0.18,0.6-0.47,1.15-0.82,1.68c-0.75,1.14-1.73,2.08-2.8,2.92
66+
c-1.75,1.38-3.69,2.44-5.73,3.3c-3.09,1.3-6.3,2.14-9.61,2.58C20.99,67.05,19.41,67.17,17.6,67.17z"
67+
/>
68+
<path
69+
d="M71.09,41.67c-2.9,0-5.43-0.26-7.9-0.95c-0.93-0.26-1.83-0.59-2.68-1.06c-0.57-0.31-1.11-0.68-1.56-1.16
70+
c-0.99-1.05-1.06-2.22-0.21-3.39c0.34-0.47,0.76-0.85,1.22-1.2c0.92-0.69,1.95-1.2,3.01-1.62c1.65-0.66,3.37-1.08,5.11-1.37
71+
c2.21-0.37,4.44-0.55,6.68-0.48c2.19,0.07,4.36,0.3,6.47,0.91c1.05,0.3,2.07,0.68,3.01,1.27c0.51,0.32,0.98,0.68,1.35,1.17
72+
c0.73,0.96,0.78,2.03,0.14,3.05c-0.37,0.58-0.86,1.04-1.4,1.45c-0.84,0.63-1.76,1.1-2.73,1.5c-1.6,0.65-3.26,1.08-4.95,1.37
73+
C74.7,41.5,72.73,41.69,71.09,41.67z"
74+
/>
75+
<path
76+
d="M115.42,23.06c-2.73-0.08-5.39-0.43-8.01-1.45c-1.04-0.41-2.05-0.92-2.99-1.72c-0.42-0.35-0.8-0.76-1.12-1.32
77+
c-0.57-1-0.56-1.96,0.01-2.94c0.41-0.7,0.93-1.17,1.48-1.55c1.08-0.74,2.21-1.2,3.37-1.5c2.7-0.71,5.42-0.91,8.16-0.59
78+
c2.03,0.24,4.03,0.65,5.99,1.55c0.87,0.4,1.74,0.87,2.51,1.66c0.32,0.33,0.64,0.71,0.9,1.15c0.58,0.99,0.57,2.1-0.05,3.04
79+
c-0.31,0.48-0.69,0.87-1.07,1.2c-0.9,0.76-1.88,1.18-2.87,1.51C119.64,22.79,117.52,23,115.42,23.06z"
80+
/>
81+
<path
82+
d="M76.92,17.87c-2.14-0.08-3.8-0.21-5.43-0.97c-0.55-0.26-1.09-0.61-1.63-1c-0.27-0.2-0.53-0.51-0.76-0.87
83+
c-0.56-0.87-0.6-1.86-0.08-2.81c0.28-0.51,0.6-0.98,0.95-1.28c0.62-0.55,1.26-1.03,1.92-1.4c1.34-0.75,2.72-1.13,4.11-1.4
84+
c1.41-0.27,2.83-0.31,4.24-0.21c1.33,0.09,2.64,0.37,3.93,1.07c0.5,0.27,0.99,0.66,1.46,1.11c0.26,0.24,0.48,0.67,0.67,1.09
85+
c0.24,0.56,0.23,1.22,0.03,1.84c-0.19,0.57-0.45,0.98-0.74,1.34c-0.5,0.63-1.05,1.06-1.61,1.43c-1.22,0.8-2.47,1.28-3.74,1.55
86+
C78.96,17.64,77.71,17.75,76.92,17.87z"
87+
/>
88+
<path
89+
d="M41.66,13.97c-1.14-0.22-2.26-0.48-3.3-1.18c-0.38-0.25-0.75-0.57-1.08-1c-0.65-0.88-0.52-2,0.34-2.97
90+
c0.35-0.4,0.73-0.71,1.11-0.97c1.08-0.77,2.17-1.16,3.25-1.45c2.5-0.67,4.92-0.67,7.27-0.03c0.77,0.21,1.51,0.53,2.18,1.17
91+
c0.25,0.24,0.48,0.55,0.67,0.93c0.31,0.64,0.23,1.41-0.2,2.09c-0.29,0.45-0.62,0.8-0.94,1.1c-0.85,0.77-1.72,1.18-2.58,1.5
92+
c-1.39,0.52-2.77,0.81-4.13,0.83C43.37,14.01,42.51,13.98,41.66,13.97z"
93+
/>
5594
</SvgIcon>
5695
{beta && (
5796
<Typography className={classes.beta} variant="overline">

0 commit comments

Comments
 (0)