From de319c038cf932260dd4c00c84168e7ca6a9102a Mon Sep 17 00:00:00 2001 From: alexsparkes Date: Sun, 9 Jun 2024 10:13:32 +0100 Subject: [PATCH] refactor(switch): Use HeadlessUI --- .../MainModal/scss/marketplace/_main.scss | 29 ------------------- .../Form/Settings/Switch/Switch.jsx | 25 ++++++++++++++-- src/features/marketplace/views/Browse.jsx | 7 +++-- 3 files changed, 27 insertions(+), 34 deletions(-) diff --git a/src/components/Elements/MainModal/scss/marketplace/_main.scss b/src/components/Elements/MainModal/scss/marketplace/_main.scss index f6239c76..ce22eaf8 100644 --- a/src/components/Elements/MainModal/scss/marketplace/_main.scss +++ b/src/components/Elements/MainModal/scss/marketplace/_main.scss @@ -435,35 +435,6 @@ p.author { align-items: center; } -.marketplaceSearch { - display: flex; - align-items: center; - padding: 10px 30px; - border-radius: 10px; - font-size: 18px; - - @include themed { - 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'); diff --git a/src/components/Form/Settings/Switch/Switch.jsx b/src/components/Form/Settings/Switch/Switch.jsx index 006388d3..4fdb7499 100644 --- a/src/components/Form/Settings/Switch/Switch.jsx +++ b/src/components/Form/Settings/Switch/Switch.jsx @@ -1,6 +1,7 @@ import variables from 'config/variables'; import { PureComponent } from 'react'; -import { Switch as SwitchUI, FormControlLabel } from '@mui/material'; +//import { Switch as SwitchUI, FormControlLabel } from '@mui/material'; +import { Field, Label, Switch as SwitchUI } from '@headlessui/react'; import EventBus from 'utils/eventbus'; @@ -41,7 +42,8 @@ class Switch extends PureComponent { render() { return ( - + />*/ + }, + ( + + + + {' '} + + + ) ); } } diff --git a/src/features/marketplace/views/Browse.jsx b/src/features/marketplace/views/Browse.jsx index ed756f4e..cd58b8f6 100644 --- a/src/features/marketplace/views/Browse.jsx +++ b/src/features/marketplace/views/Browse.jsx @@ -392,7 +392,7 @@ class Marketplace extends PureComponent {
{this.props.type !== 'collections' && (
-
+ this.setState({ filter: event.target.value })} + className="block w-full px-4 py-3 ps-10 text-sm text-gray-900 border border-[#484848] rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-white/5 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-neutral-100" /> - +
+ +
)}