-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ Implement multiple user creation flow
Added a new screen to enhance the user creation experience. This screen appears immediately after you create a new user. On this page, you have two options: you can either complete the process and view the user you just created, or you can return to the form to create another user without exiting the contextual bar. Additionally, I've made some minor logic improvements and removed commented-out code.
- Loading branch information
Showing
4 changed files
with
64 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Button, ButtonGroup, ContextualbarFooter } from '@rocket.chat/fuselage'; | ||
import { useRouter, useTranslation } from '@rocket.chat/ui-contexts'; | ||
import React, { useCallback } from 'react'; | ||
|
||
import { ContextualbarScrollableContent } from '../../../components/Contextualbar'; | ||
|
||
const AdminUserCreated = ({ uid }: { uid: string }) => { | ||
const t = useTranslation(); | ||
const router = useRouter(); | ||
|
||
const goToUser = useCallback((id) => router.navigate(`/admin/users/info/${id}`), [router]); | ||
|
||
return ( | ||
<> | ||
<ContextualbarScrollableContent h='100%' fontScale='p1m'> | ||
{t('You_have_created_one_user')} | ||
</ContextualbarScrollableContent> | ||
<ContextualbarFooter> | ||
<ButtonGroup stretch> | ||
<Button type='reset' w='50%' onClick={() => router.navigate(`/admin/users/new`)}> | ||
{t('Add_more_users')} | ||
</Button> | ||
<Button primary w='50%' onClick={() => goToUser(uid)}> | ||
{t('Done')} | ||
</Button> | ||
</ButtonGroup> | ||
</ContextualbarFooter> | ||
</> | ||
); | ||
}; | ||
|
||
export default AdminUserCreated; |
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