-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Improve UX for mobile user (#479)
* fix: Improve UX for mobile user --------- Co-authored-by: Willy Douhard <[email protected]>
- Loading branch information
1 parent
ba93c76
commit 8747400
Showing
11 changed files
with
110 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
frontend/src/components/organisms/conversationsHistory/sidebar/OpenChatHistoryButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { useRecoilState } from 'recoil'; | ||
|
||
import KeyboardDoubleArrowRightIcon from '@mui/icons-material/KeyboardDoubleArrowRight'; | ||
import Box from '@mui/material/Box'; | ||
import IconButton from '@mui/material/IconButton'; | ||
|
||
import { settingsState } from 'state/settings'; | ||
|
||
const OpenChatHistoryButton = ({ mode }: { mode: 'mobile' | 'desktop' }) => { | ||
const [settings, setSettings] = useRecoilState(settingsState); | ||
const isDesktop = mode === 'desktop'; | ||
|
||
return !settings.isChatHistoryOpen ? ( | ||
<Box | ||
sx={ | ||
isDesktop | ||
? { | ||
zIndex: 1, | ||
mt: 1, | ||
ml: 1, | ||
display: 'none', | ||
'@media (min-width: 66rem)': { | ||
position: 'absolute', | ||
display: 'block' | ||
} | ||
} | ||
: {} | ||
} | ||
> | ||
<IconButton | ||
sx={{ | ||
borderRadius: isDesktop ? 1 : 8, | ||
backgroundColor: (theme) => theme.palette.background.paper | ||
}} | ||
onClick={() => | ||
setSettings((prev) => ({ | ||
...prev, | ||
isChatHistoryOpen: true | ||
})) | ||
} | ||
> | ||
<KeyboardDoubleArrowRightIcon /> | ||
</IconButton> | ||
</Box> | ||
) : null; | ||
}; | ||
|
||
export default OpenChatHistoryButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters