-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨(frontend) add tabs for mail domain page
Currently, it is complicated to understand the navigation between mailbox management and role management for an email domain. This is why we add tabs with explicit naming
- Loading branch information
1 parent
6a22169
commit f853083
Showing
14 changed files
with
958 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
src/frontend/apps/desk/src/features/mail-domains/view/components/MailDomainView.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import * as React from 'react'; | ||
import { Tab, TabList, TabPanel, Tabs } from 'react-aria-components'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import { Box, Text } from '@/components'; | ||
import { AccessesContent } from '@/features/mail-domains/access-management'; | ||
import MailDomainsLogo from '@/features/mail-domains/assets/mail-domains-logo.svg'; | ||
import { MailDomain, Role } from '@/features/mail-domains/domains'; | ||
import { MailDomainsContent } from '@/features/mail-domains/mailboxes'; | ||
|
||
type Props = { | ||
mailDomain: MailDomain; | ||
}; | ||
export const MailDomainView = ({ mailDomain }: Props) => { | ||
const { t } = useTranslation(); | ||
const currentRole = mailDomain.abilities.delete | ||
? Role.OWNER | ||
: mailDomain.abilities.manage_accesses | ||
? Role.ADMIN | ||
: Role.VIEWER; | ||
|
||
return ( | ||
<Box $padding="big"> | ||
<Box | ||
$width="100%" | ||
$direction="row" | ||
$align="center" | ||
$gap="2.25rem" | ||
$justify="center" | ||
> | ||
<Box | ||
$direction="row" | ||
$justify="center" | ||
$margin={{ bottom: 'big' }} | ||
$gap="0.5rem" | ||
> | ||
<MailDomainsLogo aria-hidden="true" /> | ||
<Text $margin="none" as="h3" $size="h3"> | ||
{mailDomain?.name} | ||
</Text> | ||
</Box> | ||
</Box> | ||
<Tabs> | ||
<TabList aria-label="History of Ancient Rome"> | ||
<Tab aria-label={t('Go to mailbox management')} id="mails"> | ||
<Box $direction="row" $align="center" $gap="5px"> | ||
<span className="material-icons" aria-hidden="true"> | ||
</span> | ||
{t('Mailbox management')} | ||
</Box> | ||
</Tab> | ||
<Tab aria-label={t('Go to accesses management')} id="accesses"> | ||
<Box $direction="row" $align="center" $gap="5px"> | ||
<span className="material-icons" aria-hidden="true"> | ||
people | ||
</span> | ||
{t('Access management')} | ||
</Box> | ||
</Tab> | ||
</TabList> | ||
|
||
<TabPanel id="mails"> | ||
<MailDomainsContent mailDomain={mailDomain} /> | ||
</TabPanel> | ||
<TabPanel id="accesses"> | ||
<AccessesContent mailDomain={mailDomain} currentRole={currentRole} /> | ||
</TabPanel> | ||
</Tabs> | ||
</Box> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
@import url('../cunningham/cunningham-style.css'); | ||
@import url('../styles/tabs.css'); | ||
|
||
body { | ||
margin: 0; | ||
|
Oops, something went wrong.