-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Right drawer to edit records #5551
Changes from 24 commits
12cc126
bcd26ad
79d6732
b2cf04b
98ea5fa
3f4ca28
ec11e45
dc5df24
c144747
a8dac2b
3ec0298
f061741
ae5cf01
3ea22e9
33465fe
a5016c9
32cfd54
0289968
ccf60c0
0efd78e
62d858a
684334b
6b67ade
8674e61
5059239
89df595
1941b50
51b5c92
1b210a2
0b7bd6c
2aa2795
337a1fc
09cd6ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import styled from '@emotion/styled'; | ||
import { IconMail, Tag } from 'twenty-ui'; | ||
|
||
import { beautifyPastDateRelativeToNow } from '~/utils/date-utils'; | ||
Comment on lines
1
to
3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider removing unused imports to keep the code clean. |
||
|
||
|
@@ -43,7 +42,6 @@ export const EmailThreadHeader = ({ | |
}: EmailThreadHeaderProps) => { | ||
return ( | ||
<StyledContainer> | ||
<Tag Icon={IconMail} color="gray" text="Email" onClick={() => {}} /> | ||
<StyledHead> | ||
<StyledHeading>{subject}</StyledHeading> | ||
<StyledContent> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { useRecoilCallback } from 'recoil'; | ||
|
||
import { useOpenEmailThreadRightDrawer } from '@/activities/emails/right-drawer/hooks/useOpenEmailThreadRightDrawer'; | ||
import { viewableEmailThreadIdState } from '@/activities/emails/states/viewableEmailThreadIdState'; | ||
import { viewableRecordIdState } from '@/object-record/record-right-drawer/states/viewableRecordIdState'; | ||
import { useRightDrawer } from '@/ui/layout/right-drawer/hooks/useRightDrawer'; | ||
import { isRightDrawerOpenState } from '@/ui/layout/right-drawer/states/isRightDrawerOpenState'; | ||
|
||
export const useEmailThread = () => { | ||
const { closeRightDrawer } = useRightDrawer(); | ||
const openEmailThredRightDrawer = useOpenEmailThreadRightDrawer(); | ||
const openEmailThreadRightDrawer = useOpenEmailThreadRightDrawer(); | ||
|
||
const openEmailThread = useRecoilCallback( | ||
({ snapshot, set }) => | ||
|
@@ -17,19 +17,19 @@ export const useEmailThread = () => { | |
.getValue(); | ||
|
||
const viewableEmailThreadId = snapshot | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. viewableRecordId |
||
.getLoadable(viewableEmailThreadIdState) | ||
.getLoadable(viewableRecordIdState) | ||
.getValue(); | ||
|
||
if (isRightDrawerOpen && viewableEmailThreadId === threadId) { | ||
set(viewableEmailThreadIdState, null); | ||
set(viewableRecordIdState, null); | ||
closeRightDrawer(); | ||
return; | ||
} | ||
|
||
openEmailThredRightDrawer(); | ||
set(viewableEmailThreadIdState, threadId); | ||
openEmailThreadRightDrawer(); | ||
set(viewableRecordIdState, threadId); | ||
}, | ||
[closeRightDrawer, openEmailThredRightDrawer], | ||
[closeRightDrawer, openEmailThreadRightDrawer], | ||
); | ||
|
||
return { openEmailThread }; | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider renaming
setViewableCalendarEventId
tosetViewableRecordId
for consistency.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes