-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
19d1052
commit 3dc4cf7
Showing
19 changed files
with
549 additions
and
47 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
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
93 changes: 93 additions & 0 deletions
93
src/screens/private/Home/TopBar/LeftSideComponents/Apple.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,93 @@ | ||
import { AppleIcon } from '@assets'; | ||
import { Menu, MenuDivider } from '@chakra-ui/react'; | ||
import { | ||
MenuItemComponent, | ||
MenuListComponent, | ||
TopBarButton, | ||
} from '@components'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
const Apple = () => { | ||
const { t } = useTranslation(); | ||
return ( | ||
<Menu> | ||
<TopBarButton | ||
text="" | ||
onClick={() => {}} | ||
ariaLabel="apple-top-bar-button" | ||
icon={<AppleIcon width="1.5em" height="1.5em" color="white" />} | ||
/> | ||
<MenuListComponent> | ||
<MenuItemComponent | ||
text={t('TopAppBar.apple.aboutThisMac')} | ||
ariaLabel="about-this-mac" | ||
onClick={() => {}} | ||
side="left" | ||
/> | ||
<MenuDivider p={0} m={0.5} /> | ||
<MenuItemComponent | ||
text={t('TopAppBar.apple.systemSettings')} | ||
ariaLabel="system-settings" | ||
onClick={() => {}} | ||
side="left" | ||
/> | ||
<MenuItemComponent | ||
text={t('TopAppBar.apple.appStore')} | ||
ariaLabel="app-store" | ||
onClick={() => {}} | ||
side="left" | ||
/> | ||
<MenuDivider p={0} m={0.5} /> | ||
<MenuItemComponent | ||
text={t('TopAppBar.apple.recentItems')} | ||
ariaLabel="recent-items" | ||
onClick={() => {}} | ||
command=">" | ||
side="left" | ||
/> | ||
<MenuDivider p={0} m={0.5} /> | ||
<MenuItemComponent | ||
text={t('TopAppBar.apple.forceQuit')} | ||
ariaLabel="force-quit" | ||
onClick={() => {}} | ||
side="left" | ||
command="" | ||
/> | ||
<MenuDivider p={0} m={0.5} /> | ||
<MenuItemComponent | ||
text={t('TopAppBar.apple.sleep')} | ||
ariaLabel="sleep" | ||
side="left" | ||
onClick={() => {}} | ||
/> | ||
<MenuItemComponent | ||
text={t('TopAppBar.apple.restart')} | ||
ariaLabel="restart" | ||
side="left" | ||
onClick={() => {}} | ||
/> | ||
<MenuItemComponent | ||
text={t('TopAppBar.apple.shutDown')} | ||
ariaLabel="shutDown" | ||
side="left" | ||
onClick={() => {}} | ||
/> | ||
<MenuDivider p={0} m={0.5} /> | ||
<MenuItemComponent | ||
text={t('TopAppBar.apple.lockScreen')} | ||
ariaLabel="lock-screen" | ||
side="left" | ||
onClick={() => {}} | ||
/> | ||
<MenuItemComponent | ||
text={t('TopAppBar.apple.logOut', { userName: 'Amit Raikwar' })} | ||
ariaLabel="logout" | ||
side="left" | ||
onClick={() => {}} | ||
/> | ||
</MenuListComponent> | ||
</Menu> | ||
); | ||
}; | ||
|
||
export default Apple; |
18 changes: 18 additions & 0 deletions
18
src/screens/private/Home/TopBar/LeftSideComponents/__Tests__/Apple.test.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,18 @@ | ||
import { fireEvent, render, screen } from '@testing-library/react'; | ||
import Apple from '../Apple'; | ||
|
||
describe('Apple', () => { | ||
it('Should render apple button correctly', () => { | ||
const { container } = render(<Apple />); | ||
|
||
expect(container).toMatchSnapshot(); | ||
}); | ||
|
||
it('Should render apple menu correctly', () => { | ||
const { container } = render(<Apple />); | ||
|
||
fireEvent.click(screen.getByLabelText('apple-top-bar-button')); | ||
|
||
expect(container).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.