Skip to content

Commit 42e0587

Browse files
committed
Fix the layout on tablets and mobile devices
1 parent eef3b09 commit 42e0587

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

build/webchatgpt-3.2.7-chrome.zip

4.77 KB
Binary file not shown.

build/webchatgpt-3.2.7-firefox.zip

4.77 KB
Binary file not shown.

src/components/toolbar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ const Toolbar = ({ textarea }: ToolbarProps) => {
132132
</div>
133133

134134
return (
135-
<div className="wcg-flex wcg-flex-col wcg-gap-0">
136-
<div className="wcg-toolbar wcg-flex wcg-items-center wcg-gap-2 wcg-rounded-md wcg-px-1">
135+
<div className="wcg-flex wcg-flex-col wcg-gap-1 wcg-py-1">
136+
<div className="wcg-toolbar wcg-flex wcg-justify-center wcg-items-center wcg-gap-2 wcg-rounded-md wcg-px-1">
137137
<div className="wcg-btn-xs wcg-btn focus:wcg-ring-2 focus:wcg-ring-white"
138138
tabIndex={0}
139139
onClick={() => Browser.runtime.sendMessage("show_options")}

src/content-scripts/mainUI.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@ async function updateUI() {
170170
async function renderToolbar() {
171171

172172
try {
173-
const textareaParentParent = textarea?.parentElement?.parentElement
173+
const textareaParentParent = textarea?.parentElement?.parentElement?.parentElement?.parentElement
174174
const { shadowRootDiv, shadowRoot } = await createShadowRoot('content-scripts/mainUI.css')
175175
shadowRootDiv.classList.add('wcg-toolbar')
176-
textareaParentParent?.appendChild(shadowRootDiv)
176+
textareaParentParent?.insertBefore(shadowRootDiv, textareaParentParent?.childNodes[1])
177177
render(<Toolbar textarea={textarea} />, shadowRoot)
178178

179179
} catch (e) {

0 commit comments

Comments
 (0)