Skip to content

Commit

Permalink
Open settings panel on btn click on mobiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
diksipav committed Sep 6, 2023
1 parent 65fae85 commit 805a485
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@
grid-template-columns: 1fr;
padding: 0;
}

@include breakpoint(mobile) {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 10;
}
}

.sessionBar {
Expand Down
4 changes: 3 additions & 1 deletion shared/studio/components/sessionState/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export function SessionStateControls() {
export const SessionStateButton = observer(function SessionStateButton() {
const sessionState = useDatabaseState().sessionState;
const targetEl = document.getElementById("sessionStateControls");
const isMobile = useIsMobile();

if (targetEl) {
return createPortal(
Expand All @@ -41,7 +42,8 @@ export const SessionStateButton = observer(function SessionStateButton() {
[styles.panelOpen]: sessionState.panelOpen,
})}
onClick={() => {
if (sessionState.barOpen) {
if (isMobile) sessionState.openPanel();
else if (sessionState.barOpen) {
sessionState.closePanel();
sessionState.setBarOpen(false);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,10 @@
transition: opacity 0.2s 0s, z-index 0s 0.2s;

@include breakpoint(mobile) {
position: fixed;
top: 0;
left: 0;
right: 0;
width: 100vw;
background: #d9d9d9;

@include darkTheme {
Expand Down

0 comments on commit 805a485

Please sign in to comment.