Skip to content

Commit

Permalink
fix: sooner style
Browse files Browse the repository at this point in the history
  • Loading branch information
molvqingtai committed Nov 3, 2024
1 parent 44f3956 commit 7e49ec2
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 76 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"remesh-logger": "^4.1.0",
"remesh-react": "^4.1.2",
"rxjs": "^7.8.1",
"sonner": "^1.6.1",
"sonner": "^1.7.0",
"tailwind-merge": "^2.5.4",
"trystero": "^0.20.0",
"type-fest": "^4.26.1",
Expand All @@ -104,7 +104,7 @@
"@types/eslint": "^9.6.1",
"@types/eslint__js": "^8.42.3",
"@types/eslint-plugin-tailwindcss": "^3.17.0",
"@types/node": "^22.8.6",
"@types/node": "^22.8.7",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/parser": "^8.12.2",
Expand Down
78 changes: 39 additions & 39 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions src/app/content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import { ToastImpl } from '@/domain/impls/Toast'
// import { PeerRoomImpl } from '@/domain/impls/PeerRoom'
import { PeerRoomImpl } from '@/domain/impls/PeerRoom2'
import '@/assets/styles/tailwind.css'
// Remove import after merging: https://github.com/emilkowalski/sonner/pull/508
import '@/assets/styles/sonner.css'
import '@/assets/styles/overlay.css'
import NotificationDomain from '@/domain/Notification'
import { createElement } from '@/utils'

Expand Down Expand Up @@ -56,13 +58,13 @@ export default defineContentScript({
container.append(app)
const root = createRoot(app)
root.render(
// <React.StrictMode>
<RemeshRoot store={store}>
<RemeshScope domains={[NotificationDomain()]}>
<App />
</RemeshScope>
</RemeshRoot>
// </React.StrictMode>
<React.StrictMode>
<RemeshRoot store={store}>
<RemeshScope domains={[NotificationDomain()]}>
<App />
</RemeshScope>
</RemeshRoot>
</React.StrictMode>
)
return root
},
Expand Down
4 changes: 2 additions & 2 deletions src/app/content/views/AppButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import LogoIcon6 from '@/assets/images/logo-6.svg'
import AppStatusDomain from '@/domain/AppStatus'
import { getDay } from 'date-fns'
import { messenger } from '@/messenger'
import useDarg from '@/hooks/useDarg'
import useDraggable from '@/hooks/useDraggable'
import useWindowResize from '@/hooks/useWindowResize'

export interface AppButtonProps {
Expand All @@ -45,7 +45,7 @@ const AppButton: FC<AppButtonProps> = ({ className }) => {
x,
y,
setRef: appButtonRef
} = useDarg({
} = useDraggable({
initX: appPosition.x,
initY: appPosition.y,
minX: 50,
Expand Down
2 changes: 1 addition & 1 deletion src/app/options/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function App() {
<VersionLink></VersionLink>
<Main>
<ProfileForm></ProfileForm>
<Toaster richColors position="top-center" duration={1000000} />
<Toaster richColors position="top-center" />
</Main>
<BadgeList></BadgeList>
</Layout>
Expand Down
17 changes: 17 additions & 0 deletions src/assets/styles/overlay.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
section[aria-live='polite'] {
display: contents;
}

:where([data-sonner-toaster]) {
max-width: 300px;
position: absolute;
display: flex;
justify-content: center;
}

:where([data-sonner-toast][data-styled='true']) {
max-width: 300px;
padding: 6px 12px;
border-radius: 9999px;
width: fit-content;
}
Loading

0 comments on commit 7e49ec2

Please sign in to comment.