Skip to content

Commit 6d47866

Browse files
committed
Add about & support link
1 parent 6943f28 commit 6d47866

File tree

4 files changed

+91
-40
lines changed

4 files changed

+91
-40
lines changed

LICENCE

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
Hi.Events is licensed under the GNU Affero General Public License (AGPL) version 3.
2+
In accordance with Section 7(b) of the AGPL, you are required to retain the
3+
"Powered by Hi.Events" attribution at the footer of all web pages and emails
4+
generated by this software. If you modify Hi.Events, you may rephrase the attribution
5+
to reflect your changes, for example, "Powered by [Your Company] based on Hi.Events,"
6+
but the link must always direct to https://hi.events. If you wish to remove this
7+
attribution, a commercial license is available. For more details, please refer to
8+
our licensing page: https://hi.events/licensing.
9+
10+
The full text of the GNU Affero General Public License version 3 is provided below.
11+
112
GNU Affero General Public License
213
=================================
314

@@ -648,4 +659,4 @@ specific requirements.
648659
You should also get your employer (if you work as a programmer) or school,
649660
if any, to sign a “copyright disclaimer” for the program, if necessary.
650661
For more information on this, and how to apply and follow the GNU AGPL, see
651-
&lt;<http://www.gnu.org/licenses/>&gt;.
662+
&lt;<http://www.gnu.org/licenses/>&gt;.
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,77 @@
11
import {Avatar, Menu, UnstyledButton} from "@mantine/core";
22
import {getInitials} from "../../../utilites/helpers.ts";
3-
import {IconLifebuoy, IconLogout, IconSettingsCog, IconSpeakerphone, IconUser} from "@tabler/icons-react";
3+
import {IconLifebuoy, IconLogout, IconSettingsCog, IconUser,} from "@tabler/icons-react";
44
import {useGetMe} from "../../../queries/useGetMe.ts";
55
import {NavLink} from "react-router-dom";
66
import {t} from "@lingui/macro";
77
import {authClient} from "../../../api/auth.client.ts";
8+
import {useDisclosure} from "@mantine/hooks";
9+
import {AboutModal} from "../../modals/AboutModal/index.tsx";
10+
import {getConfig} from "../../../utilites/config.ts";
811

912
export const GlobalMenu = () => {
1013
const {data: me} = useGetMe();
14+
const [aboutModalOpen, {open: openAboutModal, close: closeAboutModal}] =
15+
useDisclosure(false);
1116

1217
const links = [
1318
{
1419
label: t`My Profile`,
1520
icon: IconUser,
16-
link: '/manage/profile',
21+
link: "/manage/profile",
1722
},
1823
{
1924
label: t`Account Settings`,
2025
icon: IconSettingsCog,
2126
link: `/account/settings`,
2227
},
23-
{
24-
label: t`Help & Support`,
25-
icon: IconLifebuoy,
26-
link: 'https://hi.events/docs?utm_source=app-top-menu-help-support',
27-
target: '_blank',
28-
},
29-
{
30-
label: t`Feedback`,
31-
icon: IconSpeakerphone,
32-
link: 'mailto:[email protected]?subject=Feedback',
33-
target: '_blank',
34-
},
3528
{
3629
label: t`Logout`,
3730
icon: IconLogout,
3831
onClick: (event: any) => {
3932
event.preventDefault();
4033
authClient.logout();
41-
localStorage.removeItem('token');
42-
window.location.href = '/auth/login';
43-
}
44-
}
34+
localStorage.removeItem("token");
35+
window.location.href = "/auth/login";
36+
},
37+
},
4538
];
4639

40+
if (!getConfig("VITE_HIDE_ABOUT_LINK")) {
41+
links.push({
42+
label: `About & Support`,
43+
icon: IconLifebuoy,
44+
onClick: openAboutModal,
45+
});
46+
}
47+
4748
return (
48-
<Menu shadow="md" width={200}>
49-
<Menu.Target>
50-
<UnstyledButton>
51-
<Avatar color={'pink'} radius="xl">
52-
{me
53-
? getInitials(me.first_name + ' ' + me.last_name)
54-
: '..'}
55-
</Avatar>
56-
</UnstyledButton>
57-
</Menu.Target>
49+
<>
50+
<Menu shadow="md" width={200}>
51+
<Menu.Target>
52+
<UnstyledButton>
53+
<Avatar color={"pink"} radius="xl">
54+
{me ? getInitials(me.first_name + " " + me.last_name) : ".."}
55+
</Avatar>
56+
</UnstyledButton>
57+
</Menu.Target>
5858

59-
<Menu.Dropdown>
60-
{links.map((link) => {
61-
return (
62-
<NavLink onClick={link.onClick} to={link.link ?? '#'} key={link.label}
63-
target={link.target ?? ''}>
64-
<Menu.Item component={'div'} leftSection={<link.icon/>}>{link.label}</Menu.Item>
59+
<Menu.Dropdown>
60+
{links.map((link) => (
61+
<NavLink
62+
onClick={link.onClick}
63+
to={link.link ?? "#"}
64+
key={link.label}
65+
target={link.target ?? ""}
66+
>
67+
<Menu.Item component={"div"} leftSection={<link.icon/>}>
68+
{link.label}
69+
</Menu.Item>
6570
</NavLink>
66-
);
67-
})}
68-
</Menu.Dropdown>
69-
</Menu>
71+
))}
72+
</Menu.Dropdown>
73+
</Menu>
74+
{aboutModalOpen && <AboutModal onClose={closeAboutModal}/>}
75+
</>
7076
);
71-
}
77+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.aboutIframe {
2+
width: 100%;
3+
border: none;
4+
margin: 0;
5+
padding: 0;
6+
overflow: hidden;
7+
position: absolute;
8+
top: 0;
9+
left: 0;
10+
z-index: 1;
11+
min-height: 500px;
12+
}
13+
14+
.aboutContainer {
15+
min-height: 500px;
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import {Modal} from "../../common/Modal";
2+
import {GenericModalProps} from "../../../types.ts";
3+
import classes from "./AboutModal.module.scss";
4+
5+
export const AboutModal = ({onClose}: GenericModalProps) => {
6+
return (
7+
<Modal onClose={onClose} opened>
8+
<div className={classes.aboutContainer}>
9+
<iframe src={'https://hi.' +
10+
'events/about-embedded'}
11+
className={classes.aboutIframe}
12+
title="About"
13+
allowFullScreen
14+
/>
15+
</div>
16+
</Modal>
17+
);
18+
}

0 commit comments

Comments
 (0)