-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
✨ Add new pages, components, panels, modals, and theme; refactor and improvements in existing components #593
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
5b9e0dd
Add main pages and modals
alejsdev f89fc24
Add panels for User Settings
alejsdev b014f92
Add theme, ChakraProvider and main components to
alejsdev 95e0134
Add Navbar component
alejsdev 2413c60
Sidebar update
alejsdev 60e897a
Login improvements
alejsdev 3779417
UserInfo refactor
alejsdev 8ebbc1d
Remove console.log
alejsdev b767b09
Rename prop in ActionsMenu
alejsdev 02eaa6a
Update CreateUser modal
alejsdev 3ffaeec
Add TODO
alejsdev 00e310c
Update src/new-frontend/src/pages/main/Items.tsx
alejsdev b98ab24
Update src/new-frontend/src/pages/auth/Login.tsx
alejsdev db2032d
Update src/new-frontend/src/pages/panels/Appearance.tsx
alejsdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,39 @@ | ||
import React from 'react'; | ||
|
||
import { Button, Menu, MenuButton, MenuItem, MenuList, useDisclosure } from '@chakra-ui/react'; | ||
import { BsThreeDotsVertical } from 'react-icons/bs'; | ||
import { FiTrash, FiEdit } from 'react-icons/fi'; | ||
|
||
import Delete from '../pages/modals/DeleteAlert'; | ||
import EditUser from '../pages/modals/EditUser'; | ||
import EditItem from '../pages/modals/EditItem'; | ||
|
||
interface ActionsMenuProps { | ||
type: string; | ||
id: number; | ||
} | ||
|
||
const ActionsMenu: React.FC<ActionsMenuProps> = ({ type, id }) => { | ||
const editUserModal = useDisclosure(); | ||
const deleteModal = useDisclosure(); | ||
|
||
return ( | ||
<> | ||
<Menu> | ||
<MenuButton as={Button} bg="white" rightIcon={<BsThreeDotsVertical />} variant="unstyled"> | ||
</MenuButton> | ||
<MenuList> | ||
<MenuItem onClick={editUserModal.onOpen} icon={<FiEdit fontSize="16px" />}>Edit {type}</MenuItem> | ||
<MenuItem onClick={deleteModal.onOpen} icon={<FiTrash fontSize="16px" />} color="ui.danger">Delete {type}</MenuItem> | ||
</MenuList> | ||
{ | ||
type === "User" ? <EditUser isOpen={editUserModal.isOpen} onClose={editUserModal.onClose} /> | ||
: <EditItem isOpen={editUserModal.isOpen} onClose={editUserModal.onClose} /> | ||
} | ||
<Delete type={type} id={id} isOpen={deleteModal.isOpen} onClose={deleteModal.onClose} /> | ||
</Menu> | ||
</> | ||
); | ||
}; | ||
|
||
export default ActionsMenu; |
This file contains hidden or 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,30 @@ | ||
import React from 'react'; | ||
|
||
import { Button, Flex, Icon, useDisclosure } from '@chakra-ui/react'; | ||
import { FaPlus } from "react-icons/fa"; | ||
|
||
import CreateItem from '../pages/modals/CreateItem'; | ||
import CreateUser from '../pages/modals/CreateUser'; | ||
|
||
interface NavbarProps { | ||
type: string; | ||
} | ||
|
||
const Navbar: React.FC<NavbarProps> = ({ type }) => { | ||
const createUserModal = useDisclosure(); | ||
const createItemModal = useDisclosure(); | ||
|
||
return ( | ||
<> | ||
<Flex gap={4} py={{ base: "8", md: "4" }} justify={{ base: "center", md: "end" }}> | ||
<Button bg="ui.main" color="white" gap={1} fontSize={{ base: "sm", md: "inherit" }} onClick={type === "User" ? createUserModal.onOpen : createItemModal.onOpen}> | ||
<Icon as={FaPlus} /> Create {type} | ||
</Button> | ||
<CreateUser isOpen={createUserModal.isOpen} onClose={createUserModal.onClose} /> | ||
<CreateItem isOpen={createItemModal.isOpen} onClose={createItemModal.onClose} /> | ||
</Flex> | ||
</> | ||
); | ||
}; | ||
|
||
export default Navbar; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.