From 482095ca6594e80d147ac048e2ad051da1b7b7db Mon Sep 17 00:00:00 2001 From: alexsparkes Date: Tue, 18 Oct 2022 18:11:23 +0100 Subject: [PATCH] fix: marketplace + more - Fix clock zoom - Fix 0th birthday bug - marketplace search style - marketplace search not sensitive to case --- .../modals/main/marketplace/Items.jsx | 58 +++++++++++++------ .../main/marketplace/sections/Marketplace.jsx | 3 +- src/components/modals/main/scss/index.scss | 1 + .../modals/main/scss/marketplace/_main.scss | 29 ++++++++++ .../modals/main/tabs/backend/Tabs.jsx | 2 +- src/components/widgets/greeting/Greeting.jsx | 2 +- src/components/widgets/time/Clock.jsx | 1 + 7 files changed, 76 insertions(+), 20 deletions(-) diff --git a/src/components/modals/main/marketplace/Items.jsx b/src/components/modals/main/marketplace/Items.jsx index aeb31c0c..9fb8c842 100644 --- a/src/components/modals/main/marketplace/Items.jsx +++ b/src/components/modals/main/marketplace/Items.jsx @@ -6,6 +6,10 @@ import { MdOutlineArrowForward, MdExpandMore, MdOutlineOpenInNew, + MdOutlinePhoto as Background, + MdOutlineFormatQuote as Quote, + MdOutlineSettings as Advanced, + MdSearch, } from 'react-icons/md'; export default function Items({ @@ -18,6 +22,8 @@ export default function Items({ }) { const [count, setCount] = useState(8); const [filter, setFilter] = useState(''); + const [cheese, setCheese] = useState('photo') + const [filteredCategory, setFilteredCategory] = useState(''); const incrementCount = () => { if (count !== items.length && count <= items.length) { if (count + 8 > items.length) { @@ -32,9 +38,18 @@ export default function Items({ <> {(type === 'all' && !onCollection) || (type === 'collections' && !onCollection) ? ( <> - setFilter(event.target.value)}/> - +
+
+ setFilter(event.target.value)} + /> + + +
) : null} -
- {items.filter(item => item.name.includes(filter) || filter === '') - .map(item =>
toggleFunction(item)} key={item.name}> - icon -
- {item.display_name || item.name} - {item.author} -
-
)} -
+
+ {items + .filter( + (item) => + item.name.toLowerCase().includes(filter.toLowerCase()) || + filter === '' || + item.author.toLowerCase().includes(filter.toLowerCase()) || + item.type.toLowerCase().includes(filter.toLowerCase() || cheese), + ) + .map((item) => ( +
toggleFunction(item)} key={item.name}> + icon +
+ {item.display_name || item.name} + {item.author} +
+
+ ))} +
{/*
{items.slice(0, count).map((item) => (
toggleFunction(item)} key={item.name}> diff --git a/src/components/modals/main/marketplace/sections/Marketplace.jsx b/src/components/modals/main/marketplace/sections/Marketplace.jsx index 2793bf0c..0bbdef3b 100644 --- a/src/components/modals/main/marketplace/sections/Marketplace.jsx +++ b/src/components/modals/main/marketplace/sections/Marketplace.jsx @@ -1,4 +1,5 @@ import variables from 'modules/variables'; +import TextField from '@mui/material/TextField'; import { PureComponent } from 'react'; import { toast } from 'react-toastify'; import { @@ -366,7 +367,7 @@ export default class Marketplace extends PureComponent { -
+
)} {this.props.type === 'collections' && !this.state.collection ? ( diff --git a/src/components/modals/main/scss/index.scss b/src/components/modals/main/scss/index.scss index 1663cd87..942adaef 100644 --- a/src/components/modals/main/scss/index.scss +++ b/src/components/modals/main/scss/index.scss @@ -158,6 +158,7 @@ h5 { align-items: center; } + .languageSettings { margin-bottom: 15px; .MuiFormGroup-root { diff --git a/src/components/modals/main/scss/marketplace/_main.scss b/src/components/modals/main/scss/marketplace/_main.scss index 729d9a6e..1a2626c0 100644 --- a/src/components/modals/main/scss/marketplace/_main.scss +++ b/src/components/modals/main/scss/marketplace/_main.scss @@ -461,6 +461,34 @@ a.collectionButton { } } +.marketplaceSearch { + display: flex; + align-items: center; + padding: 10px 30px; + border-radius: 10px; + font-size: 16px; + @include themed() { + background: t($modal-sidebarActive); + box-shadow: 0 0 0 3px t($modal-sidebarActive); + background: t($modal-sidebar); + } + input { + all: unset; + } + @include themed() { + + &:focus-within { + background: t($modal-sidebarActive); + box-shadow: 0 0 0 1px t($color); + } + + &:disabled { + background: t($modal-sidebarActive); + cursor: not-allowed; + } +} +} + .inCollection { background-image: linear-gradient(to left, transparent, #000), url('https://external-preview.redd.it/JyhsEoGMhKIMi3kvfBS24L0IllAO_KrIm4UI-dA1Ax4.jpg?auto=webp&s=b5adf9859b2c1855a5b3085f9453a6e878548505'); @@ -485,3 +513,4 @@ a.collectionButton { font-size: 30px; } } + diff --git a/src/components/modals/main/tabs/backend/Tabs.jsx b/src/components/modals/main/tabs/backend/Tabs.jsx index e3e2342c..30a380c8 100644 --- a/src/components/modals/main/tabs/backend/Tabs.jsx +++ b/src/components/modals/main/tabs/backend/Tabs.jsx @@ -59,7 +59,7 @@ export default class Tabs extends PureComponent { return (
-
    +
      {this.props.children.map((tab, index) => (