Skip to content
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

[FC-0036] refactor: Further refinements to tag drawer #970

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/content-tags-drawer/ContentTagsCollapsible.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ const ContentTagsCollapsible = ({
<Collapsible.Visible whenOpen>
<Icon src={KeyboardArrowUp} />
</Collapsible.Visible>
<h4 className="flex-grow-1 pl-2">{name}</h4>
<h3 className="tags-drawer-taxonomy-name flex-grow-1 pl-2">{name}</h3>
</Collapsible.Trigger>

<Collapsible.Body className="collapsible-body">
Expand Down
38 changes: 20 additions & 18 deletions src/content-tags-drawer/ContentTagsDrawer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ const ContentTagsDrawer = ({ id, onClose }) => {

return (
<ContentTagsDrawerContext.Provider value={context}>
<div id="content-tags-drawer" className="mt-1 tags-drawer d-flex flex-column justify-content-between min-vh-100">
<div id="content-tags-drawer" className="mt-1 tags-drawer d-flex flex-column justify-content-between min-vh-100 pt-3">
<Container size="xl">
{ isContentDataLoaded
? <h2>{ contentName }</h2>
? <h2 className="tags-drawer-heading pl-2.5">{ contentName }</h2>
: (
<div className="d-flex justify-content-center align-items-center flex-column">
<Spinner
Expand All @@ -103,23 +103,25 @@ const ContentTagsDrawer = ({ id, onClose }) => {
/>
</div>
)}

<hr />
<p className="lead text-gray-500 font-weight-bold">{intl.formatMessage(messages.headerSubtitle)}</p>

{ isTaxonomyListLoaded && isContentTaxonomyTagsLoaded
? tagsByTaxonomy.map((data) => (
<div key={`taxonomy-tags-collapsible-${data.id}`}>
<ContentTagsCollapsible
contentId={contentId}
taxonomyAndTagsData={data}
stagedContentTags={stagedContentTags[data.id] || []}
collapsibleState={collapsibleStates[data.id] || false}
/>
<hr />
</div>
))
: <Loading />}
<Container>
<p className="tags-drawer-subtitle lead text-gray-500 font-weight-bold">
{intl.formatMessage(messages.headerSubtitle)}
</p>
{ isTaxonomyListLoaded && isContentTaxonomyTagsLoaded
? tagsByTaxonomy.map((data) => (
<div key={`taxonomy-tags-collapsible-${data.id}`}>
<ContentTagsCollapsible
contentId={contentId}
taxonomyAndTagsData={data}
stagedContentTags={stagedContentTags[data.id] || []}
collapsibleState={collapsibleStates[data.id] || false}
/>
<hr />
</div>
))
: <Loading />}
</Container>
</Container>

{ isTaxonomyListLoaded && isContentTaxonomyTagsLoaded && (
Expand Down
12 changes: 12 additions & 0 deletions src/content-tags-drawer/ContentTagsDrawer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
}

.tags-drawer {
.tags-drawer-heading {
font-size: 1.375rem !important;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the font size of h3, you can use the h3 class name to apply that style.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated: 6e959bb

}

.tags-drawer-footer {
right: 0;
bottom: 0;
Expand All @@ -18,6 +22,14 @@
background-color: transparent;
color: $gray-300 !important;
}

.tags-drawer-subtitle {
font-size: 1.125rem !important;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise you can use h4 as a class here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated 6e959bb

}

.tags-drawer-taxonomy-name {
font-size: .875rem !important;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this is h5

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated 6e959bb

}
}

// Apply styles to sheet only if it has a child with a .tags-drawer class
Expand Down
Loading