-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: apply RecordDetailSection style on RecordDuplicatesSection and …
…add stories Closes #4240
- Loading branch information
1 parent
bc11cf8
commit 4eb0885
Showing
28 changed files
with
395 additions
and
240 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
12 changes: 2 additions & 10 deletions
12
packages/twenty-front/src/modules/activities/tasks/__stories__/TaskList.stories.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
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
37 changes: 37 additions & 0 deletions
37
...ect-record/record-show/record-detail-section/components/RecordDetailDuplicatesSection.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,37 @@ | ||
import { RecordChip } from '@/object-record/components/RecordChip'; | ||
import { useFindDuplicateRecords } from '@/object-record/hooks/useFindDuplicateRecords'; | ||
import { RecordDetailRecordsList } from '@/object-record/record-show/record-detail-section/components/RecordDetailRecordsList'; | ||
import { RecordDetailRecordsListItem } from '@/object-record/record-show/record-detail-section/components/RecordDetailRecordsListItem'; | ||
import { RecordDetailSection } from '@/object-record/record-show/record-detail-section/components/RecordDetailSection'; | ||
import { RecordDetailSectionHeader } from '@/object-record/record-show/record-detail-section/components/RecordDetailSectionHeader'; | ||
|
||
export const RecordDetailDuplicatesSection = ({ | ||
objectRecordId, | ||
objectNameSingular, | ||
}: { | ||
objectRecordId: string; | ||
objectNameSingular: string; | ||
}) => { | ||
const { records: duplicateRecords } = useFindDuplicateRecords({ | ||
objectRecordId, | ||
objectNameSingular, | ||
}); | ||
|
||
if (!duplicateRecords.length) return null; | ||
|
||
return ( | ||
<RecordDetailSection> | ||
<RecordDetailSectionHeader title="Duplicates" /> | ||
<RecordDetailRecordsList> | ||
{duplicateRecords.slice(0, 5).map((duplicateRecord) => ( | ||
<RecordDetailRecordsListItem key={duplicateRecord.id}> | ||
<RecordChip | ||
record={duplicateRecord} | ||
objectNameSingular={objectNameSingular} | ||
/> | ||
</RecordDetailRecordsListItem> | ||
))} | ||
</RecordDetailRecordsList> | ||
</RecordDetailSection> | ||
); | ||
}; |
8 changes: 8 additions & 0 deletions
8
...es/object-record/record-show/record-detail-section/components/RecordDetailRecordsList.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,8 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
const StyledRecordsList = styled.div` | ||
color: ${({ theme }) => theme.font.color.secondary}; | ||
overflow: hidden; | ||
`; | ||
|
||
export { StyledRecordsList as RecordDetailRecordsList }; |
11 changes: 11 additions & 0 deletions
11
...bject-record/record-show/record-detail-section/components/RecordDetailRecordsListItem.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,11 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
const StyledListItem = styled.div` | ||
align-items: center; | ||
justify-content: space-between; | ||
gap: ${({ theme }) => theme.spacing(1)}; | ||
display: flex; | ||
height: ${({ theme }) => theme.spacing(10)}; | ||
`; | ||
|
||
export { StyledListItem as RecordDetailRecordsListItem }; |
20 changes: 20 additions & 0 deletions
20
...t-record/record-show/record-detail-section/components/RecordDetailRelationRecordsList.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,20 @@ | ||
import { RecordDetailRecordsList } from '@/object-record/record-show/record-detail-section/components/RecordDetailRecordsList'; | ||
import { RecordDetailRelationRecordsListItem } from '@/object-record/record-show/record-detail-section/components/RecordDetailRelationRecordsListItem'; | ||
import { ObjectRecord } from '@/object-record/types/ObjectRecord'; | ||
|
||
type RecordDetailRelationRecordsListProps = { | ||
relationRecords: ObjectRecord[]; | ||
}; | ||
|
||
export const RecordDetailRelationRecordsList = ({ | ||
relationRecords, | ||
}: RecordDetailRelationRecordsListProps) => ( | ||
<RecordDetailRecordsList> | ||
{relationRecords.slice(0, 5).map((relationRecord) => ( | ||
<RecordDetailRelationRecordsListItem | ||
key={relationRecord.id} | ||
relationRecord={relationRecord} | ||
/> | ||
))} | ||
</RecordDetailRecordsList> | ||
); |
Oops, something went wrong.