Skip to content
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

Fix the layout on tablets and mobile devices #165

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified build/webchatgpt-3.2.7-chrome.zip
Binary file not shown.
Binary file modified build/webchatgpt-3.2.7-firefox.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions src/components/toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ const Toolbar = ({ textarea }: ToolbarProps) => {
</div>

return (
<div className="wcg-flex wcg-flex-col wcg-gap-0">
<div className="wcg-toolbar wcg-flex wcg-items-center wcg-gap-2 wcg-rounded-md wcg-px-1">
<div className="wcg-flex wcg-flex-col wcg-gap-1 wcg-py-1">
<div className="wcg-toolbar wcg-flex wcg-justify-center wcg-items-center wcg-gap-2 wcg-rounded-md wcg-px-1">
<div className="wcg-btn-xs wcg-btn focus:wcg-ring-2 focus:wcg-ring-white"
tabIndex={0}
onClick={() => Browser.runtime.sendMessage("show_options")}
Expand Down
4 changes: 2 additions & 2 deletions src/content-scripts/mainUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ async function updateUI() {
async function renderToolbar() {

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

} catch (e) {
Expand Down