Skip to content

Commit

Permalink
fixing TileBadge styling
Browse files Browse the repository at this point in the history
  • Loading branch information
mbogo-mit committed Nov 26, 2023
1 parent c9eea69 commit c6c495f
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 5 deletions.
8 changes: 8 additions & 0 deletions src/components/CreateEditDocument/CreateEditDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -1602,9 +1602,13 @@ const CreateEditDocument = ({
key={gid}
text={groupsShared.core[gid]?.name}
fontSize={14}
maxHeight={30}
textLineHeight="14px"
display="flex"
color="blue"
onDelete={() => deleteGroup(gid)}
marginRight={6}
marginBottom={4}
/>
),
)}
Expand All @@ -1627,9 +1631,13 @@ const CreateEditDocument = ({
key={gid}
text={groupsShared.contributions[gid]?.name}
fontSize={14}
maxHeight={30}
textLineHeight="14px"
display="flex"
color="blue"
onDelete={() => deleteGroup(gid)}
marginRight={6}
marginBottom={4}
/>
),
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@
}

.groupShareContainer {
display: flex;
flex-wrap: wrap;
border-radius: 4px;
border: 1px solid #CDCEDA;
background-color: #f9f9f9;
Expand Down
2 changes: 1 addition & 1 deletion src/components/DashboardChannels/IdeaSpaceTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default function IdeaSpaceTile({
<TileBadge
key="existingAnnotationsText"
color="red"
maxWidth={300}
maxTextWidth={300}
text={existingText}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/DashboardChannels/IdeaSpacesChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export default function IdeaSpacesChannel({
<TileBadge
key="existingAnnotationsText"
color="red"
maxWidth={300}
maxTextWidth={300}
text={existingText}
/>
);
Expand Down
9 changes: 7 additions & 2 deletions src/components/TileBadge/TileBadge.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export default function TileBadge({
marginLeft = 0,
marginBottom = 0,
marginRight = 0,
maxWidth = 200,
maxTextWidth = 200,
maxHeight,
textLineHeight,
display,
href,
fontSize = 10,
icon,
Expand Down Expand Up @@ -94,12 +97,14 @@ export default function TileBadge({
cursor: 'default',
alignItems: 'center',
justifyContent: 'center',
maxHeight,
display,
}}
>
{icon}
<span
className={styles.tileBadgeText}
style={{ maxWidth }}
style={{ maxWidth: maxTextWidth, lineHeight: textLineHeight }}
>
{text}
</span>
Expand Down
1 change: 1 addition & 0 deletions src/components/TileBadge/TileBadge.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: inline-block;
}

.draggableTileBadge {
Expand Down
4 changes: 3 additions & 1 deletion src/pages/documents/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ const DocumentsIndex = ({
key={`group-tile-badge-${id}`}
color="grey"
marginRight={5}
marginBottom={4}
maxHeight={25}
text={groupNamesObj[id]}
/>
) : <></>
Expand Down Expand Up @@ -489,7 +491,7 @@ const DocumentsIndex = ({
},
},
{ content: contributorsListToContributorsContent(contributors) || '-', style: { color: '#86919D' } },
{ content: groupsToTileBadges(groups) || '-', style: { color: '#86919D' } },
{ content: groupsToTileBadges(groups) || '-', style: { display: 'flex', flexWrap: 'wrap', color: '#86919D' } },
{ content: state || '-', style: { color: '#86919D' } },
{
content: (createdAt && (
Expand Down

0 comments on commit c6c495f

Please sign in to comment.