-
Notifications
You must be signed in to change notification settings - Fork 205
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
Enhance: Admin settings page responsive #2475
Changes from 8 commits
24874db
5319a8b
85187e0
8380a53
4ff866f
71e6b10
622e578
c282960
43faa42
e1b2a7a
ea531c7
4aaafdc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -255,12 +255,23 @@ | |
|
||
@media only screen and (max-width: 375px) { | ||
.dokan-admin-notices { | ||
.notice-content{ | ||
flex-direction: column; | ||
align-items: start !important; | ||
gap: 1rem; | ||
} | ||
.dokan-notice-slides { | ||
min-height: 245px; | ||
|
||
.dokan-admin-notice { | ||
align-items: start; | ||
padding: 10px 20px; | ||
.dokan-message { | ||
margin: 0 0 0 23px; | ||
div{ | ||
max-height: 50px; | ||
overflow: auto; | ||
} | ||
margin: 0; | ||
} | ||
} | ||
} | ||
|
@@ -276,21 +287,33 @@ | |
|
||
@media screen and (min-width: 376px) and (max-width: 576px) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we care about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bhai, |
||
.dokan-admin-notices { | ||
|
||
.notice-content{ | ||
flex-direction: column; | ||
align-items: start !important; | ||
gap: 1rem; | ||
height: 195px; | ||
} | ||
.dokan-notice-slides { | ||
min-height: 195px; | ||
|
||
.dokan-admin-notice { | ||
align-items: start; | ||
padding: 10px 20px; | ||
.dokan-message { | ||
margin: 0 0 0 23px; | ||
div{ | ||
max-height: 50px; | ||
overflow: scroll; | ||
} | ||
margin: 0; | ||
} | ||
} | ||
} | ||
|
||
.slide-notice { | ||
bottom: 0; | ||
right: 10px; | ||
right: 3rem; | ||
padding: 3px 8px; | ||
top: unset; | ||
top: 2rem; | ||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<template> | ||
<div> | ||
<div | ||
v-if="isOpen" | ||
class="fixed inset-0 bg-black bg-opacity-50 z-[999999]" | ||
@click="$emit('close')" | ||
></div> | ||
|
||
<!-- Drawer --> | ||
<div | ||
:class="[ | ||
'fixed top-0 left-0 h-full w-[85%] max-w-[320px] bg-white z-[1000000] transform transition-transform duration-300 ease-in-out', | ||
isOpen ? 'translate-x-0' : '-translate-x-full' | ||
]" | ||
> | ||
<!-- Drawer Header --> | ||
<div class="flex items-center justify-between p-4 border-b mt-8"> | ||
<h2 class="text-lg font-bold m-0 p-0">{{ __('Settings Menu', 'dokan-lite') }}</h2> | ||
<button | ||
class="bg-none border-0 p-1" | ||
@click="$emit('close')" | ||
> | ||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"> | ||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /> | ||
</svg> | ||
</button> | ||
</div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance drawer accessibility and keyboard navigation. The drawer should trap focus when open and manage focus states properly. <div
:class="[
'fixed top-0 left-0 h-full w-[85%] max-w-[320px] bg-white z-[1000000] transform transition-transform duration-300 ease-in-out',
isOpen ? 'translate-x-0' : '-translate-x-full'
]"
+ role="dialog"
+ aria-modal="true"
+ aria-labelledby="drawer-title"
+ @keydown.esc="$emit('close')"
>
<!-- Drawer Header -->
<div class="flex items-center justify-between p-4 border-b mt-8">
- <h2 class="text-lg font-bold m-0 p-0">{{ __('Settings Menu', 'dokan-lite') }}</h2>
+ <h2 id="drawer-title" class="text-lg font-bold m-0 p-0">{{ __('Settings Menu', 'dokan-lite') }}</h2>
<button
class="bg-none border-0 p-1"
+ aria-label="Close settings menu"
@click="$emit('close')"
>
|
||
|
||
<!-- Settings List --> | ||
<div class="overflow-y-auto h-[calc(100%-64px)]"> | ||
<template v-for="section in sections"> | ||
<div | ||
:key="section.id" | ||
:class="[ | ||
'flex items-center px-4 py-2 cursor-pointer border-b border-gray-100', | ||
{ 'bg-blue-50 border-l-4 border-l-blue-500': currentTab === section.id } | ||
]" | ||
@click="handleTabChange(section)" | ||
> | ||
<img | ||
:src="section.icon_url" | ||
:alt="section.settings_title" | ||
class="w-5 h-5 mr-3" | ||
/> | ||
<div class="flex-1"> | ||
<h3 class="text-sm font-semibold">{{ section.title }}</h3> | ||
<p class="text-xs text-gray-600">{{ section.description }}</p> | ||
</div> | ||
</div> | ||
</template> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
|
||
export default { | ||
name: 'MobileSettingsDrawer', | ||
|
||
props: { | ||
isOpen: { | ||
type: Boolean, | ||
required: true | ||
}, | ||
sections: { | ||
type: Array, | ||
required: true | ||
}, | ||
currentTab: { | ||
type: String, | ||
required: true | ||
} | ||
}, | ||
|
||
methods: { | ||
handleTabChange(section) { | ||
this.$emit('change-tab', section); | ||
this.$emit('close'); | ||
} | ||
}, | ||
} | ||
</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section is also used for 576px. Could remove this replication?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@media only screen and (max-width: 375px) for very small screen
@media screen and (min-width: 376px) and (max-width: 576px) for small screen.
two separate scrreen bhai .
as it is not conflicted code ,we can skip.