Skip to content

Commit

Permalink
fix style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Melisa Anabella Rossi committed May 3, 2024
1 parent 725c5eb commit 28957c0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.CollectionCard .content {
margin-top: 16px;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}

.CollectionCard .content .text {
Expand Down
10 changes: 7 additions & 3 deletions src/components/CollectionsPage/CollectionsPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,15 @@
}

.CollectionsPage .collections-main-actions {
display: grid;
grid-template-columns: 1fr 310px;
display: flex;
gap: 20px;
margin-top: 20px;
}

.CollectionsPage .collections-main-actions > :first-child {
flex: 1;
}

.CollectionsPage .dcl.field .collections-search-field.ui.input input {
padding: 8px;
background: var(--shadows);
Expand All @@ -193,7 +196,8 @@
font-size: 16px;
}

.CollectionsPage .collections-main-actions .actions {
.CollectionsPage .collections-main-actions > .actions {
align-self: baseline;
justify-self: end;
flex: none;
}
35 changes: 17 additions & 18 deletions src/components/CollectionsPage/CollectionsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import CollectionRow from './CollectionRow'
import { Props, TABS } from './CollectionsPage.types'
import './CollectionsPage.css'

let timeout: NodeJS.Timeout
const PAGE_SIZE = 20
export const LOCALSTORAGE_EMOTES_V2_ANNOUCEMENT = 'builder-emotes-2.0-announcement'
export default class CollectionsPage extends React.PureComponent<Props> {
Expand All @@ -45,6 +44,8 @@ export default class CollectionsPage extends React.PureComponent<Props> {
search: ''
}

timeout: ReturnType<typeof setTimeout> | undefined = undefined

componentDidMount() {
const { address, hasUserOrphanItems, onFetchCollections, onFetchOrphanItem, onOpenModal } = this.props
// fetch if already connected
Expand Down Expand Up @@ -85,10 +86,10 @@ export default class CollectionsPage extends React.PureComponent<Props> {
handleSearchChange = (_evt: React.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => {
const { onFetchCollections, address } = this.props
this.setState({ search: data.value })
if (timeout) {
clearTimeout(timeout)
if (this.timeout) {
clearTimeout(this.timeout)
}
timeout = setTimeout(() => {
this.timeout = setTimeout(() => {
onFetchCollections(address, { page: 1, limit: PAGE_SIZE, q: data.value })
}, 500)
}
Expand Down Expand Up @@ -216,7 +217,7 @@ export default class CollectionsPage extends React.PureComponent<Props> {
value={search}
isClearable
/>
<Row className="actions">
<Row className="actions" grow={false}>
{isThirdPartyManager && (
<Button className="action-button" size="small" basic onClick={this.handleNewThirdPartyCollection}>
{t('collections_page.new_third_party_collection')}
Expand Down Expand Up @@ -298,19 +299,17 @@ export default class CollectionsPage extends React.PureComponent<Props> {
<EventBanner />
<div className="filters">
<Container>
<Tabs isFullscreen>
{hasUserOrphanItems && (
// TODO: Remove tabs when there are no users with orphan items
<>
<Tabs.Tab active={this.isCollectionTabActive()} onClick={() => this.handleTabChange(TABS.COLLECTIONS)}>
{t('collections_page.collections')}
</Tabs.Tab>
<Tabs.Tab active={!this.isCollectionTabActive()} onClick={() => this.handleTabChange(TABS.ITEMS)}>
{t('collections_page.single_items')}
</Tabs.Tab>
</>
)}
</Tabs>
{hasUserOrphanItems && (
// TODO: Remove tabs when there are no users with orphan items
<Tabs isFullscreen>
<Tabs.Tab active={this.isCollectionTabActive()} onClick={() => this.handleTabChange(TABS.COLLECTIONS)}>
{t('collections_page.collections')}
</Tabs.Tab>
<Tabs.Tab active={!this.isCollectionTabActive()} onClick={() => this.handleTabChange(TABS.ITEMS)}>
{t('collections_page.single_items')}
</Tabs.Tab>
</Tabs>
)}
{this.renderMainActions()}
<Row height={30}>
<Column>
Expand Down

0 comments on commit 28957c0

Please sign in to comment.