mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
update ui components for mobile (#1495)
* fix mobile layout for filter buttons * fix tabs component mobile view * fix zoom in on input focus on mobile devices * reduce searchbar font-size
This commit is contained in:
parent
8396b705d3
commit
8249ff1397
src/components
@shared/atoms/Tabs
Header
Search
@ -1,14 +1,20 @@
|
|||||||
|
.tabListContainer {
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
border-bottom: 1px solid var(--border-color);
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.tabList {
|
.tabList {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-bottom: 1px solid var(--border-color);
|
|
||||||
padding: calc(var(--spacer) / 2);
|
padding: calc(var(--spacer) / 2);
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab {
|
.tab {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: calc(var(--spacer) / 8) var(--spacer);
|
padding: calc(var(--spacer) / 8) calc(var(--spacer) / 2);
|
||||||
font-weight: var(--font-weight-bold);
|
font-weight: var(--font-weight-bold);
|
||||||
font-size: var(--font-size-small);
|
font-size: var(--font-size-small);
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
@ -16,7 +22,6 @@
|
|||||||
background-color: var(--background-body);
|
background-color: var(--background-body);
|
||||||
border: 1px solid var(--border-color);
|
border: 1px solid var(--border-color);
|
||||||
margin-right: -1px;
|
margin-right: -1px;
|
||||||
min-width: 90px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab,
|
.tab,
|
||||||
@ -27,11 +32,13 @@
|
|||||||
.tab:first-child {
|
.tab:first-child {
|
||||||
border-top-left-radius: var(--border-radius);
|
border-top-left-radius: var(--border-radius);
|
||||||
border-bottom-left-radius: var(--border-radius);
|
border-bottom-left-radius: var(--border-radius);
|
||||||
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab:last-child {
|
.tab:last-child {
|
||||||
border-top-right-radius: var(--border-radius);
|
border-top-right-radius: var(--border-radius);
|
||||||
border-bottom-right-radius: var(--border-radius);
|
border-bottom-right-radius: var(--border-radius);
|
||||||
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab[aria-selected='true'] {
|
.tab[aria-selected='true'] {
|
||||||
@ -58,6 +65,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (min-width: 60rem) {
|
||||||
|
.tab {
|
||||||
|
padding: calc(var(--spacer) / 8) var(--spacer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.radio {
|
.radio {
|
||||||
composes: radio from '../../FormInput/InputRadio.module.css';
|
composes: radio from '../../FormInput/InputRadio.module.css';
|
||||||
}
|
}
|
||||||
|
@ -26,12 +26,15 @@ export default function Tabs({
|
|||||||
}: TabsProps): ReactElement {
|
}: TabsProps): ReactElement {
|
||||||
return (
|
return (
|
||||||
<ReactTabs className={`${className || ''}`} defaultIndex={defaultIndex}>
|
<ReactTabs className={`${className || ''}`} defaultIndex={defaultIndex}>
|
||||||
|
<div className={styles.tabListContainer}>
|
||||||
<TabList className={styles.tabList}>
|
<TabList className={styles.tabList}>
|
||||||
{items.map((item, index) => (
|
{items.map((item, index) => (
|
||||||
<Tab
|
<Tab
|
||||||
className={styles.tab}
|
className={styles.tab}
|
||||||
key={index}
|
key={index}
|
||||||
onClick={handleTabChange ? () => handleTabChange(item.title) : null}
|
onClick={
|
||||||
|
handleTabChange ? () => handleTabChange(item.title) : null
|
||||||
|
}
|
||||||
disabled={item.disabled}
|
disabled={item.disabled}
|
||||||
>
|
>
|
||||||
{showRadio ? (
|
{showRadio ? (
|
||||||
@ -48,6 +51,7 @@ export default function Tabs({
|
|||||||
</Tab>
|
</Tab>
|
||||||
))}
|
))}
|
||||||
</TabList>
|
</TabList>
|
||||||
|
</div>
|
||||||
<div className={styles.tabContent}>
|
<div className={styles.tabContent}>
|
||||||
{items.map((item, index) => (
|
{items.map((item, index) => (
|
||||||
<TabPanel key={index}>{item.content}</TabPanel>
|
<TabPanel key={index}>{item.content}</TabPanel>
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.input {
|
.input {
|
||||||
|
font-size: 16px; /* prevent zoom in on input focus on mobile devices */
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -1,16 +1,14 @@
|
|||||||
.filterList,
|
.filterList,
|
||||||
div.filterList {
|
div.filterList {
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
|
margin-top: 0;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
gap: calc(var(--spacer) / 4) calc(var(--spacer) / 2);
|
||||||
|
flex-direction: column;
|
||||||
align-items: baseline;
|
align-items: baseline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.separator {
|
|
||||||
width: calc(var(--spacer) / 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.filter {
|
.filter {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
@ -65,3 +63,10 @@ button.filter,
|
|||||||
.hideClear {
|
.hideClear {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 35rem) {
|
||||||
|
.filterList,
|
||||||
|
div.filterList {
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -137,6 +137,7 @@ export default function FilterPrice({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styleClasses}>
|
<div className={styleClasses}>
|
||||||
|
<div>
|
||||||
{serviceFilterItems.map((e, index) => {
|
{serviceFilterItems.map((e, index) => {
|
||||||
const isServiceSelected =
|
const isServiceSelected =
|
||||||
e.value === serviceType || serviceSelections.includes(e.value)
|
e.value === serviceType || serviceSelections.includes(e.value)
|
||||||
@ -158,7 +159,8 @@ export default function FilterPrice({
|
|||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
<div className={styles.separator} />
|
</div>
|
||||||
|
<div>
|
||||||
{accessFilterItems.map((e, index) => {
|
{accessFilterItems.map((e, index) => {
|
||||||
const isAccessSelected =
|
const isAccessSelected =
|
||||||
e.value === accessType || accessSelections.includes(e.value)
|
e.value === accessType || accessSelections.includes(e.value)
|
||||||
@ -198,5 +200,6 @@ export default function FilterPrice({
|
|||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
margin-bottom: calc(var(--spacer) / 2);
|
margin-bottom: calc(var(--spacer) / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 40rem) {
|
@media (min-width: 55rem) {
|
||||||
.row {
|
.row {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 40rem) {
|
@media (min-width: 55rem) {
|
||||||
.sortList {
|
.sortList {
|
||||||
align-self: flex-end;
|
align-self: flex-end;
|
||||||
overflow-y: unset;
|
overflow-y: unset;
|
||||||
|
Loading…
Reference in New Issue
Block a user